From 6a3de86588be1193c85005ef44e69b1919096e78 Mon Sep 17 00:00:00 2001 From: gram-incolo Date: Sun, 9 Jun 2024 23:56:21 +0300 Subject: [PATCH] fix error in the tests --- easel/test/extensions/size_extensions.dart | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/easel/test/extensions/size_extensions.dart b/easel/test/extensions/size_extensions.dart index d643d3ab2d..32a1375beb 100644 --- a/easel/test/extensions/size_extensions.dart +++ b/easel/test/extensions/size_extensions.dart @@ -7,21 +7,30 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; extension SetScreenSize on WidgetTester { - Future setScreenSize({double width = 480, double height = 965, double pixelDensity = 1}) async { + Future setScreenSize( + {double width = 480, + double height = 965, + double pixelDensity = 1}) async { final size = Size(width, height); await binding.setSurfaceSize(size); view.physicalSize = size; view.devicePixelRatio = pixelDensity; } - Future testAppForWidgetTesting(Widget child, {Duration duration = Duration.zero}) async { + Future testAppForWidgetTesting(Widget child, + {Duration duration = Duration.zero}) async { SharedPreferences.setMockInitialValues({}); await EasyLocalization.ensureInitialized(); return pumpWidget(Builder(builder: (context) { return EasyLocalization( - supportedLocales: const [Locale('en', 'US'), Locale('ru', 'RU'), Locale('es'), Locale('de')], + supportedLocales: const [ + Locale('en', 'US'), + Locale('ru', 'RU'), + Locale('es'), + Locale('de') + ], path: 'i18n', fallbackLocale: const Locale('en'), useOnlyLangCode: true, @@ -36,7 +45,8 @@ extension SetScreenSize on WidgetTester { builder: (context, widget) { ScreenUtil.init(context); return MediaQuery( - data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling), + data: MediaQuery.of(context) + .copyWith(textScaler: TextScaler.noScaling), child: widget!, ); }, @@ -45,6 +55,6 @@ extension SetScreenSize on WidgetTester { }, ), ); - }), duration); + })); } }