Created
August 2, 2019 00:30
-
-
Save 3gcodes/75737ad5a28e7341b4b29ff809771bdb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/services.dart'; | |
| Future main() async { | |
| await SystemChrome.setPreferredOrientations( | |
| [DeviceOrientation.landscapeLeft]); | |
| await SystemChrome.setEnabledSystemUIOverlays([]); | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| debugShowCheckedModeBanner: false, | |
| title: 'Flutter Demo', | |
| theme: ThemeData( | |
| primarySwatch: Colors.blue, | |
| ), | |
| home: Scaffold( | |
| drawer: Drawer(), | |
| appBar: AppBar( | |
| title: Text("Nigel"), | |
| actions: <Widget>[ | |
| IconButton( | |
| icon: Icon(Icons.timer), | |
| onPressed: () => {}, | |
| ) | |
| ], | |
| ), | |
| body: Row( | |
| crossAxisAlignment: CrossAxisAlignment.stretch, | |
| children: <Widget>[ | |
| Expanded( | |
| child: Container( | |
| child: Center( | |
| child: Text("Item Out"), | |
| ), | |
| color: Colors.orange, | |
| ), | |
| ), | |
| Expanded( | |
| child: Container( | |
| color: Colors.blue, | |
| child: GridView.count( | |
| // Create a grid with 2 columns. If you change the scrollDirection to | |
| // horizontal, this produces 2 rows. | |
| crossAxisCount: 2, | |
| // Generate 100 widgets that display their index in the List. | |
| children: List.generate(10, (index) { | |
| return Center( | |
| child: Card( | |
| color: Colors.amberAccent, | |
| child: InkWell( | |
| onTap: () => { }, | |
| child: Column( | |
| crossAxisAlignment: CrossAxisAlignment.center, | |
| children: <Widget>[ | |
| Container( | |
| child: Icon( | |
| Icons.face, | |
| size: 100, | |
| ), | |
| width: 200, | |
| ), | |
| Container( | |
| child: Text("Emp $index") | |
| ), | |
| ], | |
| ), | |
| ), | |
| ), | |
| ); | |
| }), | |
| ), | |
| ), | |
| ), | |
| ], | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment