🔨 Upgrade android gradle project
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
@ -7,11 +8,8 @@ import 'package:styled_widget/styled_widget.dart';
|
||||
class ResponseErrorWidget extends StatelessWidget {
|
||||
final dynamic error;
|
||||
final VoidCallback onRetry;
|
||||
const ResponseErrorWidget({
|
||||
super.key,
|
||||
required this.error,
|
||||
required this.onRetry,
|
||||
});
|
||||
|
||||
const ResponseErrorWidget({super.key, required this.error, required this.onRetry});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -20,14 +18,33 @@ class ResponseErrorWidget extends StatelessWidget {
|
||||
children: [
|
||||
const Icon(Symbols.error_outline, size: 48),
|
||||
const Gap(4),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 320),
|
||||
child: Text(
|
||||
error.toString(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Color(0xFF757575)),
|
||||
),
|
||||
).center(),
|
||||
if (error is DioException && error.response?.statusCode == 401)
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 320),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'unauthorized'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Color(0xFF757575)),
|
||||
).bold(),
|
||||
Text(
|
||||
'unauthorizedHint'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Color(0xFF757575)),
|
||||
),
|
||||
],
|
||||
),
|
||||
).center()
|
||||
else
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 320),
|
||||
child: Text(
|
||||
error.toString(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Color(0xFF757575)),
|
||||
),
|
||||
).center(),
|
||||
const Gap(8),
|
||||
TextButton(onPressed: onRetry, child: const Text('retry').tr()),
|
||||
],
|
||||
|
Reference in New Issue
Block a user