Replace all MediaQuery.of(context).size with MediaQuery.sizeOf(context) (#5328)

This commit is contained in:
Edouard Marquez
2024-06-03 17:09:37 +02:00
committed by GitHub
parent c26528c9b9
commit 1728eff579
37 changed files with 42 additions and 43 deletions

View File

@ -31,7 +31,7 @@ class ProductImageCarouselItem extends StatefulWidget {
class _ProductImageCarouselItemState extends State<ProductImageCarouselItem> { class _ProductImageCarouselItemState extends State<ProductImageCarouselItem> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
context.watch<LocalDatabase>(); context.watch<LocalDatabase>();
final ImageProvider? imageProvider = TransientFile.fromProductImageData( final ImageProvider? imageProvider = TransientFile.fromProductImageData(

View File

@ -35,7 +35,7 @@ class SmoothProductCardFound extends StatelessWidget {
final UserPreferences userPreferences = context.watch<UserPreferences>(); final UserPreferences userPreferences = context.watch<UserPreferences>();
final ProductPreferences productPreferences = final ProductPreferences productPreferences =
context.watch<ProductPreferences>(); context.watch<ProductPreferences>();
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
final ThemeData themeData = Theme.of(context); final ThemeData themeData = Theme.of(context);
final bool isDarkMode = themeData.colorScheme.brightness == Brightness.dark; final bool isDarkMode = themeData.colorScheme.brightness == Brightness.dark;
final List<String> excludedAttributeIds = final List<String> excludedAttributeIds =

View File

@ -24,7 +24,7 @@ class SmoothProductCardTemplate extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
final ThemeData themeData = Theme.of(context); final ThemeData themeData = Theme.of(context);
final bool isDarkMode = themeData.colorScheme.brightness == Brightness.dark; final bool isDarkMode = themeData.colorScheme.brightness == Brightness.dark;
final Color itemColor = isDarkMode ? PRIMARY_GREY_COLOR : LIGHT_GREY_COLOR; final Color itemColor = isDarkMode ? PRIMARY_GREY_COLOR : LIGHT_GREY_COLOR;

View File

@ -670,9 +670,9 @@ class SmoothListAlertDialog extends StatelessWidget {
vertical: SMALL_SPACE, vertical: SMALL_SPACE,
), ),
body: SizedBox( body: SizedBox(
height: MediaQuery.of(context).size.height / height: MediaQuery.sizeOf(context).height /
(context.keyboardVisible ? 1.0 : 1.5), (context.keyboardVisible ? 1.0 : 1.5),
width: MediaQuery.of(context).size.width, width: MediaQuery.sizeOf(context).width,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(

View File

@ -16,7 +16,7 @@ class IconWidgetSizer {
static const double _ICON_WIDGET_SIZE_RATIO = 1 / 10; static const double _ICON_WIDGET_SIZE_RATIO = 1 / 10;
static double getIconSizeFromContext(BuildContext context) { static double getIconSizeFromContext(BuildContext context) {
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
return screenSize.width * _ICON_WIDGET_SIZE_RATIO; return screenSize.width * _ICON_WIDGET_SIZE_RATIO;
} }

View File

@ -141,7 +141,7 @@ class _CropPageState extends State<CropPage> {
@override @override
Widget build(final BuildContext context) { Widget build(final BuildContext context) {
_screenSize = MediaQuery.of(context).size; _screenSize = MediaQuery.sizeOf(context);
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
return WillPopScope2( return WillPopScope2(
onWillPop: _onWillPop, onWillPop: _onWillPop,

View File

@ -167,7 +167,7 @@ class _Header extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
final double multiplier = final double multiplier =
math.min(350, MediaQuery.of(context).size.height * 0.3) / 235; math.min(350, MediaQuery.sizeOf(context).height * 0.3) / 235;
return Semantics( return Semantics(
enabled: true, enabled: true,

View File

@ -23,7 +23,7 @@ class QuestionAnswersOptions extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final double yesNoHeight = MediaQuery.of(context).size.width / (3 * 1.25); final double yesNoHeight = MediaQuery.sizeOf(context).width / (3 * 1.25);
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

View File

@ -30,7 +30,7 @@ class QuestionCard extends StatelessWidget {
context.read<LocalDatabase>(), context.read<LocalDatabase>(),
); );
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
return FutureBuilder<FetchedProduct>( return FutureBuilder<FetchedProduct>(
future: productFuture, future: productFuture,

View File

@ -44,7 +44,7 @@ class _LocationQueryPageState extends State<LocationQueryPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
final ThemeData themeData = Theme.of(context); final ThemeData themeData = Theme.of(context);
return ChangeNotifierProvider<LocationQueryModel>.value( return ChangeNotifierProvider<LocationQueryModel>.value(

View File

@ -32,7 +32,7 @@ class _OfflineDataPageState extends State<OfflineDataPage> {
// TODO(ashaman999): replaace the header asset with a custom one for this page // TODO(ashaman999): replaace the header asset with a custom one for this page
const String headerAsset = 'assets/preferences/main.svg'; const String headerAsset = 'assets/preferences/main.svg';
final bool dark = Theme.of(context).brightness == Brightness.dark; final bool dark = Theme.of(context).brightness == Brightness.dark;
final double backgroundHeight = MediaQuery.of(context).size.height * .20; final double backgroundHeight = MediaQuery.sizeOf(context).height * .20;
final LocalDatabase localDatabase = context.watch<LocalDatabase>(); final LocalDatabase localDatabase = context.watch<LocalDatabase>();
final DaoProduct daoProduct = DaoProduct(localDatabase); final DaoProduct daoProduct = DaoProduct(localDatabase);
final DaoProductLastAccess daoProductLastAccess = final DaoProductLastAccess daoProductLastAccess =

View File

@ -20,7 +20,7 @@ class ConsentAnalyticsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
return ColoredBox( return ColoredBox(
color: backgroundColor, color: backgroundColor,

View File

@ -103,8 +103,7 @@ class _KnowledgePanelPageTemplateState
children: <Widget>[ children: <Widget>[
SvgPicture.asset( SvgPicture.asset(
widget.svgAsset, widget.svgAsset,
height: height: MediaQuery.sizeOf(context).height * .25,
MediaQuery.of(context).size.height * .25,
package: AppHelper.APP_PACKAGE, package: AppHelper.APP_PACKAGE,
), ),
Padding( Padding(

View File

@ -24,7 +24,7 @@ class OnboardingBottomBar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
// Side padding is 8% of total width. // Side padding is 8% of total width.
final double sidePadding = screenSize.width * .08; final double sidePadding = screenSize.width * .08;
final bool hasPrevious = rightButton != null; final bool hasPrevious = rightButton != null;

View File

@ -82,7 +82,7 @@ class _HelperState extends State<_Helper> {
final List<Widget> pageData = <Widget>[ final List<Widget> pageData = <Widget>[
SvgPicture.asset( SvgPicture.asset(
'assets/onboarding/preferences.svg', 'assets/onboarding/preferences.svg',
height: MediaQuery.of(context).size.height * .25, height: MediaQuery.sizeOf(context).height * .25,
package: AppHelper.APP_PACKAGE, package: AppHelper.APP_PACKAGE,
), ),
Padding( Padding(

View File

@ -25,7 +25,7 @@ class ReinventionPage extends StatelessWidget {
.textTheme .textTheme
.displayMedium! .displayMedium!
.copyWith(fontSize: muchTooBigFontSize); .copyWith(fontSize: muchTooBigFontSize);
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
final double animHeight = 352.0 * screenSize.width / 375.0; final double animHeight = 352.0 * screenSize.width / 375.0;
return Container( return Container(

View File

@ -17,7 +17,7 @@ class ScanExample extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
return Container( return Container(
color: backgroundColor, color: backgroundColor,
child: Column( child: Column(

View File

@ -22,7 +22,7 @@ class WelcomePage extends StatelessWidget {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle headlineStyle = theme.textTheme.displayMedium!.wellSpaced; final TextStyle headlineStyle = theme.textTheme.displayMedium!.wellSpaced;
final TextStyle bodyTextStyle = theme.textTheme.bodyLarge!.wellSpaced; final TextStyle bodyTextStyle = theme.textTheme.bodyLarge!.wellSpaced;
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
return SmoothScaffold( return SmoothScaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,

View File

@ -97,7 +97,7 @@ class UserPreferencesAccount extends AbstractUserPreferences {
return null; return null;
} }
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final Size size = MediaQuery.of(context).size; final Size size = MediaQuery.sizeOf(context);
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: size.width / 4, left: size.width / 4,
@ -131,7 +131,7 @@ class UserPreferencesAccount extends AbstractUserPreferences {
List<UserPreferencesItem> getChildren() { List<UserPreferencesItem> getChildren() {
if (OpenFoodAPIConfiguration.globalUser == null) { if (OpenFoodAPIConfiguration.globalUser == null) {
// No credentials // No credentials
final Size size = MediaQuery.of(context).size; final Size size = MediaQuery.sizeOf(context);
return <UserPreferencesItem>[ return <UserPreferencesItem>[
UserPreferencesItemSimple( UserPreferencesItemSimple(
labels: <String>[appLocalizations.sign_in], labels: <String>[appLocalizations.sign_in],

View File

@ -239,7 +239,7 @@ class UserPreferencesFaq extends AbstractUserPreferences {
children: <Widget>[ children: <Widget>[
SvgPicture.asset( SvgPicture.asset(
logo, logo,
width: MediaQuery.of(context).size.width * 0.1, width: MediaQuery.sizeOf(context).width * 0.1,
package: AppHelper.APP_PACKAGE, package: AppHelper.APP_PACKAGE,
), ),
const SizedBox(width: SMALL_SPACE), const SizedBox(width: SMALL_SPACE),
@ -320,7 +320,7 @@ class UserPreferencesFaq extends AbstractUserPreferences {
applicationVersion: packageInfo.version, applicationVersion: packageInfo.version,
applicationIcon: SvgPicture.asset( applicationIcon: SvgPicture.asset(
logo, logo,
height: MediaQuery.of(context).size.height * 0.1, height: MediaQuery.sizeOf(context).height * 0.1,
), ),
), ),
label: appLocalizations.licenses, label: appLocalizations.licenses,

View File

@ -228,7 +228,7 @@ class _UserPreferencesPageState extends State<UserPreferencesPage>
); );
} }
final bool dark = Theme.of(context).brightness == Brightness.dark; final bool dark = Theme.of(context).brightness == Brightness.dark;
final double backgroundHeight = MediaQuery.of(context).size.height * .20; final double backgroundHeight = MediaQuery.sizeOf(context).height * .20;
children.insert( children.insert(
0, 0,
Container( Container(

View File

@ -169,7 +169,7 @@ class AddNewProductScoreIcon extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final String url = iconUrl ?? defaultIconUrl; final String url = iconUrl ?? defaultIconUrl;
final String fileName = Uri.parse(url).pathSegments.last; final String fileName = Uri.parse(url).pathSegments.last;
final double height = MediaQuery.of(context).size.height * .2; final double height = MediaQuery.sizeOf(context).height * .2;
if (fileName.startsWith('nutriscore')) { if (fileName.startsWith('nutriscore')) {
return _AddNewProductNutriScoreIcon( return _AddNewProductNutriScoreIcon(

View File

@ -52,7 +52,7 @@ class _AddOtherDetailsPageState extends State<AddOtherDetailsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size; final Size size = MediaQuery.sizeOf(context);
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
return WillPopScope2( return WillPopScope2(
onWillPop: () async => (await _mayExitPage(saving: false), null), onWillPop: () async => (await _mayExitPage(saving: false), null),

View File

@ -60,7 +60,7 @@ class ProductDialogHelper {
void _openProductNotFoundDialog() => showDialog<Widget>( void _openProductNotFoundDialog() => showDialog<Widget>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
final double availableWidth = MediaQuery.of(context).size.width - final double availableWidth = MediaQuery.sizeOf(context).width -
SmoothAlertDialog.defaultMargin.horizontal - SmoothAlertDialog.defaultMargin.horizontal -
SmoothAlertDialog.defaultContentPadding(context).horizontal; SmoothAlertDialog.defaultContentPadding(context).horizontal;

View File

@ -261,7 +261,7 @@ class _ProductListPageState extends State<ProductListPage>
SvgPicture.asset( SvgPicture.asset(
'assets/misc/empty-list.svg', 'assets/misc/empty-list.svg',
package: AppHelper.APP_PACKAGE, package: AppHelper.APP_PACKAGE,
width: MediaQuery.of(context).size.width / 2, width: MediaQuery.sizeOf(context).width / 2,
), ),
Text( Text(
appLocalizations.product_list_empty_message, appLocalizations.product_list_empty_message,

View File

@ -96,7 +96,7 @@ class _ProductQueryPageState extends State<ProductQueryPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
final ThemeData themeData = Theme.of(context); final ThemeData themeData = Theme.of(context);
return ChangeNotifierProvider<ProductQueryModel>.value( return ChangeNotifierProvider<ProductQueryModel>.value(
@ -264,7 +264,7 @@ class _ProductQueryPageState extends State<ProductQueryPage>
return const Center(child: CircularProgressIndicator()); return const Center(child: CircularProgressIndicator());
} }
return SizedBox( return SizedBox(
height: MediaQuery.of(context).size.height / 4, height: MediaQuery.sizeOf(context).height / 4,
); );
} }
return ProductListItemSimple( return ProductListItemSimple(

View File

@ -37,7 +37,7 @@ class ProductRefresher {
children: <Widget>[ children: <Widget>[
SvgPicture.asset( SvgPicture.asset(
'assets/onboarding/globe.svg', 'assets/onboarding/globe.svg',
height: MediaQuery.of(context).size.height * .5, height: MediaQuery.sizeOf(context).height * .5,
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 25), padding: const EdgeInsets.symmetric(horizontal: 25),

View File

@ -104,7 +104,7 @@ class _CompareProducts3PageState extends State<CompareProducts3Page> {
final List<String> brands = <String>[]; final List<String> brands = <String>[];
final List<String> quantities = <String>[]; final List<String> quantities = <String>[];
final List<Widget> pictures = <Widget>[]; final List<Widget> pictures = <Widget>[];
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
for (final Product product in widget.products) { for (final Product product in widget.products) {
names.add(getProductName(product, appLocalizations)); names.add(getProductName(product, appLocalizations));
brands.add(getProductBrands(product, appLocalizations)); brands.add(getProductBrands(product, appLocalizations));

View File

@ -156,7 +156,7 @@ class _EditOcrPageState extends State<EditOcrPage> with UpToDateMixin {
); );
Widget _getImageWidget(final TransientFile transientFile) { Widget _getImageWidget(final TransientFile transientFile) {
final Size size = MediaQuery.of(context).size; final Size size = MediaQuery.sizeOf(context);
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
final ImageProvider? imageProvider = transientFile.getImageProvider(); final ImageProvider? imageProvider = transientFile.getImageProvider();

View File

@ -386,7 +386,7 @@ class _ProductBarcodeState extends State<_ProductBarcode> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
final Brightness brightness = Theme.of(context).brightness; final Brightness brightness = Theme.of(context).brightness;
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.sizeOf(context);
return BarcodeWidget( return BarcodeWidget(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(

View File

@ -22,7 +22,7 @@ class ProductQuestionAnswersOptions extends StatelessWidget {
const Color yesNoTextColor = Colors.white; const Color yesNoTextColor = Colors.white;
final Color maybeTextColor = Colors.grey.shade700; final Color maybeTextColor = Colors.grey.shade700;
final double yesNoHeight = MediaQuery.of(context).size.width / (6); final double yesNoHeight = MediaQuery.sizeOf(context).width / (6);
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

View File

@ -69,7 +69,7 @@ class _ForgotPasswordPageState extends State<ForgotPasswordPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
final Size size = MediaQuery.of(context).size; final Size size = MediaQuery.sizeOf(context);
return SmoothScaffold( return SmoothScaffold(
appBar: SmoothAppBar( appBar: SmoothAppBar(

View File

@ -87,7 +87,7 @@ class _LoginPageState extends State<LoginPage> with TraceableClientMixin {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
final Size size = MediaQuery.of(context).size; final Size size = MediaQuery.sizeOf(context);
return SmoothScaffold( return SmoothScaffold(
statusBarBackgroundColor: SmoothScaffold.semiTranslucentStatusBar, statusBarBackgroundColor: SmoothScaffold.semiTranslucentStatusBar,
@ -121,7 +121,7 @@ class _LoginPageState extends State<LoginPage> with TraceableClientMixin {
children: <Widget>[ children: <Widget>[
SvgPicture.asset( SvgPicture.asset(
'assets/preferences/login.svg', 'assets/preferences/login.svg',
height: MediaQuery.of(context).size.height * .15, height: MediaQuery.sizeOf(context).height * .15,
package: AppHelper.APP_PACKAGE, package: AppHelper.APP_PACKAGE,
), ),
Text( Text(

View File

@ -53,7 +53,7 @@ class _SignUpPageState extends State<SignUpPage> with TraceableClientMixin {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final AppLocalizations appLocalizations = AppLocalizations.of(context); final AppLocalizations appLocalizations = AppLocalizations.of(context);
final Size size = MediaQuery.of(context).size; final Size size = MediaQuery.sizeOf(context);
Color getCheckBoxColor(Set<MaterialState> states) { Color getCheckBoxColor(Set<MaterialState> states) {
const Set<MaterialState> interactiveStates = <MaterialState>{ const Set<MaterialState> interactiveStates = <MaterialState>{

View File

@ -30,7 +30,7 @@ class AttributeButton extends StatelessWidget {
productPreferences.getImportanceIdForAttributeId(attribute.id!); productPreferences.getImportanceIdForAttributeId(attribute.id!);
const double horizontalPadding = LARGE_SPACE; const double horizontalPadding = LARGE_SPACE;
final double widgetWidth = final double widgetWidth =
MediaQuery.of(context).size.width - 2 * horizontalPadding; MediaQuery.sizeOf(context).width - 2 * horizontalPadding;
final double importanceWidth = widgetWidth / 4; final double importanceWidth = widgetWidth / 4;
final TextStyle style = themeData.textTheme.headlineMedium!; final TextStyle style = themeData.textTheme.headlineMedium!;
final String? info = attribute.settingNote; final String? info = attribute.settingNote;

View File

@ -22,7 +22,7 @@ class RankingFloatingActionButton extends StatelessWidget {
child: Container( child: Container(
height: MINIMUM_TOUCH_SIZE, height: MINIMUM_TOUCH_SIZE,
margin: margin:
EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.09), EdgeInsets.only(left: MediaQuery.sizeOf(context).width * 0.09),
alignment: Alignment.center, alignment: Alignment.center,
child: SizedBox( child: SizedBox(
height: MINIMUM_TOUCH_SIZE, height: MINIMUM_TOUCH_SIZE,

View File

@ -203,7 +203,7 @@ class _SmoothProductCarouselState extends State<SmoothProductCarousel> {
} }
double _computeViewPortFraction() { double _computeViewPortFraction() {
final double screenWidth = MediaQuery.of(context).size.width; final double screenWidth = MediaQuery.sizeOf(context).width;
return (screenWidth - return (screenWidth -
(SmoothBarcodeScannerVisor.CORNER_PADDING * 2) - (SmoothBarcodeScannerVisor.CORNER_PADDING * 2) -
(SmoothBarcodeScannerVisor.STROKE_WIDTH * 2) + (SmoothBarcodeScannerVisor.STROKE_WIDTH * 2) +