Write a Program in flutter responsive webapp homepage design
![]() |
Write a Program in flutter responsive webapp homepage design |
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: HomePage(),
),
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(
"https://images.unsplash.com/photo-1558981806-ec527fa84c39?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80"),
fit: BoxFit.cover,
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 50.0,
),
Text(
"Welcome to My Website",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 28.0,
color: Colors.white,
),
),
SizedBox(
height: 20.0,
),
Text(
"We provide the best services in town",
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
),
),
SizedBox(
height: 50.0,
),
Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(30.0),
),
child: FlatButton(
onPressed: () {
print("Explore button pressed");
},
child: Text(
"Explore",
style: TextStyle(
fontSize: 18.0,
),
),
),
),
],
),
);
}
}