I am making an App named Picfolio in which i require multiple screens,For that i have to add a raised button below the gridview which i am unable to add.How to add raised button in the second screen below the gridview so that on pressing it, i will be taken to the third screen.
How to add 'Raised button' just below the gridview?
268 views Asked by Vasav Chaturvedi At
2
There are 2 answers
0
On
Use bottomSheet
props:
class SecondScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
// you can use bottomSheet prop to add the Rasised button at the bottom:
bottomSheet: Container(
width: double.infinity,
child: RaisedButton(
color: Colors.red,
child: Text("Bottom Button"),
onPressed: () {},
),
),
//--------------------------------------------------//
appBar: AppBar(
title: Text("Bird Species"),
flexibleSpace: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: <Color>[
Colors.yellowAccent,
You need to use Expanded widget in Column widget. Just add Column widget and add you GridView with wrapping of Expanded widget and add Raised Button Just Like below. Replace your body part from SecondScreen class with below code.