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