diff --git a/lib/helpers/route_page.dart b/lib/helpers/route_page.dart index d0e720a..d5849ce 100644 --- a/lib/helpers/route_page.dart +++ b/lib/helpers/route_page.dart @@ -19,6 +19,7 @@ import 'package:retro_shopping/views/profile/settings/settings_view.dart'; import 'package:retro_shopping/views/profile/wishlist.dart'; import 'package:retro_shopping/views/search_view.dart'; import 'package:retro_shopping/views/terms_conditions_view.dart'; +import 'package:retro_shopping/views/unknown_view.dart'; import 'package:retro_shopping/widgets/payment/payment_successful.dart'; import 'package:retro_shopping/widgets/product/product_page.dart'; @@ -108,15 +109,9 @@ class RoutePage { return SlideLeftRoute( page: TermsConditionsView(), ); - //TODO: Needs to have a separate screen for this + default: - return PageRouteBuilder( - pageBuilder: - (_, Animation firstAni, Animation secondAni) => - const SizedBox( - child: Text('Nothing'), - ), - ); + return SlideLeftRoute(page: UnknownView(),); } } } diff --git a/lib/views/unknown_view.dart b/lib/views/unknown_view.dart new file mode 100644 index 0000000..8e64c11 --- /dev/null +++ b/lib/views/unknown_view.dart @@ -0,0 +1,81 @@ +import 'package:flutter/material.dart'; +import 'package:retro_shopping/helpers/constants.dart'; +import 'package:retro_shopping/widgets/retro_button.dart'; + +class UnknownView extends StatelessWidget { + @override + Widget build(BuildContext context) { + final double height = MediaQuery.of(context).size.height; + final double width = MediaQuery.of(context).size.width; + return Scaffold( + body: SafeArea( + child: SingleChildScrollView( + primary: true, + child: SizedBox( + width: width, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 18), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: height * 0.01, + ), + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: RetroButton( + upperColor: Colors.white, + lowerColor: Colors.black, + width: 35, + height: 35, + borderColor: Colors.white, + child: const Icon(Icons.arrow_back), + ), + ), + const SizedBox( + height: 30, + ), + const Text( + 'The page you are looking for is not found. Sorry for inconvenience 😕', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 25, + ), + ), + Center( + heightFactor: 10, + child: InkWell( + onTap: () { + Navigator.of(context).pushReplacementNamed( + RouteConstant.DASHBOARD_SCREEN, + ); + }, + child: RetroButton( + upperColor: Colors.white, + lowerColor: Colors.black, + width: 250, + height: 50, + borderColor: Colors.white, + child: const Text( + 'Click here to get back to home.', + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ); + } +}