Added bottom bar

This commit is contained in:
2020-12-29 20:43:37 +01:00
parent fa15a161ae
commit b42d60c683
4 changed files with 447 additions and 151 deletions

View File

@@ -46,15 +46,77 @@ class HomePage extends StatelessWidget {
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
showSettings(context);
},
child: Icon(
Icons.settings,
color: Colors.orange,
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: Container(
decoration: BoxDecoration(color: Colors.grey[850]),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding: EdgeInsets.all(8),
onPressed: () {
showSettings(context);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.note_rounded,
color: Colors.orange,
),
Text(
'Zamówienie',
style: TextStyle(color: Colors.grey[200], fontSize: 12),
)
],
),
),
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding: EdgeInsets.all(8),
onPressed: () {
showSettings(context);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.favorite_rounded,
color: Colors.orange,
),
Text(
'Ulubione',
style: TextStyle(color: Colors.grey[200], fontSize: 12),
)
],
),
),
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding: EdgeInsets.all(8),
onPressed: () {
showSettings(context);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.settings,
color: Colors.orange,
),
Text(
'Ustawienia',
style: TextStyle(color: Colors.grey[200], fontSize: 12),
)
],
),
)
],
),
backgroundColor: Colors.grey[850],
),
);
}

View File

@@ -58,13 +58,164 @@ class MapViewState extends State<MapView> {
target: data.coordinates,
zoom: 14,
);
child = GoogleMap(
mapType: MapType.normal,
initialCameraPosition: _initialPosition,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
markers: Set<Marker>.of(data.markers.values),
child = Column(
children: <Widget>[
Container(
height: 70,
decoration: BoxDecoration(color: Colors.grey[850]),
child: Column(
children: [
SizedBox(
height: 40,
),
Container(
height: 30,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.search_rounded,
color: Colors.orange,
),
SizedBox(
width: 8,
),
Text(
'Znaleziono: ${data.markers.length}',
style: TextStyle(color: Colors.white),
),
],
),
)
],
),
),
Expanded(
child: GoogleMap(
mapType: MapType.normal,
initialCameraPosition: _initialPosition,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
markers: Set<Marker>.of(data.markers.values),
),
),
Container(
decoration: BoxDecoration(color: Colors.grey[850]),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding:
EdgeInsets.symmetric(vertical: 12, horizontal: 4),
onPressed: () {
Navigator.pop(context);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.arrow_back,
color: Colors.orange,
),
Text(
'Cofnij',
style: TextStyle(
color: Colors.grey[200], fontSize: 12),
)
],
),
),
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding:
EdgeInsets.symmetric(vertical: 12, horizontal: 4),
onPressed: () {
Navigator.pop(context);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.location_pin,
color: Colors.orange,
),
Text(
'Promień',
style: TextStyle(
color: Colors.grey[200], fontSize: 12),
),
Text(
'600m',
style:
TextStyle(color: Colors.grey, fontSize: 10),
)
],
),
),
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding:
EdgeInsets.symmetric(vertical: 12, horizontal: 4),
onPressed: () {
Navigator.pop(context);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.map_rounded,
color: Colors.orange,
),
Text(
'Kuchnia',
style: TextStyle(
color: Colors.grey[200], fontSize: 12),
),
Text(
'Wszystkie',
style:
TextStyle(color: Colors.grey, fontSize: 10),
)
],
),
),
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding:
EdgeInsets.symmetric(vertical: 12, horizontal: 4),
onPressed: () {
Navigator.pop(context);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.filter_list_alt,
color: Colors.orange,
),
Text(
'Filtry',
style: TextStyle(
color: Colors.grey[200], fontSize: 12),
),
Text(
'Brak',
style:
TextStyle(color: Colors.grey, fontSize: 10),
)
],
),
),
],
),
),
],
);
} else if (snapshot.hasError) {
child = Center(
@@ -75,41 +226,34 @@ class MapViewState extends State<MapView> {
),
);
} else {
child = Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(
child: CircularProgressIndicator(),
width: 60,
height: 60,
child = Container(
decoration: BoxDecoration(color: Colors.grey[850]),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(
child: CircularProgressIndicator(
backgroundColor: Colors.white,
),
width: 60,
height: 60,
),
Padding(
padding: EdgeInsets.only(top: 16),
child: Text(
'Szukam restauracji...',
style: TextStyle(color: Colors.grey[200]),
),
)
],
),
Padding(
padding: EdgeInsets.only(top: 16),
child: Text('Szukam restauracji...'),
)
],
),
);
));
}
return child;
},
),
floatingActionButton: Padding(
padding: EdgeInsets.only(bottom: 20),
child: FloatingActionButton(
backgroundColor: Colors.grey[800],
onPressed: () {
Navigator.pop(context);
},
child: Icon(
Icons.arrow_back_outlined,
color: Colors.orange,
),
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.startDocked,
);
}
}

