mirror of
https://github.com/openfoodfacts/smooth-app.git
synced 2025-08-26 20:00:15 +08:00
Replace all MediaQuery.of(context).size
with MediaQuery.sizeOf(context)
(#5328)
This commit is contained in:
@ -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(
|
||||||
|
@ -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 =
|
||||||
|
@ -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;
|
||||||
|
@ -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(
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
@ -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,
|
||||||
|
@ -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,
|
||||||
|
@ -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,
|
||||||
|
@ -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(
|
||||||
|
@ -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 =
|
||||||
|
@ -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,
|
||||||
|
@ -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(
|
||||||
|
@ -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;
|
||||||
|
@ -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(
|
||||||
|
@ -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(
|
||||||
|
@ -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(
|
||||||
|
@ -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,
|
||||||
|
@ -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],
|
||||||
|
@ -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,
|
||||||
|
@ -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(
|
||||||
|
@ -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(
|
||||||
|
@ -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),
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
@ -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(
|
||||||
|
@ -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),
|
||||||
|
@ -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));
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
@ -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(
|
||||||
|
@ -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,
|
||||||
|
@ -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(
|
||||||
|
@ -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(
|
||||||
|
@ -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>{
|
||||||
|
@ -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;
|
||||||
|
@ -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,
|
||||||
|
@ -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) +
|
||||||
|
Reference in New Issue
Block a user