I am trying to build a page which contains 6 buttons and a background image .My code working perfectly fine . I am creating it for flutter web so I am running it on Edge .When i try resizing the full screen to smaller one i Get the ErroR rENDERED fFlex Overflowed .I tried using expanded widget but i got an error .Can u help me rectify this minor bug. The error is as shown in the image below.
Here is my Code:-
import 'dart:html';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'restaurant.dart';
class mainpage extends StatefulWidget {
@override
_mainpageState createState() => _mainpageState();
}
class _mainpageState extends State<mainpage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:AppBar(
title:const Center(child: Text("Food express")),
backgroundColor: Colors.black54,
),
body: Container(
decoration:const BoxDecoration(
image:DecorationImage(
image: AssetImage('image/foood.jpg'),
fit : BoxFit.cover,
),
),
child: Column(
children: [
Row(
children: [
const SizedBox(height:400,width:450),
FlatButton(
onPressed: () {
Navigator.push(context,MaterialPageRoute(builder:(context){
return Restaurant();
}));
},
color: Colors.black26,
child: const Text('Restaurant',
style: TextStyle(
color:Colors.white,
),
),
padding: const EdgeInsets.all(40),
),
const SizedBox(width:50,height:20),
FlatButton(
onPressed: () {},
color: Colors.black26,
child: const Text('Restaurant',
style: TextStyle(
color:Colors.white,
),
),
padding: const EdgeInsets.all(40),
),
const SizedBox(width:50,height:20),
FlatButton(
onPressed: () {},
color: Colors.black26,
child: const Text('Restaurant',
style: TextStyle(
color:Colors.white,
),
),
padding: const EdgeInsets.all(40),
)
],
),
Row(
children:[
const SizedBox(height:100,width:450),
FlatButton(
onPressed: () {},
color: Colors.black26,
child: const Text('Restaurant',
style: TextStyle(
color:Colors.white,
),
),
padding: const EdgeInsets.all(40),
),
const SizedBox(width:50,height:20),
FlatButton(
onPressed: () {},
color: Colors.black26,
child: const Text('Restaurant',
style: TextStyle(
color:Colors.white,
),
),
padding: const EdgeInsets.all(40),
),
const SizedBox(width:50,height:20),
FlatButton(
onPressed: () {},
color: Colors.black26,
child: const Text('Restaurant',
style: TextStyle(
color:Colors.white,
),
),
padding: const EdgeInsets.all(40),
),
const SizedBox(width:50,height:20),
]
)
],
),
),
);
}
}