Facebook
From Sahil Pandey, 4 Years ago, written in Plain Text.
This paste is a reply to Re: Re: Re: starting info from Sahil Pandey - view diff
Embed
Download Paste or View Raw
Hits: 203
  1. import 'package:flutter/material.dart';
  2.  
  3. class Info extends StatefulWidget {
  4.   @override
  5.   _InfoState createState() => _InfoState();
  6. }
  7.  
  8. class _InfoState extends State<Info> {
  9.   @override
  10.   Widget build(BuildContext context) {
  11.     return Scaffold(
  12.       appBar: AppBar(
  13.         title: Text(
  14.           'COVID COMPANION',
  15.           style: TextStyle(
  16.               fontSize: 20.0,
  17.               fontWeight: FontWeight.bold,
  18.               letterSpacing: 2.0
  19.           ),
  20.         ),
  21.         backgroundColor: Colors.indigo[900],
  22.         centerTitle: true,
  23.         elevation: 0,
  24.       ),
  25.       backgroundColor: Colors.grey[200],
  26.       body:
  27.       ListView(
  28.         scrollDirection: Axis.vertical,
  29.         children: <Widget>[
  30.           Container(
  31.             child: GridView.count(
  32.               shrinkwrap:true,
  33.               crossAxisCount: 2,
  34.               children: <Widget>[
  35.                 Container(
  36.                   child: Card(
  37.                       elevation: 10.0,
  38.                       child:Column(
  39.                         mainAxisAlignment: MainAxisAlignment.center,
  40.                         children: <Widget>[
  41.                           Image(
  42.                             image: AssetImage('assets/undraw_faq_rjoy.png'),
  43.                             height:150.0,
  44.                             width: 200.0,
  45.                             fit:BoxFit.cover,
  46.                           ),
  47.                           SizedBox(height:5.0 ,),
  48.                           OutlineButton(
  49.                             shape: StadiumBorder(),
  50.                             onPressed: (){},
  51.                             borderSide: BorderSide(color: Colors.pink.shade200),
  52.                             splashColor: Colors.pinkAccent[100],
  53.                             child: Padding(
  54.                               padding: EdgeInsets.all(8.0),
  55.                               child: Text(
  56.                                 'FAQ',
  57.                                 style: TextStyle(
  58.                                   fontWeight: FontWeight.bold,
  59.                                   color: Colors.black,
  60.                                 ),
  61.                               ),
  62.                             ),
  63.  
  64.                           )
  65.  
  66.                         ],
  67.  
  68.  
  69.                       )
  70.                   ),
  71.  
  72.                 ),
  73.                 Container(
  74.                   child: Card(
  75.                       elevation: 10.0,
  76.                       child:Column(
  77.                         mainAxisAlignment: MainAxisAlignment.center,
  78.                         children: <Widget>[
  79.                           Image(
  80.                             image: AssetImage('unnamed1.jpg'),
  81.                             height:150.0,
  82.                             width: 200.0,
  83.                             fit:BoxFit.cover,
  84.                           ),
  85.                           SizedBox(height:5.0 ,),
  86.                           OutlineButton(
  87.                             shape: StadiumBorder(),
  88.                             onPressed: (){},
  89.                             borderSide: BorderSide(color: Colors.pink.shade200),
  90.                             splashColor: Colors.pinkAccent[100],
  91.                             child: Padding(
  92.                               padding: EdgeInsets.all(8.0),
  93.                               child: Text(
  94.                                 'DOs',
  95.                                 style: TextStyle(
  96.                                   fontWeight: FontWeight.bold,
  97.                                   color: Colors.black,
  98.                                 ),
  99.                               ),
  100.                             ),
  101.  
  102.                           )
  103.  
  104.                         ],
  105.  
  106.  
  107.                       )
  108.                   ),
  109.  
  110.                 ),
  111.                 Container(
  112.                   child: Card(
  113.                       elevation: 10.0,
  114.                       child:Column(
  115.                         mainAxisAlignment: MainAxisAlignment.center,
  116.                         children: <Widget>[
  117.                           Image(
  118.                             image: AssetImage('assets/unnamed2.jpg'),
  119.                             height:150.0,
  120.                             width: 200.0,
  121.                             fit:BoxFit.cover,
  122.                           ),
  123.                           SizedBox(height:5.0 ,),
  124.                           OutlineButton(
  125.                             shape: StadiumBorder(),
  126.                             onPressed: (){},
  127.                             borderSide: BorderSide(color: Colors.pink.shade200),
  128.                             splashColor: Colors.pinkAccent[100],
  129.                             child: Padding(
  130.                               padding: EdgeInsets.all(8.0),
  131.                               child: Text(
  132.                                 'DONTs',
  133.                                 style: TextStyle(
  134.                                   fontWeight: FontWeight.bold,
  135.                                   color: Colors.black,
  136.                                 ),
  137.                               ),
  138.                             ),
  139.  
  140.                           )
  141.  
  142.                         ],
  143.  
  144.  
  145.                       )
  146.                   ),
  147.  
  148.                 ),
  149.                 Container(
  150.                   child: Card(
  151.                       elevation: 10.0,
  152.                       child:Column(
  153.                         mainAxisAlignment: MainAxisAlignment.center,
  154.                         children: <Widget>[
  155.                           Image(
  156.                             image: AssetImage('assets/undraw_Notify_re_65on.jpg'),
  157.                             height:150.0,
  158.                             width: 200.0,
  159.                             fit:BoxFit.cover,
  160.                           ),
  161.                           SizedBox(height:5.0 ,),
  162.                           OutlineButton(
  163.                             shape: StadiumBorder(),
  164.                             onPressed: (){},
  165.                             borderSide: BorderSide(color: Colors.pink.shade200),
  166.                             splashColor: Colors.pinkAccent[100],
  167.                             child: Padding(
  168.                               padding: EdgeInsets.all(8.0),
  169.                               child: Text(
  170.                                 'FAKE NEWS',
  171.                                 style: TextStyle(
  172.                                   fontWeight: FontWeight.bold,
  173.                                   color: Colors.black,
  174.                                 ),
  175.                               ),
  176.                             ),
  177.  
  178.                           )
  179.  
  180.                         ],
  181.  
  182.  
  183.                       )
  184.                   ),
  185.  
  186.                 )
  187.  
  188.               ]
  189.           ),
  190.           ),
  191.           SizedBox(height: 20.0,),
  192.           Symptoms(),
  193.           SizedBox(
  194.             height: 20.0,
  195.           ),
  196.           preventions(),
  197.         ],
  198.  
  199.       ),
  200.     );
  201.   }
  202.   // ignore: non_constant_identifier_names
  203.   Widget Symptoms() {
  204.     return Material(
  205.       color: Colors.white,
  206.       elevation: 14.0,
  207.       shadowColor: Color(0x802196F3),
  208.       child: Column(
  209.         children: <Widget>[
  210.           Padding(
  211.             padding: EdgeInsets.all(8.0),
  212.             child: labelContainer('SYMPTOMS'),
  213.           ),
  214.           Padding(
  215.             padding: EdgeInsets.all(8.0),
  216.             child: listofsymptoms(),
  217.           ),
  218.         ],
  219.       ),
  220.     );
  221.   }
  222.   Widget labelContainer(String labelVal) {
  223.     return Container(
  224.       height: 30.0,
  225.       child: Row(
  226.         mainAxisAlignment: MainAxisAlignment.spaceBetween,
  227.         children: <Widget>[
  228.           Text(
  229.             labelVal,
  230.             style: TextStyle(fontWeight: FontWeight.bold,fontSize: 20.0),
  231.           ),
  232.           Text(
  233.             'MORE',
  234.             style: TextStyle(color: Colors.indigo[900],fontWeight: FontWeight.bold,fontSize: 18.0),
  235.           ),
  236.         ],
  237.       ),
  238.     );
  239.   }
  240.   Widget listofsymptoms() {
  241.     return Container(
  242.         height: 160.0,
  243.         child: ListView(
  244.           scrollDirection: Axis.horizontal,
  245.           children: <Widget>[
  246.             imageSection(
  247.                 'assets/symp1.png',
  248.                 'HIGH FEVER/HEADACHE'),
  249.             SizedBox(
  250.               width: 20.0,
  251.             ),
  252.             imageSection(
  253.                 'assets/symp2.png',
  254.                 'MUSCLE PAIN'),
  255.             SizedBox(
  256.               width: 20.0,
  257.             ),
  258.             imageSection(
  259.                 'assets/symp3.png',
  260.                 'SUDDEN LOSS OF TASTE/SMELL'),
  261.             SizedBox(
  262.               width: 20.0,
  263.             ),
  264.             imageSection(
  265.                 'assets/symp4.png',
  266.                 ' COUGH'),
  267.             SizedBox(
  268.               width: 20.0,
  269.             ),
  270.             imageSection(
  271.                 'assets/symp5.png',
  272.                 'SORE THROAT'),
  273.             SizedBox(
  274.               width: 20.0,
  275.             ),
  276.             imageSection(
  277.                 'assets/symp6.png',
  278.                 'DIFFICULTY IN BREATHING'),
  279.             SizedBox(
  280.               width: 20.0,
  281.             ),
  282.             imageSection(
  283.                 'assets/symp7.png',
  284.                 'CHILLS'),
  285.           ],
  286.         ));
  287.   }
  288.   Widget imageSection(String imageVal, String appVal) {
  289.     return Column(
  290.       children: <Widget>[
  291.         Container(
  292.           height: 100.0,
  293.           width: 100.0,
  294.           decoration: new BoxDecoration(
  295.             image: DecorationImage(
  296.               image: new NetworkImage(imageVal),
  297.               fit: BoxFit.fill,
  298.             ),
  299.             borderRadius: BorderRadius.circular(20.0),
  300.           ),
  301.         ),
  302.         SizedBox(
  303.           height: 10.0,
  304.         ),
  305.         Text(
  306.           appVal,
  307.           style: TextStyle(
  308.               color: Colors.black, fontWeight: FontWeight.bold, fontSize: 16.0),
  309.         ),
  310.         SizedBox(
  311.           height: 10.0,
  312.         ),
  313.  
  314.       ],
  315.     );
  316.   }
  317.   Widget preventions() {
  318.     return Material(
  319.       color: Colors.white,
  320.       elevation: 14.0,
  321.       shadowColor: Color(0x802196F3),
  322.       child: Column(
  323.         children: <Widget>[
  324.           Padding(
  325.             padding: EdgeInsets.all(8.0),
  326.             child: labelContainer('Preventions'),
  327.           ),
  328.           Padding(
  329.             padding: EdgeInsets.all(8.0),
  330.             child: listofpreventions(),
  331.           ),
  332.         ],
  333.       ),
  334.     );
  335.   }
  336.  
  337.   Widget listofpreventions() {
  338.     return Container(
  339.         height: 160.0,
  340.         child: ListView(
  341.           scrollDirection: Axis.horizontal,
  342.           children: <Widget>[
  343.             imageSection(
  344.                 'assets/prev1.jpg',
  345.                 'WEAR A MASK'),
  346.             SizedBox(
  347.               width: 20.0,
  348.             ),
  349.             imageSection(
  350.                 'assets/prev2.jpg',
  351.                 'WASH HANDS/SANITISE HANDS'),
  352.             SizedBox(
  353.               width: 20.0,
  354.             ),
  355.             imageSection(
  356.                 'assets/prev3.jpg',
  357.                 'AVOID CONTACTS WITH OTHERS'),
  358.             SizedBox(
  359.               width: 20.0,
  360.             ),
  361.             imageSection(
  362.                 'assets/prev4.jpg',
  363.                 'COVER YOUR COUGH OR SNEEZE'),
  364.             SizedBox(
  365.               width: 20.0,
  366.             ),
  367.             imageSection(
  368.                 'assets/prev5.jpg',
  369.                 'STAY HOME'),
  370.             SizedBox(
  371.               width: 20.0,
  372.             ),
  373.             imageSection(
  374.                 'assets/prev6.jpg',
  375.                 'DONT TRAVEL'),
  376.           ],
  377.         ));
  378.   }
  379. }