Advertisement
mactech24

No internet connection error page

Jan 17th, 2023
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.44 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 NoInternetConnection extends StatefulWidget {
  7.   //
  8.   static String routeName = "/noInternetConnection";
  9.   //
  10.   const NoInternetConnection({super.key});
  11.  
  12.   @override
  13.   State<NoInternetConnection> createState() => _NoInternetConnectionState();
  14. }
  15.  
  16. class _NoInternetConnectionState extends State<NoInternetConnection> {
  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.symmetric(
  31.               horizontal: getProportionateScreenWidth(50),
  32.             ),
  33.             height: size.height * 0.45,
  34.             width: size.width,
  35.             child: SvgPicture.asset(
  36.               "assets/No connection-bro.svg",
  37.             ),
  38.           ),
  39.           Text(
  40.             "No Internet Connection",
  41.             style: TextStyle(
  42.               color: Color(0xFF0f7dff),
  43.               fontSize: getProportionateScreenWidth(22),
  44.               fontWeight: FontWeight.bold,
  45.             ),
  46.           ),
  47.           SizedBox(
  48.             height: getProportionateScreenHeight(10),
  49.           ),
  50.           Text.rich(
  51.             TextSpan(
  52.               children: [
  53.                 TextSpan(text: "Check your"),
  54.                 TextSpan(
  55.                   text: " wifi",
  56.                   style: TextStyle(
  57.                     fontWeight: FontWeight.bold,
  58.                   ),
  59.                 ),
  60.                 TextSpan(text: " or"),
  61.                 TextSpan(
  62.                   text: " mobile data",
  63.                   style: TextStyle(
  64.                     fontWeight: FontWeight.bold,
  65.                   ),
  66.                 ),
  67.                 TextSpan(text: " connection"),
  68.               ],
  69.               style: TextStyle(
  70.                 fontSize: getProportionateScreenWidth(14),
  71.               ),
  72.             ),
  73.           ),
  74.           Text(
  75.             "and try again",
  76.             style: TextStyle(
  77.               fontSize: getProportionateScreenWidth(14),
  78.             ),
  79.           ),
  80.           SizedBox(
  81.             height: getProportionateScreenHeight(55),
  82.           ),
  83.           Container(
  84.             margin: EdgeInsets.symmetric(
  85.               horizontal: getProportionateScreenWidth(64),
  86.             ),
  87.             width: size.width,
  88.             height: getProportionateScreenHeight(45),
  89.             decoration: BoxDecoration(
  90.               borderRadius: BorderRadius.circular(20),
  91.               color: Color(0xFF0f7dff),
  92.             ),
  93.             child: TextButton(
  94.               style: ButtonStyle(
  95.                 shape: MaterialStateProperty.all(
  96.                   RoundedRectangleBorder(
  97.                     borderRadius: BorderRadius.circular(5),
  98.                   ),
  99.                 ),
  100.               ),
  101.               child: Text(
  102.                 "Try Again",
  103.                 style: TextStyle(
  104.                   color: Colors.white,
  105.                   fontSize: getProportionateScreenWidth(16),
  106.                 ),
  107.               ),
  108.               onPressed: () {},
  109.             ),
  110.           )
  111.         ],
  112.       ),
  113.     );
  114.   }
  115. }
  116.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement