Created
May 10, 2019 10:48
-
-
Save itsatifsiddiqui/020abc8a5aeb9e236e2dc4dcae9a5fd9 to your computer and use it in GitHub Desktop.
Flutter Provide stage 1
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( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: HomePage(), | |
); | |
} | |
} | |
class HomePage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
int _counter = 0; | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Provider Demo"), | |
), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
Text( | |
'You have pushed the button this many times:', | |
), | |
Text( | |
'$_counter', | |
style: Theme.of(context).textTheme.display1, | |
), | |
], | |
), | |
), | |
floatingActionButton: Column( | |
mainAxisAlignment: MainAxisAlignment.end, | |
children: <Widget>[ | |
FloatingActionButton( | |
onPressed: () {}, | |
tooltip: 'Increment', | |
child: Icon(Icons.add), | |
), | |
SizedBox(height: 10), | |
FloatingActionButton( | |
onPressed: () {}, | |
tooltip: 'Increment', | |
child: Icon(Icons.remove), | |
) | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You might want to change the tooltip on the subtraction FloatingActionButton to "decrement"