Last active
December 1, 2018 03:44
-
-
Save nobuhito/3ee505bc14dbe544d5642365b2492694 to your computer and use it in GitHub Desktop.
ひとりアドベントカレンダー Flutter編 2018
This file contains 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'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp(home: MaterialIconsViewer()); | |
} | |
} | |
class MaterialIconsViewer extends StatelessWidget { | |
final List<IconData> icons = [ | |
Icons.access_alarm, | |
Icons.arrow_back_ios, | |
Icons.account_balance_wallet, | |
Icons.center_focus_weak, | |
Icons.blur_on, | |
Icons.dashboard, | |
Icons.phone, | |
Icons.tap_and_play, | |
]; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Material Icons Viewer"), | |
), | |
body: SafeArea( | |
child: GridView.builder( | |
itemCount: icons.length, | |
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | |
crossAxisCount: 2, | |
), | |
itemBuilder: (context, index) { | |
return Container( | |
decoration: BoxDecoration( | |
border: Border.all(color: Colors.black45), | |
), | |
child: Icon(icons[index], size: 50), | |
); | |
}, | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment