How to add a Footer Buttons in Flutter?

This Article is posted by seven.srikanth at 8/15/2019 2:02:41 PM



Footer Buttons in flutter can be achieved by adding persistenFooderButtons properties to the Scaffold. In this post, I'm going to share the code to achieve the same.
Here is how the final output is going to look.
Here is the code from main.dart file. 
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Building Layouts with FLutter'),
),
body: Center(
child: Text(
'Hello Flutter Layouts',
style: TextStyle(fontSize: 24),
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
print('You clicked');
},
child: Icon(Icons.lightbulb_outline),
),
persistentFooterButtons: <Widget>[
IconButton(
icon: Icon(Icons.add), onPressed: () {},
),
IconButton(
icon: Icon(Icons.alarm), onPressed: () {},
),
IconButton(
icon: Icon(Icons.add_location), onPressed: () {},
),
],
),
);
}
}
Hope this example will be useful to you.
If you are interest in an alternate way of achiving the same, here is another example https://fluttercentral.com/Articles/Post/1140
Thanks,
Srikanth

Tags: Scaffold; persistentFooterButtons;








0 Comments
Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.


© 2018 - Fluttercentral | Email to me - seven.srikanth@gmail.com