Facebook
From Sahil Pandey, 4 Years ago, written in Plain Text.
This paste is a reply to Re: Re: starting info from Sahil Pandey - view diff
Embed
Download Paste or View Raw
Hits: 220
  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.               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.           ),
  190.           SizedBox(height: 20.0,),
  191.           Symptoms(),
  192.           SizedBox(
  193.             height: 20.0,
  194.           ),
  195.           preventions(),
  196.         ],
  197.  
  198.       ),
  199.     );
  200.   }
  201.   // ignore: non_constant_identifier_names
  202.   Widget Symptoms() {
  203.     return Material(
  204.       color: Colors.white,
  205.       elevation: 14.0,
  206.       shadowColor: Color(0x802196F3),
  207.       child: Column(
  208.         children: <Widget>[
  209.           Padding(
  210.             padding: EdgeInsets.all(8.0),
  211.             child: labelContainer('SYMPTOMS'),
  212.           ),
  213.           Padding(
  214.             padding: EdgeInsets.all(8.0),
  215.             child: listofsymptoms(),
  216.           ),
  217.         ],
  218.       ),
  219.     );
  220.   }
  221.   Widget labelContainer(String labelVal) {
  222.     return Container(
  223.       height: 30.0,
  224.       child: Row(
  225.         mainAxisAlignment: MainAxisAlignment.spaceBetween,
  226.         children: <Widget>[
  227.           Text(
  228.             labelVal,
  229.             style: TextStyle(fontWeight: FontWeight.bold,fontSize: 20.0),
  230.           ),
  231.           Text(
  232.             'MORE',
  233.             style: TextStyle(color: Colors.indigo[900],fontWeight: FontWeight.bold,fontSize: 18.0),
  234.           ),
  235.         ],
  236.       ),
  237.     );
  238.   }
  239.   Widget listofsymptoms() {
  240.     return Container(
  241.         height: 160.0,
  242.         child: ListView(
  243.           scrollDirection: Axis.horizontal,
  244.           children: <Widget>[
  245.             imageSection(
  246.                 'assets/symp1.png',
  247.                 'HIGH FEVER/HEADACHE'),
  248.             SizedBox(
  249.               width: 20.0,
  250.             ),
  251.             imageSection(
  252.                 'assets/symp2.png',
  253.                 'MUSCLE PAIN'),
  254.             SizedBox(
  255.               width: 20.0,
  256.             ),
  257.             imageSection(
  258.                 'assets/symp3.png',
  259.                 'SUDDEN LOSS OF TASTE/SMELL'),
  260.             SizedBox(
  261.               width: 20.0,
  262.             ),
  263.             imageSection(
  264.                 'assets/symp4.png',
  265.                 ' COUGH'),
  266.             SizedBox(
  267.               width: 20.0,
  268.             ),
  269.             imageSection(
  270.                 'assets/symp5.png',
  271.                 'SORE THROAT'),
  272.             SizedBox(
  273.               width: 20.0,
  274.             ),
  275.             imageSection(
  276.                 'assets/symp6.png',
  277.                 'DIFFICULTY IN BREATHING'),
  278.             SizedBox(
  279.               width: 20.0,
  280.             ),
  281.             imageSection(
  282.                 'assets/symp7.png',
  283.                 'CHILLS'),
  284.           ],
  285.         ));
  286.   }
  287.   Widget imageSection(String imageVal, String appVal) {
  288.     return Column(
  289.       children: <Widget>[
  290.         Container(
  291.           height: 100.0,
  292.           width: 100.0,
  293.           decoration: new BoxDecoration(
  294.             image: DecorationImage(
  295.               image: new NetworkImage(imageVal),
  296.               fit: BoxFit.fill,
  297.             ),
  298.             borderRadius: BorderRadius.circular(20.0),
  299.           ),
  300.         ),
  301.         SizedBox(
  302.           height: 10.0,
  303.         ),
  304.         Text(
  305.           appVal,
  306.           style: TextStyle(
  307.               color: Colors.black, fontWeight: FontWeight.bold, fontSize: 16.0),
  308.         ),
  309.         SizedBox(
  310.           height: 10.0,
  311.         ),
  312.  
  313.       ],
  314.     );
  315.   }
  316.   Widget preventions() {
  317.     return Material(
  318.       color: Colors.white,
  319.       elevation: 14.0,
  320.       shadowColor: Color(0x802196F3),
  321.       child: Column(
  322.         children: <Widget>[
  323.           Padding(
  324.             padding: EdgeInsets.all(8.0),
  325.             child: labelContainer('Preventions'),
  326.           ),
  327.           Padding(
  328.             padding: EdgeInsets.all(8.0),
  329.             child: listofpreventions(),
  330.           ),
  331.         ],
  332.       ),
  333.     );
  334.   }
  335.  
  336.   Widget listofpreventions() {
  337.     return Container(
  338.         height: 160.0,
  339.         child: ListView(
  340.           scrollDirection: Axis.horizontal,
  341.           children: <Widget>[
  342.             imageSection(
  343.                 'assets/prev1.jpg',
  344.                 'WEAR A MASK'),
  345.             SizedBox(
  346.               width: 20.0,
  347.             ),
  348.             imageSection(
  349.                 'assets/prev2.jpg',
  350.                 'WASH HANDS/SANITISE HANDS'),
  351.             SizedBox(
  352.               width: 20.0,
  353.             ),
  354.             imageSection(
  355.                 'assets/prev3.jpg',
  356.                 'AVOID CONTACTS WITH OTHERS'),
  357.             SizedBox(
  358.               width: 20.0,
  359.             ),
  360.             imageSection(
  361.                 'assets/prev4.jpg',
  362.                 'COVER YOUR COUGH OR SNEEZE'),
  363.             SizedBox(
  364.               width: 20.0,
  365.             ),
  366.             imageSection(
  367.                 'assets/prev5.jpg',
  368.                 'STAY HOME'),
  369.             SizedBox(
  370.               width: 20.0,
  371.             ),
  372.             imageSection(
  373.                 'assets/prev6.jpg',
  374.                 'DONT TRAVEL'),
  375.           ],
  376.         ));
  377.   }
  378. }

Replies to Re: Re: Re: starting info rss

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