Facebook
From Sahil Pandey, 4 Years ago, written in Plain Text.
This paste is a reply to starting info from Sahil Pandey - go back
Embed
Viewing differences between starting info and Re: starting info


import 'package:flutter/material.dart';

class Info extends StatefulWidget {
  @override
  _InfoState createState() => _InfoState();
}

class _InfoState extends State {
  get child => null;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          'COVID COMPANION',
          style: TextStyle(
              fontSize: 20.0,
              fontWeight: FontWeight.bold,
              letterSpacing: 2.0
          ),
        ),
        backgroundColor: Colors.indigo[900],
        centerTitle: true,
        elevation: 0,
      ),
      backgroundColor: Colors.grey[200],
      body:
      GridView.count(
          crossAxisCount: 2,
Column(
        children: [
          Container(
                         child: Card(
              
GridView.count(
              crossAxisCount: 2,
              children: [
                Container(
                  child: Card(
                      
elevation: 10.0,
              child:Column(\n                                      child:Column(
                        
mainAxisAlignment: MainAxisAlignment.center,
                                        children: [
                  Image(
                    
[
                          Image(
                            
image: AssetImage('assets/undraw_faq_rjoy.png'),
                                                height:150.0,
                                                width: 200.0,
                                                fit:BoxFit.cover,
                  ),\n                  SizedBox(height:5.0 ,),\n                 OutlineButton(\n                   shape: StadiumBorder(),\n                   onPressed: (){},\n                   borderSide: BorderSide(color: Colors.pink.shade200),\n                   splashColor: Colors.pinkAccent[100],\n                   child: Padding(\n                     padding: EdgeInsets.all(8.0),\n                     child: Text(\n                     'FAQ',\n                      style: TextStyle(\n                       fontWeight: FontWeight.bold,\n                       color: Colors.black,\n                     ),\n                   ),\n                   ),\n\n                 )\n\n                ],\n\n\n              )\n            ),\n\n          ),\n          Container(\n            child: Card(\n                elevation: 10.0,\n                child:Column(\n                  mainAxisAlignment: MainAxisAlignment.center,\n                  children: [\n                    Image(\n                      image: AssetImage('assets/undraw_faq_rjoy.png'),\n                      height:150.0,\n                      width: 200.0,\n                      fit:BoxFit.cover,\n                    ),\n                    SizedBox(height:5.0 ,),\n                    OutlineButton(\n                      shape: StadiumBorder(),\n                      onPressed: (){},\n                      borderSide: BorderSide(color: Colors.pink.shade200),\n                      splashColor: Colors.pinkAccent[100],\n                      child: Padding(\n                        padding: EdgeInsets.all(8.0),\n                        child: Text(\n                          'DOs',\n                          style: TextStyle(\n                            fontWeight: FontWeight.bold,\n                            color: Colors.black,\n                          ),
                        ),\n                      ),\n\n                    )\n\n                  ],\n\n\n                )\n            ),\n\n          ),\n          Container(\n            child: Card(\n                elevation: 10.0,\n                child:Column(\n                  mainAxisAlignment: MainAxisAlignment.center,\n                  children: [\n                    Image(\n                      image: AssetImage('assets/undraw_faq_rjoy.png'),\n                      height:150.0,\n                      width: 200.0,\n                      fit:BoxFit.cover,\n                    ),\n                                              SizedBox(height:5.0 ,),
                    OutlineButton(\n                                                OutlineButton(
                            
shape: StadiumBorder(),
                      
StadiumBorder(),
                            
onPressed: (){},
                      
(){},
                            
borderSide: BorderSide(color: Colors.pink.shade200),
                                                  splashColor: Colors.pinkAccent[100],
                                                  child: Padding(
                        
Padding(
                              
padding: EdgeInsets.all(8.0),
                                                      child: Text(
                          'DONTs',
                          
Text(
                                'FAQ',
                                
style: TextStyle(
                            
TextStyle(
                                  
fontWeight: FontWeight.bold,
                                                              color: Colors.black,
                                ),
                              ),
                            ),

                          )

                        ],


                      )
                  ),

                ),
                Container(
                  child: Card(
                      elevation: 10.0,
                      child:Column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Image(
                            image: AssetImage('unnamed1.jpg'),
                            height:150.0,
                            width: 200.0,
                            fit:BoxFit.cover,
                          ),
                        ),\n                      ),\n\n                    )\n\n                  ],\n\n\n                )\n            ),\n\n          ),\n          Container(\n            child: Card(\n                elevation: 10.0,\n                child:Column(\n                  mainAxisAlignment: MainAxisAlignment.center,\n                  children: [\n                    Image(\n                      image: AssetImage('assets/undraw_faq_rjoy.png'),\n                      height:150.0,\n                      width: 200.0,\n                      fit:BoxFit.cover,\n                    ),\n                                              SizedBox(height:5.0 ,),
                    OutlineButton(\n                                                OutlineButton(
                            
shape: StadiumBorder(),
                      
StadiumBorder(),
                            
onPressed: (){},
                      
(){},
                            
borderSide: BorderSide(color: Colors.pink.shade200),
                                                  splashColor: Colors.pinkAccent[100],
                                                  child: Padding(
                        
Padding(
                              
padding: EdgeInsets.all(8.0),
                                                      child: Text(
                          'FAKE NEWS',
                          
Text(
                                'DOs',
                                
style: TextStyle(
                            
TextStyle(
                                  
fontWeight: FontWeight.bold,
                                                              color: Colors.black,
                                ),
                              ),
                            ),

                          )

                        ],


                      )
                  ),

                ),
                Container(
                  child: Card(
                      elevation: 10.0,
                      child:Column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Image(
                            image: AssetImage('assets/unnamed2.jpg'),
                            height:150.0,
                            width: 200.0,
                            fit:BoxFit.cover,
                          ),
                        ),\n                      ),\n\n                    )\n\n                  ],\n\n\n                          SizedBox(height:5.0 ,),
                          OutlineButton(
                            shape: StadiumBorder(),
                            onPressed: (){},
                            borderSide: BorderSide(color: Colors.pink.shade200),
                            splashColor: Colors.pinkAccent[100],
                            child: Padding(
                              padding: EdgeInsets.all(8.0),
                              child: Text(
                                'DONTs',
                                style: TextStyle(
                                  fontWeight: FontWeight.bold,
                                  color: Colors.black,
                                ),
                              ),
                            ),

                          )

                        ],


                      )
                  ),

                ),
                Container(
                  child: Card(
                      elevation: 10.0,
                      child:Column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Image(
                            image: AssetImage('assets/undraw_Notify_re_65on.jpg'),
                            height:150.0,
                            width: 200.0,
                            fit:BoxFit.cover,
                          ),
                          SizedBox(height:5.0 ,),
                          OutlineButton(
                            shape: StadiumBorder(),
                            onPressed: (){},
                            borderSide: BorderSide(color: Colors.pink.shade200),
                            splashColor: Colors.pinkAccent[100],
                            child: Padding(
                              padding: EdgeInsets.all(8.0),
                              child: Text(
                                'FAKE NEWS',
                                style: TextStyle(
                                  fontWeight: FontWeight.bold,
                                  color: Colors.black,
                                ),
                              ),
                            ),

                          )

                        ],


                      )
                  ),

                )
            ),\n\n          )\n\n      ]\n                  ],
             ),
                  ),
                  SizedBox(height: 20.0),
              Symptoms(),
             SizedBox(height: 20.0),
            preventions(),
        ],
      ),
    );
  }
  // ignore: non_constant_identifier_names
  Widget Symptoms() {
    return Material(
      color: Colors.white,
      elevation: 14.0,
      shadowColor: Color(0x802196F3),
      child: Column(
        children: [
          Padding(
            padding: EdgeInsets.all(8.0),
            child: labelContainer('SYMPTOMS'),
          ),
          Padding(
            padding: EdgeInsets.all(8.0),
            child: listofsymptoms(),
          ),
        ],
      ),
    );
  }
  Widget labelContainer(String labelVal) {
    return Container(
      height: 30.0,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            labelVal,
            style: TextStyle(fontWeight: FontWeight.bold,fontSize: 20.0),
          ),
          Text(
            'MORE',
            style: TextStyle(color: Colors.indigo[900],fontWeight: FontWeight.bold,fontSize: 18.0),
          ),
        ],
      ),
    );
  }
  Widget listofsymptoms() {
    return Container(
        height: 160.0,
        child: ListView(
          scrollDirection: Axis.horizontal,
          children: [
            imageSection(
                'assets/symp1.png',
                'HIGH FEVER/HEADACHE'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/symp2.png',
                'MUSCLE PAIN'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/symp3.png',
                'SUDDEN LOSS OF TASTE/SMELL'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/symp4.png',
                ' COUGH'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/symp5.png',
                'SORE THROAT'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/symp6.png',
                'DIFFICULTY IN BREATHING'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/symp7.png',
                'CHILLS'),
          ],
        ));
  }
  Widget imageSection(String imageVal, String appVal) {
    return Column(
      children: [
        Container(
          height: 100.0,
          width: 100.0,
          decoration: new BoxDecoration(
            image: DecorationImage(
              image: new NetworkImage(imageVal),
              fit: BoxFit.fill,
            ),
            borderRadius: BorderRadius.circular(20.0),
          ),
        ),
              SizedBox(
          height: 10.0,
        ),
        Text(
          appVal,
          style: TextStyle(
              color: Colors.black, fontWeight: FontWeight.bold, fontSize: 16.0),
        ),
        SizedBox(
          height: 10.0,
        ),

      ],
    
);
  }
  Widget preventions() {
    return Material(
      color: Colors.white,
      elevation: 14.0,
      shadowColor: Color(0x802196F3),
      child: Column(
        children: [
          Padding(
            padding: EdgeInsets.all(8.0),
            child: labelContainer('Preventions'),
          ),
          Padding(
            padding: EdgeInsets.all(8.0),
            child: listofpreventions(),
          ),
        ],
      ),
    );
  }

  Widget listofpreventions() {
    return Container(
        height: 160.0,
        child: ListView(
          scrollDirection: Axis.horizontal,
          children: [
            imageSection(
                'assets/prev1.jpg',
                'WEAR A MASK'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/prev2.jpg',
                'WASH HANDS/SANITISE HANDS'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/prev3.jpg',
                'AVOID CONTACTS WITH OTHERS'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/prev4.jpg',
                'COVER YOUR COUGH OR SNEEZE'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/prev5.jpg',
                'STAY HOME'),
            SizedBox(
              width: 20.0,
            ),
            imageSection(
                'assets/prev6.jpg',
                'DONT TRAVEL'),
          ],
        ));
  
}
}