TF-934 Add page not found
This commit is contained in:
@@ -439,6 +439,7 @@ class MailboxController extends BaseMailboxController {
|
||||
_clearNavigationRouter();
|
||||
} else {
|
||||
_clearNavigationRouter();
|
||||
pushAndPop(AppRoutes.unknownRoutePage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,6 +160,7 @@ class ThreadController extends BaseController with EmailActionController {
|
||||
} else if (failure is GetEmailByIdFailure) {
|
||||
openingEmail.value = false;
|
||||
_navigationRouter = null;
|
||||
pushAndPop(AppRoutes.unknownRoutePage);
|
||||
}
|
||||
},
|
||||
(success) {
|
||||
|
||||
@@ -11,7 +11,6 @@ import 'package:model/mailbox/select_mode.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/model/search_query.dart';
|
||||
import 'package:tmail_ui_user/features/thread/presentation/mixin/base_email_item_tile.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
import 'package:url_launcher/link.dart';
|
||||
|
||||
class EmailTileBuilder with BaseEmailItemTile {
|
||||
|
||||
@@ -82,10 +81,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
padding: _getPaddingItem(),
|
||||
decoration: _getDecorationItem(),
|
||||
alignment: Alignment.center,
|
||||
child: Link(
|
||||
uri: _presentationEmail.routeWeb,
|
||||
builder: (_, __) => tile
|
||||
)
|
||||
child: tile
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class UnknownRoutePageView extends StatelessWidget {
|
||||
|
||||
static const double maxWidthTextDefault = 440.0;
|
||||
|
||||
final _imagePath = Get.find<ImagePaths>();
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
UnknownRoutePageView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
SvgPicture.asset(_imagePath.icPageNotFound),
|
||||
const SizedBox(height: 48),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: _getPaddingTitle(context),
|
||||
constraints: BoxConstraints(maxWidth: _getMaxWidthTitle(context)),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).titlePageNotFound,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.black,
|
||||
fontSize: _getFontSizeTitle(context)
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
AppLocalizations.of(context).subTitlePageNotFound,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColor.colorSettingExplanation,
|
||||
fontSize: 16
|
||||
),
|
||||
)
|
||||
]
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 48)
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
double _getMaxWidthTitle(BuildContext context) {
|
||||
final widthScreen = _responsiveUtils.getSizeScreenWidth(context);
|
||||
if (widthScreen > maxWidthTextDefault) {
|
||||
return maxWidthTextDefault;
|
||||
} else {
|
||||
return widthScreen;
|
||||
}
|
||||
}
|
||||
|
||||
EdgeInsets _getPaddingTitle(BuildContext context) {
|
||||
if (_responsiveUtils.isPortraitMobile(context)) {
|
||||
return const EdgeInsets.symmetric(horizontal: 30);
|
||||
} else {
|
||||
return EdgeInsets.zero;
|
||||
}
|
||||
}
|
||||
|
||||
double _getFontSizeTitle(BuildContext context) {
|
||||
if (_responsiveUtils.isPortraitMobile(context)) {
|
||||
return 20.0;
|
||||
} else {
|
||||
return 24.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user