Map / Order mechanics
This commit is contained in:
@@ -52,6 +52,25 @@ class HomePage extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
RaisedButton(
|
||||||
|
color: Colors.grey[850],
|
||||||
|
elevation: 0,
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
onPressed: () {},
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(
|
||||||
|
Icons.home_rounded,
|
||||||
|
color: Colors.orange,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Szukaj',
|
||||||
|
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
color: Colors.grey[850],
|
color: Colors.grey[850],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
|||||||
@@ -61,15 +61,108 @@ class MapViewState extends State<MapView> {
|
|||||||
child = Column(
|
child = Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
height: 70,
|
|
||||||
decoration: BoxDecoration(color: Colors.grey[850]),
|
decoration: BoxDecoration(color: Colors.grey[850]),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40,
|
height: 20,
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: 30,
|
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.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),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey[700]
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -77,12 +170,9 @@ class MapViewState extends State<MapView> {
|
|||||||
Icons.search_rounded,
|
Icons.search_rounded,
|
||||||
color: Colors.orange,
|
color: Colors.orange,
|
||||||
),
|
),
|
||||||
SizedBox(
|
|
||||||
width: 8,
|
|
||||||
),
|
|
||||||
Text(
|
Text(
|
||||||
'Znaleziono: ${data.markers.length}',
|
'Znaleziono: ${data.markers.length}',
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white, fontSize: 12),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -104,26 +194,22 @@ class MapViewState extends State<MapView> {
|
|||||||
decoration: BoxDecoration(color: Colors.grey[850]),
|
decoration: BoxDecoration(color: Colors.grey[850]),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: <Widget>[
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
color: Colors.grey[850],
|
color: Colors.grey[850],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
padding:
|
padding: EdgeInsets.all(8),
|
||||||
EdgeInsets.symmetric(vertical: 12, horizontal: 4),
|
onPressed: () {},
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(
|
Icon(
|
||||||
Icons.arrow_back,
|
Icons.home_rounded,
|
||||||
color: Colors.orange,
|
color: Colors.orange,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'Cofnij',
|
'Szukaj',
|
||||||
style: TextStyle(
|
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
||||||
color: Colors.grey[200], fontSize: 12),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -131,27 +217,18 @@ class MapViewState extends State<MapView> {
|
|||||||
RaisedButton(
|
RaisedButton(
|
||||||
color: Colors.grey[850],
|
color: Colors.grey[850],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
padding:
|
padding: EdgeInsets.all(8),
|
||||||
EdgeInsets.symmetric(vertical: 12, horizontal: 4),
|
onPressed: () {},
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(
|
Icon(
|
||||||
Icons.location_pin,
|
Icons.note_rounded,
|
||||||
color: Colors.orange,
|
color: Colors.orange,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'Promień',
|
'Zamówienie',
|
||||||
style: TextStyle(
|
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
||||||
color: Colors.grey[200], fontSize: 12),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'600m',
|
|
||||||
style:
|
|
||||||
TextStyle(color: Colors.grey, fontSize: 10),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -159,27 +236,18 @@ class MapViewState extends State<MapView> {
|
|||||||
RaisedButton(
|
RaisedButton(
|
||||||
color: Colors.grey[850],
|
color: Colors.grey[850],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
padding:
|
padding: EdgeInsets.all(8),
|
||||||
EdgeInsets.symmetric(vertical: 12, horizontal: 4),
|
onPressed: () {},
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(
|
Icon(
|
||||||
Icons.map_rounded,
|
Icons.favorite_rounded,
|
||||||
color: Colors.orange,
|
color: Colors.orange,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'Kuchnia',
|
'Ulubione',
|
||||||
style: TextStyle(
|
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
||||||
color: Colors.grey[200], fontSize: 12),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'Wszystkie',
|
|
||||||
style:
|
|
||||||
TextStyle(color: Colors.grey, fontSize: 10),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -187,31 +255,24 @@ class MapViewState extends State<MapView> {
|
|||||||
RaisedButton(
|
RaisedButton(
|
||||||
color: Colors.grey[850],
|
color: Colors.grey[850],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
padding:
|
padding: EdgeInsets.all(8),
|
||||||
EdgeInsets.symmetric(vertical: 12, horizontal: 4),
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
//showSettings(context);
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(
|
Icon(
|
||||||
Icons.filter_list_alt,
|
Icons.settings,
|
||||||
color: Colors.orange,
|
color: Colors.orange,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'Filtry',
|
'Ustawienia',
|
||||||
style: TextStyle(
|
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
||||||
color: Colors.grey[200], fontSize: 12),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'Brak',
|
|
||||||
style:
|
|
||||||
TextStyle(color: Colors.grey, fontSize: 10),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -83,4 +83,27 @@ class MenuiSettings {
|
|||||||
return "Nie";
|
return "Nie";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ADD DISH TO ORDER --- TODO
|
||||||
|
void addToOrder(String id) async{
|
||||||
|
final settings = await SharedPreferences.getInstance();
|
||||||
|
if(settings.containsKey('order')){
|
||||||
|
List<String> order = settings.getStringList('order');
|
||||||
|
order.add(id);
|
||||||
|
} else {
|
||||||
|
final List<String> order = new List<String>();
|
||||||
|
order.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET ORDER
|
||||||
|
Future<List<String>> getOrder() async{
|
||||||
|
final settings = await SharedPreferences.getInstance();
|
||||||
|
if(settings.containsKey('order')){
|
||||||
|
List<String> order = settings.getStringList('order');
|
||||||
|
return order;
|
||||||
|
} else {
|
||||||
|
return new List<String>();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user