mirror of
https://github.com/meditohq/medito-app.git
synced 2024-08-16 23:50:40 +03:00
feat: missing route screen added (#662)
This commit is contained in:
parent
3e671762cd
commit
9efaaded97
@ -105,6 +105,11 @@ class StringConstants {
|
||||
static const String mins = 'mins';
|
||||
|
||||
//Error
|
||||
static const String unableToLocateTheRoute =
|
||||
'We apologize for the inconvenience, but we were unable to locate the route you were searching for.';
|
||||
static const String pleaseClick = 'Please click the';
|
||||
static const String toReturnToTheMainMenu =
|
||||
'to return to the main menu. Thank you.';
|
||||
static const String someThingWentWrong = 'Something went wrong';
|
||||
static const String invalidEmail = 'Invalid Email.';
|
||||
static const String fieldRequired = 'Field is Required';
|
||||
|
@ -13,6 +13,7 @@ import 'package:Medito/views/bottom_navigation/bottom_navigation_bar_view.dart';
|
||||
import 'package:Medito/views/downloads/downloads_view.dart';
|
||||
import 'package:Medito/views/end_screen/end_screen_view.dart';
|
||||
import 'package:Medito/views/home/home_view.dart';
|
||||
import 'package:Medito/views/missing_route/missing_route_view.dart';
|
||||
import 'package:Medito/views/notifications/notification_permission_view.dart';
|
||||
import 'package:Medito/views/pack/pack_view.dart';
|
||||
import 'package:Medito/views/player/player_view.dart';
|
||||
@ -35,6 +36,9 @@ final router = GoRouter(
|
||||
debugLogDiagnostics: true,
|
||||
navigatorKey: _rootNavigatorKey,
|
||||
initialLocation: RouteConstants.root,
|
||||
errorBuilder: (context, state) {
|
||||
return MissingRouteView();
|
||||
},
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: RouteConstants.root,
|
||||
|
59
lib/views/missing_route/missing_route_view.dart
Normal file
59
lib/views/missing_route/missing_route_view.dart
Normal file
@ -0,0 +1,59 @@
|
||||
import 'package:Medito/constants/constants.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class MissingRouteView extends StatelessWidget {
|
||||
const MissingRouteView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var textStyle = Theme.of(context).textTheme.headlineSmall?.copyWith(
|
||||
fontSize: 16,
|
||||
color: ColorConstants.walterWhite,
|
||||
fontFamily: SourceSerif,
|
||||
);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: ColorConstants.ebony,
|
||||
body: SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: padding16,
|
||||
vertical: padding16,
|
||||
),
|
||||
child: Center(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: StringConstants.unableToLocateTheRoute,
|
||||
style: textStyle,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: ' ${StringConstants.pleaseClick} ',
|
||||
style: textStyle,
|
||||
),
|
||||
TextSpan(
|
||||
text: '${StringConstants.home.toLowerCase()}',
|
||||
style: textStyle?.copyWith(
|
||||
decoration: TextDecoration.underline,
|
||||
color: ColorConstants.lightPurple,
|
||||
),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap =
|
||||
() => context.go(RouteConstants.bottomNavbarPath),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' ${StringConstants.toReturnToTheMainMenu} ',
|
||||
style: textStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user