Advertisement
mactech24

No internet connection

Jan 18th, 2023
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.93 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/ErrorPics/Connectivity 01.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.           Expanded(
  81.             child: Padding(
  82.               padding: EdgeInsets.only(
  83.                 bottom: getProportionateScreenHeight(20),
  84.               ),
  85.               child: Column(
  86.                 mainAxisAlignment: MainAxisAlignment.end,
  87.                 children: [
  88.                   Container(
  89.                     margin: EdgeInsets.symmetric(
  90.                       horizontal: getProportionateScreenWidth(40),
  91.                     ),
  92.                     width: size.width,
  93.                     height: getProportionateScreenHeight(50),
  94.                     decoration: BoxDecoration(
  95.                       borderRadius: BorderRadius.circular(10),
  96.                       color: Color(0xFF0f7dff),
  97.                     ),
  98.                     child: TextButton(
  99.                       style: ButtonStyle(
  100.                         shape: MaterialStateProperty.all(
  101.                           RoundedRectangleBorder(
  102.                             borderRadius: BorderRadius.circular(5),
  103.                           ),
  104.                         ),
  105.                       ),
  106.                       child: Text(
  107.                         "Try Again",
  108.                         style: TextStyle(
  109.                           color: Colors.white,
  110.                           fontSize: getProportionateScreenWidth(16),
  111.                         ),
  112.                       ),
  113.                       onPressed: () {},
  114.                     ),
  115.                   ),
  116.                 ],
  117.               ),
  118.             ),
  119.           )
  120.         ],
  121.       ),
  122.     );
  123.   }
  124. }
  125.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement