TF-934 Add page not found

This commit is contained in:
dab246
2022-11-11 02:17:03 +07:00
committed by Dat H. Pham
parent 71abe0cf37
commit 7160fee763
11 changed files with 263 additions and 7 deletions
@@ -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;
}
}
}