Skip to content

Instantly share code, notes, and snippets.

@nobuhito
Last active December 1, 2018 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nobuhito/3ee505bc14dbe544d5642365b2492694 to your computer and use it in GitHub Desktop.
Save nobuhito/3ee505bc14dbe544d5642365b2492694 to your computer and use it in GitHub Desktop.
ひとりアドベントカレンダー Flutter編 2018
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