View File

@@ -11,117 +11,120 @@ class RestaurantCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
String _openHours = _services.getTodayHours(restaurant.workingHours);
return Card(
child: InkWell(
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => RestaurantView(id: restaurant.id))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: ClipRRect(
child: Image.network(
restaurant.imgUrl,
width: 100,
height: 100,
fit: BoxFit.cover,
return Padding(
padding: EdgeInsets.only(bottom: 8),
child: Card(
child: InkWell(
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => RestaurantView(id: restaurant.id))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: ClipRRect(
child: Image.network(
restaurant.imgUrl,
width: 100,
height: 100,
fit: BoxFit.cover,
),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(12),
topLeft: Radius.circular(12)),
),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(12),
topLeft: Radius.circular(12)),
padding: EdgeInsets.only(right: 8),
),
padding: EdgeInsets.only(right: 8),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Text(
restaurant.name,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(color: Colors.orange[600], fontSize: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Text(
restaurant.name,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(color: Colors.orange[600], fontSize: 16),
),
Container(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.location_city,
size: 14,
color: Colors.white,
),
Padding(
padding: EdgeInsets.only(left: 4),
child: Text(
'${restaurant.city}, ${restaurant.adress}',
style:
TextStyle(color: Colors.grey, fontSize: 12),
),
),
]),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.restaurant,
size: 14,
color: Colors.white,
),
Padding(
padding: EdgeInsets.only(left: 4),
child: Text(
'${restaurant.type}',
style:
TextStyle(color: Colors.grey, fontSize: 12),
),
),
]),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.timer,
size: 14,
color: Colors.white,
),
Padding(
padding: EdgeInsets.only(left: 4),
child: Text(
'$_openHours',
style:
TextStyle(color: Colors.grey, fontSize: 12),
),
),
]),
Padding(
child: LineOfIconsSmall(tags: restaurant.tags),
padding: EdgeInsets.only(top: 4),
)
],
)),
],
)),
Container(
child: Icon(
Icons.arrow_right,
color: Colors.white,
size: 28,
),
Container(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.location_city,
size: 14,
color: Colors.white,
),
Padding(
padding: EdgeInsets.only(left: 4),
child: Text(
'${restaurant.city}, ${restaurant.adress}',
style:
TextStyle(color: Colors.grey, fontSize: 12),
),
),
]),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.restaurant,
size: 14,
color: Colors.white,
),
Padding(
padding: EdgeInsets.only(left: 4),
child: Text(
'${restaurant.type}',
style:
TextStyle(color: Colors.grey, fontSize: 12),
),
),
]),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.timer,
size: 14,
color: Colors.white,
),
Padding(
padding: EdgeInsets.only(left: 4),
child: Text(
'$_openHours',
style:
TextStyle(color: Colors.grey, fontSize: 12),
),
),
]),
Padding(
child: LineOfIconsSmall(tags: restaurant.tags),
padding: EdgeInsets.only(top: 4),
)
],
)),
],
)),
Container(
child: Icon(
Icons.arrow_right,
color: Colors.white,
size: 28,
),
)
],
)
],
),
),
color: Color.fromRGBO(50, 50, 50, 0.8),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
margin: EdgeInsets.symmetric(horizontal: 12),
),
color: Color.fromRGBO(50, 50, 50, 0.8),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
margin: EdgeInsets.symmetric(horizontal: 12),
);
}
}

View File

@@ -49,6 +49,93 @@ class SearchResults extends StatelessWidget {
),
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: Container(
decoration: BoxDecoration(color: Colors.grey[850]),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 4),
onPressed: () {
Navigator.pop(context);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.arrow_back_rounded,
color: Colors.orange,
),
Text(
'Cofnij',
style: TextStyle(color: Colors.grey[200], fontSize: 12),
)
],
),
),
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding: EdgeInsets.all(8),
onPressed: () {},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.note_rounded,
color: Colors.orange,
),
Text(
'Zamówienie',
style: TextStyle(color: Colors.grey[200], fontSize: 12),
)
],
),
),
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding: EdgeInsets.all(8),
onPressed: () {},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.favorite_rounded,
color: Colors.orange,
),
Text(
'Ulubione',
style: TextStyle(color: Colors.grey[200], fontSize: 12),
)
],
),
),
RaisedButton(
color: Colors.grey[850],
elevation: 0,
padding: EdgeInsets.all(8),
onPressed: () {},
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.settings,
color: Colors.orange,
),
Text(
'Ustawienia',
style: TextStyle(color: Colors.grey[200], fontSize: 12),
)
],
),
)
],
),
),
);
}
}