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

Replies to Re: starting info rss

Title Name Language When
Re: Re: starting info Sahil Pandey text 4 Years ago.