Created
April 5, 2020 13:01
-
-
Save rommyarb/3a08f971195ab756de8230cfec402346 to your computer and use it in GitHub Desktop.
Pke Otak
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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
appBar: AppBar(leading: Icon(Icons.home), title: Text("Pke Otak")), | |
body: Center( | |
child: MyWidget(), | |
), | |
), | |
); | |
} | |
} | |
Widget tombol(String text) { | |
return Container( | |
margin: EdgeInsets.all(10), | |
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ | |
IconButton(onPressed: () {}, icon: Icon(Icons.shop)), | |
Text(text) | |
])); | |
} | |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Column(mainAxisAlignment: MainAxisAlignment.center, children: [ | |
Text("Categories"), | |
Row(mainAxisAlignment: MainAxisAlignment.center, children: [ | |
tombol("Men"), | |
tombol("Women"), | |
tombol("Devices"), | |
tombol("Gadgets"), | |
tombol("Gaming") | |
]) | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment