@@ -91,10 +91,7 @@ void main() {
9191 group ('saveFile and saveImage' , () {
9292 testWidgets ('saveFile JSON round-trip' , (tester) async {
9393 const key = 'integration_json_file_key' ;
94- final data = < String , dynamic > {
95- 'hello' : 'world' ,
96- 'n' : 42 ,
97- };
94+ final data = < String , dynamic > {'hello' : 'world' , 'n' : 42 };
9895 final jsonStr = jsonEncode (data);
9996 final path = await HomeWidget .saveFile (
10097 key,
@@ -118,8 +115,9 @@ void main() {
118115 expect (read, orderedEquals (expected));
119116 });
120117
121- testWidgets ('saveImage decodes asset and saves valid 1x1 PNG' ,
122- (tester) async {
118+ testWidgets ('saveImage decodes asset and saves valid 1x1 PNG' , (
119+ tester,
120+ ) async {
123121 const key = 'integration_save_image_key' ;
124122 final path = await HomeWidget .saveImage (
125123 key,
@@ -134,8 +132,9 @@ void main() {
134132 expect (frame.image.height, 1 );
135133 });
136134
137- testWidgets ('saveFile then clear key removes data and file' ,
138- (tester) async {
135+ testWidgets ('saveFile then clear key removes data and file' , (
136+ tester,
137+ ) async {
139138 const key = 'integration_savefile_clear_key' ;
140139 final data = < String , dynamic > {'clear' : 'test' };
141140 final jsonStr = jsonEncode (data);
@@ -151,22 +150,23 @@ void main() {
151150 });
152151
153152 testWidgets (
154- 'saveFile then clear key with deleteFile false removes path but keeps file' ,
155- (tester) async {
156- const key = 'integration_savefile_clear_no_delete_key' ;
157- final data = < String , dynamic > {'keep' : 'on_disk' };
158- final jsonStr = jsonEncode (data);
159- final path = await HomeWidget .saveFile (
160- key,
161- Uint8List .fromList (utf8.encode (jsonStr)),
162- extension : 'json' ,
163- );
164- expect (await File (path).exists (), isTrue);
165- await HomeWidget .saveWidgetData (key, null , deleteFile: false );
166- expect (await HomeWidget .getWidgetData (key), isNull);
167- expect (await File (path).exists (), isTrue);
168- expect (jsonDecode (await File (path).readAsString ()), data);
169- });
153+ 'saveFile then clear key with deleteFile false removes path but keeps file' ,
154+ (tester) async {
155+ const key = 'integration_savefile_clear_no_delete_key' ;
156+ final data = < String , dynamic > {'keep' : 'on_disk' };
157+ final jsonStr = jsonEncode (data);
158+ final path = await HomeWidget .saveFile (
159+ key,
160+ Uint8List .fromList (utf8.encode (jsonStr)),
161+ extension : 'json' ,
162+ );
163+ expect (await File (path).exists (), isTrue);
164+ await HomeWidget .saveWidgetData (key, null , deleteFile: false );
165+ expect (await HomeWidget .getWidgetData (key), isNull);
166+ expect (await File (path).exists (), isTrue);
167+ expect (jsonDecode (await File (path).readAsString ()), data);
168+ },
169+ );
170170 });
171171
172172 testWidgets ('Update Widget completes' , (tester) async {
@@ -198,31 +198,30 @@ void main() {
198198
199199 group ('Initially Launched' , () {
200200 testWidgets (
201- 'Initially Launched completes and returns null if not launched from widget' ,
202- (tester) async {
203- await HomeWidget .setAppGroupId (integrationAppGroupId);
204- final retrievedData =
205- await HomeWidget .initiallyLaunchedFromHomeWidget ();
206- expect (retrievedData, isNull);
207- });
201+ 'Initially Launched completes and returns null if not launched from widget' ,
202+ (tester) async {
203+ await HomeWidget .setAppGroupId (integrationAppGroupId);
204+ final retrievedData =
205+ await HomeWidget .initiallyLaunchedFromHomeWidget ();
206+ expect (retrievedData, isNull);
207+ },
208+ );
208209
209210 group ('Register Background Callback' , () {
210- testWidgets ('RegisterBackgroundCallback completes without error' ,
211- (tester) async {
211+ testWidgets ('RegisterBackgroundCallback completes without error' , (
212+ tester,
213+ ) async {
212214 final deviceInfo = await DeviceInfoPlugin ().iosInfo;
213215 final hasInteractiveWidgets =
214216 double .parse (deviceInfo.systemVersion.split ('.' ).first) >= 17.0 ;
215217 await HomeWidget .setAppGroupId (integrationAppGroupId);
216218 if (hasInteractiveWidgets) {
217219 final registerCallbackResult =
218220 await HomeWidget .registerInteractivityCallback (
219- interactivityCallback,
220- );
221+ interactivityCallback,
222+ );
221223
222- expect (
223- registerCallbackResult,
224- isTrue,
225- );
224+ expect (registerCallbackResult, isTrue);
226225 } else {
227226 expect (
228227 () async => await HomeWidget .registerInteractivityCallback (
@@ -250,9 +249,7 @@ void main() {
250249 );
251250
252251 await expectLater (
253- HomeWidget .requestPinWidget (
254- name: 'HomeWidgetExample' ,
255- ),
252+ HomeWidget .requestPinWidget (name: 'HomeWidgetExample' ),
256253 completes,
257254 );
258255
@@ -261,10 +258,7 @@ void main() {
261258 completion (isNull),
262259 );
263260
264- await expectLater (
265- HomeWidget .finishHomeWidgetConfigure (),
266- completes,
267- );
261+ await expectLater (HomeWidget .finishHomeWidgetConfigure (), completes);
268262 });
269263 });
270264
@@ -286,8 +280,9 @@ void main() {
286280 );
287281 });
288282
289- testWidgets ('save/get widget data with appGroupId override' ,
290- (tester) async {
283+ testWidgets ('save/get widget data with appGroupId override' , (
284+ tester,
285+ ) async {
291286 await HomeWidget .saveWidgetData (
292287 keyValueKey,
293288 'value' ,
0 commit comments