Advertisement
Guest User

Untitled

a guest
Aug 18th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.41 KB | None | 0 0
  1. `import 'package:flutter/material.dart';
  2.  
  3. void main() => runApp(new MyApp());
  4.  
  5. class MyApp extends StatelessWidget {
  6.   // This widget is the root of your application.
  7.   @override
  8.   Widget build(BuildContext context) {
  9.     return new MaterialApp(
  10.       title: 'Flutter Demo',
  11.       home: new MyHomePage(),
  12.     );
  13.   }
  14. }
  15.  
  16. class MyHomePage extends StatefulWidget {
  17.   @override
  18.   _MyHomePageState createState() => new _MyHomePageState();
  19. }
  20.  
  21. class _MyHomePageState extends State<MyHomePage> {
  22.   @override
  23.   Widget build(BuildContext context) {
  24.     return new Scaffold(
  25.       body: Container(
  26.         child: Column(
  27.           children: <Widget>[
  28.             Expanded(
  29.               child: Container(),
  30.             ),
  31.             Row(
  32.               children: <Widget>[
  33.                 buildMaterialButton(),
  34.                 buildMaterialButton(),
  35.                 buildMaterialButton(),
  36.                 buildMaterialButton(),
  37.               ],
  38.             ),
  39.             Row(
  40.               children: <Widget>[
  41.                 buildMaterialButton(),
  42.                 buildMaterialButton(),
  43.                 buildMaterialButton(),
  44.                 buildMaterialButton(),
  45.               ],
  46.             ),
  47.             Row(
  48.               children: <Widget>[
  49.                 buildMaterialButton(),
  50.                 buildMaterialButton(),
  51.                 buildMaterialButton(),
  52.                 buildMaterialButton(),
  53.               ],
  54.             ),
  55.             Row(
  56.               children: <Widget>[
  57.                 buildMaterialButton(),
  58.                 buildMaterialButton(),
  59.                 buildMaterialButton(),
  60.                 buildMaterialButton(),
  61.               ],
  62.             ),
  63.             Row(
  64.               children: <Widget>[
  65.                 buildMaterialButton(),
  66.                 buildMaterialButton(),
  67.                 buildMaterialButton(),
  68.                 buildMaterialButton(),
  69.               ],
  70.             ),
  71.           ],
  72.         ),
  73.       ),
  74.     );
  75.   }
  76.  
  77.   Widget buildMaterialButton() {
  78.     return Expanded(
  79.       child: Container(
  80.         decoration: BoxDecoration(
  81.           color: Colors.blueGrey,
  82.           borderRadius: BorderRadius.circular(40.0)
  83.         ),
  84.         child: MaterialButton(
  85.           onPressed: () {},
  86.           child: Padding(
  87.             padding: const EdgeInsets.all(20.0),
  88.             child: Text("1"),
  89.           ),
  90.         ),
  91.       ),
  92.     );
  93.   }
  94. }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement