forked from eatvio/eatvio_app
fix: fixed analyzer issues and merge conflicts
This commit is contained in:
@@ -168,7 +168,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
|
||||
});
|
||||
showErrorToast('${testCases[index].name} failed');
|
||||
// Show AlertDialog with error description
|
||||
if (mounted) {
|
||||
if (context.mounted) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
@@ -190,12 +190,12 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
|
||||
});
|
||||
showErrorToast('${testCases[index].name} failed');
|
||||
// Show AlertDialog with error description
|
||||
if (mounted) {
|
||||
if (context.mounted) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Test Failed'),
|
||||
content: SingleChildScrollView(child: Text(e.toString() + '\n' + stack.toString())),
|
||||
content: SingleChildScrollView(child: Text('$e\n$stack')),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
|
||||
@@ -70,14 +70,14 @@ class CreateRecipeTask implements TestCases {
|
||||
steps: [Step(description: 'desc')],
|
||||
),
|
||||
);
|
||||
} on DioError catch (e) {
|
||||
} on DioException catch (e) {
|
||||
final res = e.response;
|
||||
if (res != null && (res.statusCode == null || res.statusCode! < 200 || res.statusCode! >= 300)) {
|
||||
return TestResult(false, 'DioError: statusCode=${res.statusCode}\n${res.data}');
|
||||
}
|
||||
return TestResult(false, e.toString());
|
||||
} catch (e, stack) {
|
||||
return TestResult(false, e.toString() + '\n' + stack.toString());
|
||||
return TestResult(false, '$e\n$stack');
|
||||
}
|
||||
return TestResult(true);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class Test850task implements TestCases {
|
||||
await dietsService.cancelDiet(id: lastChosenDiet?.dietId ?? 0);
|
||||
} catch (e, stack) {
|
||||
log('unexpected error7: $e');
|
||||
return TestResult(false, e.toString() + '\n' + stack.toString());
|
||||
return TestResult(false, '$e\n$stack');
|
||||
}
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
}
|
||||
@@ -121,24 +121,24 @@ class Test850task implements TestCases {
|
||||
await dietsService.startDiet(id: diet.id, body: {'date': today.format('yyyy-MM-dd')});
|
||||
} catch (e, stack) {
|
||||
log('unexpected error2: $e');
|
||||
return TestResult(false, e.toString() + '\n' + stack.toString());
|
||||
return TestResult(false, '$e\n$stack');
|
||||
}
|
||||
try {
|
||||
await dietsService.cancelDiet(id: diet.id);
|
||||
} catch (e, stack) {
|
||||
log('unexpected error3: $e');
|
||||
return TestResult(false, e.toString() + '\n' + stack.toString());
|
||||
return TestResult(false, '$e\n$stack');
|
||||
}
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
try {
|
||||
await dietsService.startDiet(id: diet.id, body: {'date': tomorrow.format('yyyy-MM-dd')});
|
||||
} catch (e, stack) {
|
||||
log('unexpected error4: $e');
|
||||
return TestResult(false, e.toString() + '\n' + stack.toString());
|
||||
return TestResult(false, '$e\n$stack');
|
||||
}
|
||||
try {
|
||||
await dietsService.cancelDiet(id: diet.id);
|
||||
} catch (e, stack) {
|
||||
} catch (e) {
|
||||
log('unexpected error5: $e');
|
||||
}
|
||||
break;
|
||||
@@ -147,7 +147,7 @@ class Test850task implements TestCases {
|
||||
return TestResult(true);
|
||||
} catch (e, stack) {
|
||||
log('unexpected error6: $e');
|
||||
return TestResult(false, e.toString() + '\n' + stack.toString());
|
||||
return TestResult(false, '$e\n$stack');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user