diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 324468b..8a3d44a 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -48,5 +48,7 @@
+
diff --git a/lib/components/dishView.dart b/lib/components/dishView.dart
index bcb479e..7351689 100644
--- a/lib/components/dishView.dart
+++ b/lib/components/dishView.dart
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:menui_mobile/services.dart';
import 'lineOfAllergens.dart';
+import 'iconChip.dart';
class DishView extends StatelessWidget {
final Dish dish;
@@ -22,6 +23,7 @@ class DishView extends StatelessWidget {
fit: BoxFit.cover),
),
child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 160,
@@ -32,14 +34,21 @@ class DishView extends StatelessWidget {
decoration: BoxDecoration(
color: Colors.grey[850],
borderRadius: BorderRadius.all(Radius.circular(8))),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
children: [
+ Icon(
+ Icons.restaurant,
+ color: Colors.orange,
+ ),
+ SizedBox(
+ width: 8,
+ ),
Text(
dish.name,
style: TextStyle(
fontSize: 24,
- color: Colors.orange,
+ color: Colors.white,
fontWeight: FontWeight.w300),
),
],
@@ -50,26 +59,29 @@ class DishView extends StatelessWidget {
),
),
SizedBox(height: 8),
+ Text(
+ 'Może zawierać',
+ style: TextStyle(color: Colors.orange, fontSize: 14),
+ ),
Allergens(allergens: dish.allergens),
Divider(
height: 14,
thickness: 4,
),
- Text(
- 'Cena',
- style: TextStyle(color: Colors.orange, fontSize: 14),
- ),
SizedBox(
- height: 12,
+ height: 8,
),
Prices(prices: dish.prices),
SizedBox(
- height: 12,
+ height: 8,
),
Divider(
height: 14,
thickness: 4,
),
+ SizedBox(
+ height: 6,
+ ),
Text(
'Składniki',
style: TextStyle(color: Colors.orange, fontSize: 14),
@@ -82,46 +94,27 @@ class DishView extends StatelessWidget {
style: TextStyle(color: Colors.grey[200], fontSize: 12),
),
SizedBox(
- height: 12,
+ height: 6,
),
- Text(
- 'Porcja',
- style: TextStyle(color: Colors.orange, fontSize: 14),
+ Divider(
+ height: 14,
+ thickness: 4,
),
SizedBox(
- height: 12,
+ height: 6,
),
- Text(
- '${dish.weight}',
- style: TextStyle(color: Colors.grey[200], fontSize: 12),
- ),
- SizedBox(
- height: 12,
- ),
- Text(
- 'Wartość energetyczna',
- style: TextStyle(color: Colors.orange, fontSize: 14),
- ),
- SizedBox(
- height: 12,
- ),
- Text(
- '${dish.kCal}',
- style: TextStyle(color: Colors.grey[200], fontSize: 12),
- ),
- SizedBox(
- height: 12,
- ),
- Text(
- 'Indeks glikemiczny',
- style: TextStyle(color: Colors.orange, fontSize: 14),
- ),
- SizedBox(
- height: 12,
- ),
- Text(
- '${dish.glicemicIndex}',
- style: TextStyle(color: Colors.grey[200], fontSize: 12),
+ Wrap(
+ spacing: 10,
+ children: [
+ IconChip(
+ icon: Icons.battery_charging_full,
+ leading: "Wartość energetyczna",
+ value: dish.kCal),
+ IconChip(
+ icon: Icons.cake,
+ leading: "Indeks glikemiczny",
+ value: dish.glicemicIndex),
+ ],
),
SizedBox(
height: 12,
@@ -133,10 +126,26 @@ class DishView extends StatelessWidget {
SizedBox(
height: 12,
),
- Text(
- '${dish.notes}',
- style: TextStyle(color: Colors.grey[200], fontSize: 12),
- ),
+ if (dish.notes == "")
+ Text(
+ '---',
+ style: TextStyle(color: Colors.grey[200], fontSize: 12),
+ ),
+ if (dish.notes != "")
+ Text(
+ '${dish.notes}',
+ style: TextStyle(color: Colors.grey[200], fontSize: 12),
+ ),
+ if (dish.vegan)
+ Text(
+ 'Danie wegańskie',
+ style: TextStyle(color: Colors.grey[200], fontSize: 12),
+ ),
+ if (dish.vegetarian)
+ Text(
+ 'Danie wegetariańskie',
+ style: TextStyle(color: Colors.grey[200], fontSize: 12),
+ ),
],
),
),
diff --git a/lib/components/homeScreen.dart b/lib/components/homeScreen.dart
index 65d8661..20b1d7c 100644
--- a/lib/components/homeScreen.dart
+++ b/lib/components/homeScreen.dart
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'searchBar.dart';
import '../settings.dart';
+import 'mapView.dart';
class HomePage extends StatelessWidget {
final MenuiSettings settings = new MenuiSettings();
@@ -27,7 +28,8 @@ class HomePage extends StatelessWidget {
),
RaisedButton.icon(
color: Colors.grey[850],
- onPressed: () {},
+ onPressed: () => Navigator.push(context,
+ MaterialPageRoute(builder: (context) => MapView())),
icon: Icon(
Icons.my_location,
color: Colors.orange,
diff --git a/lib/components/iconChip.dart b/lib/components/iconChip.dart
new file mode 100644
index 0000000..a22111a
--- /dev/null
+++ b/lib/components/iconChip.dart
@@ -0,0 +1,43 @@
+import 'package:flutter/material.dart';
+
+class IconChip extends StatelessWidget {
+ final IconData icon;
+ final String leading;
+ final String value;
+
+ IconChip({@required this.icon, @required this.leading, @required this.value});
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ padding: EdgeInsets.all(12),
+ decoration: BoxDecoration(
+ color: Colors.grey[800],
+ borderRadius: BorderRadius.all(Radius.circular(12))),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Icon(
+ icon,
+ color: Colors.orange,
+ ),
+ SizedBox(height: 8),
+ Text(
+ '$leading',
+ style: TextStyle(color: Colors.grey[300], fontSize: 11),
+ ),
+ SizedBox(height: 4),
+ if (value == "")
+ Text(
+ 'brak danych :(',
+ style: TextStyle(color: Colors.white, fontSize: 14),
+ ),
+ if (value != "")
+ Text(
+ '$value',
+ style: TextStyle(color: Colors.white, fontSize: 14),
+ ),
+ ]),
+ );
+ }
+}
diff --git a/lib/components/mapView.dart b/lib/components/mapView.dart
new file mode 100644
index 0000000..58b5ef9
--- /dev/null
+++ b/lib/components/mapView.dart
@@ -0,0 +1,110 @@
+import 'dart:async';
+import 'package:flutter/material.dart';
+import 'package:google_maps_flutter/google_maps_flutter.dart';
+import '../services.dart';
+import 'package:geolocator/geolocator.dart';
+
+class MapView extends StatefulWidget {
+ @override
+ State createState() => MapViewState();
+}
+
+class MapViewState extends State {
+ Completer _controller = Completer();
+ MenuiServices services = new MenuiServices();
+ Position position;
+
+ Future