Skip to content

Instantly share code, notes, and snippets.

@visopsys
Created May 10, 2020 20:11
Show Gist options
  • Save visopsys/e8060d882581f85201f9a1abfaa11359 to your computer and use it in GitHub Desktop.
Save visopsys/e8060d882581f85201f9a1abfaa11359 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
final List<Widget> _children = [
HomeContent(),
Container(
alignment: Alignment.center,
child: Text("This is second screen", style: TextStyle(fontSize: 30),),
),
Container(
alignment: Alignment.center,
child: Text("This is third screen", style: TextStyle(fontSize: 30),),
),
];
int _currentIndex = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
body: _children[_currentIndex],
bottomNavigationBar: BottomNavigationBar(
fixedColor: Color(0xFFb30000),
currentIndex: _currentIndex,
onTap: (int index) {
setState(() {
_currentIndex = index;
});
},
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home), title: Text("Acceuil")),
BottomNavigationBarItem(
icon: Icon(Icons.wb_cloudy), title: Text("Météo")),
BottomNavigationBarItem(
icon: Icon(Icons.new_releases), title: Text("#Lactu")),
],
),
);
}
}
class HomeContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SafeArea(
child: ListView(
children: <Widget>[
Container(
padding: EdgeInsets.all(16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
" Whyte Plage",
style: TextStyle(
fontSize: 32.0,
fontWeight: FontWeight.bold,
color: Color(0xFFb30000),
),
),
],
),
],
),
),
SizedBox(height: 30),
Container(
child: Padding(
padding: const EdgeInsets.symmetric(),
child: Container(
width: 550.0,
height: 140.0,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
'https://www.airfrance.fr/FR/common/common/img/tbaf/news/RBA/skhirat-l-une-des-plus-belles-plages-du-monde/RBA-skhirat-l-une-des-plus-belles-plages-du-monde-2_1-1280x640.jpg')),
borderRadius: BorderRadius.all(Radius.circular(26.0)),
),
),
),
),
SizedBox(height: 20),
Container(
padding: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 8.0),
child: Material(
elevation: 5.0,
child: TextField(
decoration: InputDecoration(
hintText: "Rechercher(Plages,Services...)",
prefixIcon:
Icon(Icons.location_on, color: Color(0xFFb30000)),
border: InputBorder.none),
cursorColor: Color(0xFFb30000),
),
),
),
SizedBox(height: 20),
FloatingActionButton(
onPressed: () {},
tooltip: 'choisir une image',
child: Icon(Icons.add_a_photo),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment