Skip to content

Instantly share code, notes, and snippets.

@Andrious
Created June 6, 2019 16:27
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andrious/c60b4b4d1f0a0828b53b734321ffc12b to your computer and use it in GitHub Desktop.
Save Andrious/c60b4b4d1f0a0828b53b734321ffc12b to your computer and use it in GitHub Desktop.
Scaffold's persistentFooterButtons parameter example
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
MyApp({Key key}) : super(key: key);
State createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
int _count = 0;
@override
Widget build(BuildContext context) {
final title = 'Floating App Bar';
return MaterialApp(
debugShowCheckedModeBanner: false,
title: title,
home: Scaffold(
appBar: AppBar(
title: Text('Sample Code'),
),
body: Center(
child: Text('You have pressed the button $_count times.'),
),
bottomNavigationBar: BottomAppBar(
child: Container(
height: 50.0,
),
),
floatingActionButton: FloatingActionButton(
onPressed: () => setState(() {
_count++;
}),
tooltip: 'Increment Counter',
child: Icon(Icons.add),
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
persistentFooterButtons: <Widget>[
IconButton(icon: Icon(Icons.insert_emoticon),onPressed: () {}),
IconButton(icon: Icon(Icons.mood),onPressed: () {}),
IconButton(icon: Icon(Icons.mood_bad),onPressed: () {}),
IconButton(icon: Icon(Icons.sentiment_dissatisfied),onPressed: () {}),
IconButton(icon: Icon(Icons.sentiment_neutral),onPressed: () {}),
IconButton(icon: Icon(Icons.sentiment_satisfied),onPressed: () {}),
IconButton(icon: Icon(Icons.sentiment_very_dissatisfied),onPressed: () {}),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment