Facebook
From Sahil Pandey, 4 Years ago, written in Plain Text.
This paste is a reply to Re: starting info from Sahil Pandey - view diff
Embed
Download Paste or View Raw
Hits: 201
  1.  
  2. import 'package:flutter/material.dart';
  3.  
  4. class Info extends StatefulWidget {
  5.   @override
  6.   _InfoState createState() => _InfoState();
  7. }
  8.  
  9. class _InfoState extends State<Info> {
  10.   @override
  11.   Widget build(BuildContext context) {
  12.     return Scaffold(
  13.       appBar: AppBar(
  14.         title: Text(
  15.           'COVID COMPANION',
  16.           style: TextStyle(
  17.               fontSize: 20.0,
  18.               fontWeight: FontWeight.bold,
  19.               letterSpacing: 2.0
  20.           ),
  21.         ),
  22.         backgroundColor: Colors.indigo[900],
  23.         centerTitle: true,
  24.         elevation: 0,
  25.       ),
  26.       backgroundColor: Colors.grey[200],
  27.       body:
  28.       ListView(
  29.         scrollDirection: Axis.vertical,
  30.         children: <Widget>[
  31.           GridView.count(
  32.               crossAxisCount: 2,
  33.               children: <Widget>[
  34.                 Container(
  35.                   child: Card(
  36.                       elevation: 10.0,
  37.                       child:Column(
  38.                         mainAxisAlignment: MainAxisAlignment.center,
  39.                         children: <Widget>[
  40.                           Image(
  41.                             image: AssetImage('assets/undraw_faq_rjoy.png'),
  42.                             height:150.0,
  43.                             width: 200.0,
  44.                             fit:BoxFit.cover,
  45.                           ),
  46.                           SizedBox(height:5.0 ,),
  47.                           OutlineButton(
  48.                             shape: StadiumBorder(),
  49.                             onPressed: (){},
  50.                             borderSide: BorderSide(color: Colors.pink.shade200),
  51.                             splashColor: Colors.pinkAccent[100],
  52.                             child: Padding(
  53.                               padding: EdgeInsets.all(8.0),
  54.                               child: Text(
  55.                                 'FAQ',
  56.                                 style: TextStyle(
  57.                                   fontWeight: FontWeight.bold,
  58.                                   color: Colors.black,
  59.                                 ),
  60.                               ),
  61.                             ),
  62.  
  63.                           )
  64.  
  65.                         ],
  66.  
  67.  
  68.                       )
  69.                   ),
  70.  
  71.                 ),
  72.                 Container(
  73.                   child: Card(
  74.                       elevation: 10.0,
  75.                       child:Column(
  76.                         mainAxisAlignment: MainAxisAlignment.center,
  77.                         children: <Widget>[
  78.                           Image(
  79.                             image: AssetImage('unnamed1.jpg'),
  80.                             height:150.0,
  81.                             width: 200.0,
  82.                             fit:BoxFit.cover,
  83.                           ),
  84.                           SizedBox(height:5.0 ,),
  85.                           OutlineButton(
  86.                             shape: StadiumBorder(),
  87.                             onPressed: (){},
  88.                             borderSide: BorderSide(color: Colors.pink.shade200),
  89.                             splashColor: Colors.pinkAccent[100],
  90.                             child: Padding(
  91.                               padding: EdgeInsets.all(8.0),
  92.                               child: Text(
  93.                                 'DOs',
  94.                                 style: TextStyle(
  95.                                   fontWeight: FontWeight.bold,
  96.                                   color: Colors.black,
  97.                                 ),
  98.                               ),
  99.                             ),
  100.  
  101.                           )
  102.  
  103.                         ],
  104.  
  105.  
  106.                       )
  107.                   ),
  108.  
  109.                 ),
  110.                 Container(
  111.                   child: Card(
  112.                       elevation: 10.0,
  113.                       child:Column(
  114.                         mainAxisAlignment: MainAxisAlignment.center,
  115.                         children: <Widget>[
  116.                           Image(
  117.                             image: AssetImage('assets/unnamed2.jpg'),
  118.                             height:150.0,
  119.                             width: 200.0,
  120.                             fit:BoxFit.cover,
  121.                           ),
  122.                           SizedBox(height:5.0 ,),
  123.                           OutlineButton(
  124.                             shape: StadiumBorder(),
  125.                             onPressed: (){},
  126.                             borderSide: BorderSide(color: Colors.pink.shade200),
  127.                             splashColor: Colors.pinkAccent[100],
  128.                             child: Padding(
  129.                               padding: EdgeInsets.all(8.0),
  130.                               child: Text(
  131.                                 'DONTs',
  132.                                 style: TextStyle(
  133.                                   fontWeight: FontWeight.bold,
  134.                                   color: Colors.black,
  135.                                 ),
  136.                               ),
  137.                             ),
  138.  
  139.                           )
  140.  
  141.                         ],
  142.  
  143.  
  144.                       )
  145.                   ),
  146.  
  147.                 ),
  148.                 Container(
  149.                   child: Card(
  150.                       elevation: 10.0,
  151.                       child:Column(
  152.                         mainAxisAlignment: MainAxisAlignment.center,
  153.                         children: <Widget>[
  154.                           Image(
  155.                             image: AssetImage('assets/undraw_Notify_re_65on.jpg'),
  156.                             height:150.0,
  157.                             width: 200.0,
  158.                             fit:BoxFit.cover,
  159.                           ),
  160.                           SizedBox(height:5.0 ,),
  161.                           OutlineButton(
  162.                             shape: StadiumBorder(),
  163.                             onPressed: (){},
  164.                             borderSide: BorderSide(color: Colors.pink.shade200),
  165.                             splashColor: Colors.pinkAccent[100],
  166.                             child: Padding(
  167.                               padding: EdgeInsets.all(8.0),
  168.                               child: Text(
  169.                                 'FAKE NEWS',
  170.                                 style: TextStyle(
  171.                                   fontWeight: FontWeight.bold,
  172.                                   color: Colors.black,
  173.                                 ),
  174.                               ),
  175.                             ),
  176.  
  177.                           )
  178.  
  179.                         ],
  180.  
  181.  
  182.                       )
  183.                   ),
  184.  
  185.                 )
  186.  
  187.               ]
  188.           ),
  189.           SizedBox(height: 20.0,),
  190.           Symptoms(),
  191.           SizedBox(
  192.             height: 20.0,
  193.           ),
  194.          preventions(),
  195.         ],
  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. }
  378.  

Replies to Re: Re: starting info rss

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