Skip to content

Instantly share code, notes, and snippets.

@mampersat
Created March 10, 2020 22:55
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 mampersat/c4fc42ee5b988a934da788b0f7cf9549 to your computer and use it in GitHub Desktop.
Save mampersat/c4fc42ee5b988a934da788b0f7cf9549 to your computer and use it in GitHub Desktop.
Pimorize
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(
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children:
[
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ NumberButton(i:'7'), NumberButton(i:'8'),NumberButton(i:'9') ]
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ Text('4'), Text('5'),Text('6') ]
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ Text('1'), Text('2'),Text('3') ]
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ Text('0'),Text('.') ]
),
]
);
}
}
class NumberButton extends StatelessWidget {
const NumberButton({ Key key, this.i = '3',}) : super(key: key);
final String i;
@override
Widget build(BuildContext context) {
return Container(
child: Text(i)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment