|
1 | 1 |
|
| 2 | +import 'package:flutter/material.dart'; |
| 3 | + |
| 4 | +void main() { |
| 5 | + runApp( |
| 6 | + MaterialApp( |
| 7 | + home: Scaffold( |
| 8 | + appBar: AppBar( |
| 9 | + title: Text('Responsive app '), |
| 10 | + backgroundColor: Colors.greenAccent[400], |
| 11 | + leading: IconButton( |
| 12 | + icon: Icon(Icons.menu), |
| 13 | + onPressed: () {}, |
| 14 | + tooltip: 'Menu', |
| 15 | + ) //IconButton |
| 16 | + ), //AppBar |
| 17 | + body: Center( |
| 18 | + child: Container( |
| 19 | + child: Padding( |
| 20 | + padding: const EdgeInsets.all(14.0), |
| 21 | + child: Column( |
| 22 | + children: <Widget>[ |
| 23 | + Row( |
| 24 | + children: <Widget>[ |
| 25 | + Flexible( |
| 26 | + flex: 1, |
| 27 | + fit: FlexFit.tight, |
| 28 | + child: Container( |
| 29 | + height: 175, |
| 30 | + decoration: BoxDecoration( |
| 31 | + borderRadius: BorderRadius.circular(10), |
| 32 | + color: Colors.red, |
| 33 | + ), //BoxDecoration |
| 34 | + ), //Container |
| 35 | + ), //Flexible |
| 36 | + SizedBox( |
| 37 | + width: 20, |
| 38 | + ), //SizedBox |
| 39 | + Flexible( |
| 40 | + flex: 1, |
| 41 | + fit: FlexFit.loose, |
| 42 | + child: Container( |
| 43 | + height: 175, |
| 44 | + decoration: BoxDecoration( |
| 45 | + borderRadius: BorderRadius.circular(10), |
| 46 | + color: Colors.red, |
| 47 | + ) //BoxDecoration |
| 48 | + ), //Container |
| 49 | + ) //Flexible |
| 50 | + ], //<Widget>[] |
| 51 | + mainAxisAlignment: MainAxisAlignment.center, |
| 52 | + ), //Row |
| 53 | + Flexible( |
| 54 | + flex: 1, |
| 55 | + fit: FlexFit.loose, |
| 56 | + child: Container( |
| 57 | + width: 380, |
| 58 | + height: 200, |
| 59 | + decoration: BoxDecoration( |
| 60 | + borderRadius: BorderRadius.circular(10), |
| 61 | + color: Colors.blue), //BoxDecoration |
| 62 | + ), //Container |
| 63 | + ), //Flexible |
| 64 | + Row( |
| 65 | + children: <Widget>[ |
| 66 | + Flexible( |
| 67 | + flex: 2, |
| 68 | + fit: FlexFit.tight, |
| 69 | + child: Container( |
| 70 | + width: 180, |
| 71 | + height: 300, |
| 72 | + decoration: BoxDecoration( |
| 73 | + borderRadius: BorderRadius.circular(10), |
| 74 | + color: Colors.cyan, |
| 75 | + ), //BoxDecoration |
| 76 | + ), //Container |
| 77 | + ), //Flexible |
| 78 | + SizedBox( |
| 79 | + width: 20, |
| 80 | + ), //SixedBox |
| 81 | + Flexible( |
| 82 | + flex: 2, |
| 83 | + fit: FlexFit.tight, |
| 84 | + child: Container( |
| 85 | + width: 180, |
| 86 | + height: 300, |
| 87 | + decoration: BoxDecoration( |
| 88 | + borderRadius: BorderRadius.circular(10), |
| 89 | + color: Colors.cyan, |
| 90 | + ) //BoxDecoration |
| 91 | + ) //Conatiner, |
| 92 | + ) //Flexible |
| 93 | + ], //<widget>[] |
| 94 | + mainAxisAlignment: MainAxisAlignment.center, |
| 95 | + ), //Row |
| 96 | + ], //<Widget>[] |
| 97 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 98 | + crossAxisAlignment: CrossAxisAlignment.center, |
| 99 | + ), //Column |
| 100 | + ) //Padding |
| 101 | + ), //Container |
| 102 | + ) //Center |
| 103 | + ), //Scaffold |
| 104 | + |
| 105 | + debugShowCheckedModeBanner: false, |
| 106 | +)); //MaterialApp |
| 107 | +} |
0 commit comments