Advertisement
mactech24

Something went wrong screen

Jan 18th, 2023
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 5.90 KB | None | 0 0
  1. import 'package:credical/utile_size.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter/services.dart';
  4. import 'package:flutter_svg/flutter_svg.dart';
  5.  
  6. class SomethingWentWrong extends StatefulWidget {
  7.   //
  8.   static String routeName = "/somethingWentWrong";
  9.   //
  10.   const SomethingWentWrong({super.key});
  11.  
  12.   @override
  13.   State<SomethingWentWrong> createState() => _SomethingWentWrongState();
  14. }
  15.  
  16. class _SomethingWentWrongState extends State<SomethingWentWrong> {
  17.   @override
  18.   Widget build(BuildContext context) {
  19.     SystemChrome.setSystemUIOverlayStyle(
  20.       SystemUiOverlayStyle(
  21.         statusBarColor: Colors.transparent,
  22.       ),
  23.     );
  24.     SizeConfig().init(context);
  25.     Size size = MediaQuery.of(context).size;
  26.     return Scaffold(
  27.       body: Column(
  28.         children: [
  29.           Container(
  30.             padding: EdgeInsets.only(
  31.               left: getProportionateScreenWidth(50),
  32.               right: getProportionateScreenWidth(50),
  33.               top: getProportionateScreenWidth(70),
  34.             ),
  35.             height: size.height * 0.40,
  36.             width: size.width,
  37.             child: SvgPicture.asset(
  38.               "assets/ErrorPics/EmptyState.svg",
  39.               fit: BoxFit.contain,
  40.             ),
  41.           ),
  42.           Text(
  43.             "Oops!",
  44.             style: TextStyle(
  45.               color: Color(0xFF0f7dff),
  46.               fontSize: getProportionateScreenWidth(30),
  47.               fontWeight: FontWeight.bold,
  48.             ),
  49.           ),
  50.           SizedBox(
  51.             height: getProportionateScreenHeight(10),
  52.           ),
  53.           Padding(
  54.             padding: EdgeInsets.symmetric(
  55.               horizontal: getProportionateScreenWidth(25),
  56.             ),
  57.             child: Text(
  58.               "Something went wrong,\nPlease try again",
  59.               style: TextStyle(
  60.                 fontSize: getProportionateScreenWidth(20),
  61.                 fontWeight: FontWeight.w500,
  62.               ),
  63.               textAlign: TextAlign.center,
  64.             ),
  65.           ),
  66.           Expanded(
  67.             child: Padding(
  68.               padding: EdgeInsets.all(
  69.                 getProportionateScreenWidth(23),
  70.               ),
  71.               child: Column(
  72.                 mainAxisAlignment: MainAxisAlignment.end,
  73.                 children: [
  74.                   Text(
  75.                     "Return home or Screenshot this page and send it with\ncredical support for assistance",
  76.                     style: TextStyle(
  77.                       fontSize: getProportionateScreenWidth(11),
  78.                       fontWeight: FontWeight.w500,
  79.                     ),
  80.                     textAlign: TextAlign.center,
  81.                   ),
  82.                   SizedBox(
  83.                     height: getProportionateScreenHeight(10),
  84.                   ),
  85.                   Container(
  86.                     margin: EdgeInsets.symmetric(
  87.                       horizontal: getProportionateScreenWidth(30),
  88.                     ),
  89.                     width: size.width,
  90.                     height: getProportionateScreenHeight(50),
  91.                     decoration: BoxDecoration(
  92.                       borderRadius: BorderRadius.circular(
  93.                         getProportionateScreenWidth(10),
  94.                       ),
  95.                       color: Color(0xFF0f7dff),
  96.                     ),
  97.                     child: TextButton(
  98.                       style: ButtonStyle(
  99.                         shape: MaterialStateProperty.all(
  100.                           RoundedRectangleBorder(
  101.                             borderRadius: BorderRadius.circular(
  102.                               getProportionateScreenWidth(10),
  103.                             ),
  104.                           ),
  105.                         ),
  106.                       ),
  107.                       child: Text(
  108.                         "Return Home",
  109.                         style: TextStyle(
  110.                           color: Colors.white,
  111.                           fontSize: getProportionateScreenWidth(16),
  112.                         ),
  113.                       ),
  114.                       onPressed: () {},
  115.                     ),
  116.                   ),
  117.                   SizedBox(
  118.                     height: getProportionateScreenHeight(10),
  119.                   ),
  120.                   //Contact support
  121.                   Container(
  122.                     margin: EdgeInsets.symmetric(
  123.                       horizontal: getProportionateScreenWidth(30),
  124.                     ),
  125.                     width: size.width,
  126.                     height: getProportionateScreenHeight(50),
  127.                     decoration: BoxDecoration(
  128.                       borderRadius: BorderRadius.circular(
  129.                         getProportionateScreenWidth(10),
  130.                       ),
  131.                       color: Colors.transparent,
  132.                     ),
  133.                     child: TextButton(
  134.                       style: ButtonStyle(
  135.                         shape: MaterialStateProperty.all(
  136.                           RoundedRectangleBorder(
  137.                             side: BorderSide(
  138.                               color: Color(0xFF0f7dff),
  139.                               width: getProportionateScreenWidth(1),
  140.                             ),
  141.                             borderRadius: BorderRadius.circular(
  142.                               getProportionateScreenWidth(10),
  143.                             ),
  144.                           ),
  145.                         ),
  146.                       ),
  147.                       child: Text(
  148.                         "Contact support",
  149.                         style: TextStyle(
  150.                           color: Color(0xFF0f7dff),
  151.                           fontSize: getProportionateScreenWidth(16),
  152.                         ),
  153.                       ),
  154.                       onPressed: () {},
  155.                     ),
  156.                   ),
  157.                 ],
  158.               ),
  159.             ),
  160.           )
  161.         ],
  162.       ),
  163.     );
  164.   }
  165. }
  166.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement