Skip to content

Instantly share code, notes, and snippets.

@itsatifsiddiqui
Created May 10, 2019 10:48
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 itsatifsiddiqui/020abc8a5aeb9e236e2dc4dcae9a5fd9 to your computer and use it in GitHub Desktop.
Save itsatifsiddiqui/020abc8a5aeb9e236e2dc4dcae9a5fd9 to your computer and use it in GitHub Desktop.
Flutter Provide stage 1
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),
)
],
),
);
}
}
@JaredEzz
Copy link

You might want to change the tooltip on the subtraction FloatingActionButton to "decrement"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment