redesigned / search by submit / fixes

This commit is contained in:
2021-01-25 18:58:00 +01:00
parent 66d35d272c
commit 87e23d3df7
30 changed files with 564 additions and 169 deletions

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../services.dart';
import 'dishCard.dart';
import 'package:menui_mobile/localizations.dart';
class DishList extends StatelessWidget {
final String id;
@@ -68,14 +69,14 @@ class DishList extends StatelessWidget {
elevation: 5,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25)),
color: Colors.grey[900],
color: Colors.orange,
icon: Icon(
Icons.keyboard_arrow_down_rounded,
color: Colors.orange,
color: Colors.grey[900],
),
label: Text(
"Zwiń",
style: TextStyle(color: Colors.white),
AppLocalizations.instance.text("hideDishes"),
style: TextStyle(color: Colors.grey[900]),
),
onPressed: () => Navigator.pop(context),
)))

View File

@@ -8,6 +8,7 @@ import '../settings.dart';
import 'homeScreen.dart';
import 'package:share/share.dart';
import 'menuiButton.dart';
import 'package:menui_mobile/localizations.dart';
class DishView extends StatelessWidget {
final Dish dish;
@@ -19,7 +20,7 @@ class DishView extends StatelessWidget {
duration: Duration(seconds: 2),
behavior: SnackBarBehavior.floating,
content: Text(
"Dodano do zamówienia :)",
AppLocalizations.instance.text("addedToOrder"),
style: TextStyle(color: Colors.grey[850]),
),
);
@@ -86,7 +87,7 @@ class DishView extends StatelessWidget {
if (dish.allergens.hasAllergens()) SizedBox(height: 8),
if (dish.allergens.hasAllergens())
Text(
'Może zawierać',
AppLocalizations.instance.text("mayContain"),
style: TextStyle(color: Colors.orange, fontSize: 14),
),
Allergens(allergens: dish.allergens),
@@ -110,7 +111,7 @@ class DishView extends StatelessWidget {
height: 6,
),
Text(
'Składniki',
AppLocalizations.instance.text("ingredients"),
style: TextStyle(color: Colors.orange, fontSize: 14),
),
SizedBox(
@@ -139,7 +140,7 @@ class DishView extends StatelessWidget {
children: <Widget>[
IconChip(
icon: Icons.battery_charging_full,
leading: "Wartość energetyczna",
leading: AppLocalizations.instance.text("energy"),
value: (() {
if (dish.kCal != "") {
return dish.kCal + " kcal";
@@ -149,7 +150,8 @@ class DishView extends StatelessWidget {
}())),
IconChip(
icon: Icons.cake,
leading: "Indeks glikemiczny",
leading:
AppLocalizations.instance.text("glicemicIndex"),
value: dish.glicemicIndex),
],
),
@@ -158,7 +160,7 @@ class DishView extends StatelessWidget {
),
if (dish.notes != "")
Text(
'Uwagi',
AppLocalizations.instance.text("notes"),
style: TextStyle(color: Colors.orange, fontSize: 14),
),
SizedBox(
@@ -181,7 +183,7 @@ class DishView extends StatelessWidget {
width: 6,
),
Text(
'Danie wegańskie',
AppLocalizations.instance.text("dishVegan"),
style:
TextStyle(color: Colors.grey[200], fontSize: 12),
),
@@ -199,17 +201,17 @@ class DishView extends StatelessWidget {
width: 6,
),
Text(
'Danie wegetariańskie',
AppLocalizations.instance.text("dishVegetarian"),
style:
TextStyle(color: Colors.grey[200], fontSize: 12),
),
],
),
SizedBox(
height: 120,
)
],
),
SizedBox(
height: 28,
)
],
)),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
@@ -221,28 +223,28 @@ class DishView extends StatelessWidget {
MenuiButton(
color: Colors.orange,
icon: Icons.home_rounded,
text: "Szukaj",
text: AppLocalizations.instance.text("search"),
onPressed: () => Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.note_rounded,
text: "Zamównienie",
text: AppLocalizations.instance.text("order"),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.favorite_rounded,
text: "Ulubione",
text: AppLocalizations.instance.text("favorites"),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => FavoritesView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.settings,
text: "Ustawienia",
text: AppLocalizations.instance.text("settings"),
onPressed: () {
showSettings(context, settings);
},
@@ -263,14 +265,14 @@ class DishView extends StatelessWidget {
MenuiButton(
color: Colors.grey,
icon: Icons.share_rounded,
text: "Udostępnij",
text: AppLocalizations.instance.text("share"),
onPressed: () => Share.share('https://www.menui.pl/dish/${dish.id}',
subject: '${dish.name}'),
),
MenuiButton(
color: Colors.grey,
icon: Icons.note_add_rounded,
text: "Do zamówienia",
text: AppLocalizations.instance.text("addToOrder"),
onPressed: () {
showDialog(
context: context,
@@ -319,7 +321,7 @@ class AddToOrderDialogState extends State<AddToOrderDialog> {
Widget build(BuildContext context) {
return SimpleDialog(
title: Text(
'Dodaj do zamówienia',
AppLocalizations.instance.text("addToOrder"),
style: TextStyle(color: Colors.white, fontSize: 16),
textAlign: TextAlign.center,
),
@@ -327,7 +329,7 @@ class AddToOrderDialogState extends State<AddToOrderDialog> {
backgroundColor: Colors.grey[850],
children: [
Text(
'Ilość',
AppLocalizations.instance.text("quantity"),
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey),
),
@@ -370,7 +372,7 @@ class AddToOrderDialogState extends State<AddToOrderDialog> {
Padding(
padding: EdgeInsets.only(bottom: 8),
child: Text(
'Wariant',
AppLocalizations.instance.text("variant"),
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey),
),
@@ -521,7 +523,9 @@ class AddToOrderDialogState extends State<AddToOrderDialog> {
priceName: priceName));
widget.onSubmit();
},
child: Text('Dodaj'),
child: Text(
AppLocalizations.instance.text("add"),
),
),
),
)

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../settings.dart';
import 'menuiButton.dart';
import 'package:menui_mobile/localizations.dart';
class FavoriteButton extends StatefulWidget {
final String id;
@@ -33,7 +34,7 @@ class _FavoriteButtonState extends State<FavoriteButton> {
return MenuiButton(
color: Colors.orange,
icon: Icons.favorite_rounded,
text: "Usuń",
text: AppLocalizations.instance.text("remove"),
onPressed: () {
settings.addToFavorites(widget.id);
setState(() {
@@ -45,7 +46,7 @@ class _FavoriteButtonState extends State<FavoriteButton> {
return MenuiButton(
color: Colors.grey,
icon: Icons.favorite_rounded,
text: "Dodaj",
text: AppLocalizations.instance.text("add"),
onPressed: () {
settings.addToFavorites(widget.id);
setState(() {
@@ -58,7 +59,7 @@ class _FavoriteButtonState extends State<FavoriteButton> {
return MenuiButton(
color: Colors.grey,
icon: Icons.favorite_rounded,
text: "Dodaj",
text: AppLocalizations.instance.text("add"),
onPressed: () {},
);
}

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:menui_mobile/components/restaurantCardAsync.dart';
import 'package:menui_mobile/localizations.dart';
import '../settings.dart';
import 'homeScreen.dart';
import 'orderView.dart';
@@ -28,7 +29,7 @@ class _FavoritesViewState extends State<FavoritesView> {
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("img/bg_tile.jpg"), fit: BoxFit.cover)),
image: AssetImage("img/bg.png"), fit: BoxFit.cover)),
child: FutureBuilder(
future: favorites,
builder: (context, snapshot) {
@@ -59,27 +60,27 @@ class _FavoritesViewState extends State<FavoritesView> {
MenuiButton(
color: Colors.orange,
icon: Icons.home_rounded,
text: "Szukaj",
text: AppLocalizations.instance.text('search'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => HomePage())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.note_rounded,
text: "Zamównienie",
text: AppLocalizations.instance.text('order'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.favorite_rounded,
text: "Ulubione",
text: AppLocalizations.instance.text('favorites'),
onPressed: () {},
),
MenuiButton(
color: Colors.orange,
icon: Icons.settings,
text: "Ustawienia",
text: AppLocalizations.instance.text('settings'),
onPressed: () {
showSettings(context, settings);
},
@@ -89,7 +90,7 @@ class _FavoritesViewState extends State<FavoritesView> {
),
appBar: AppBar(
title: Text(
'Ulubione',
AppLocalizations.instance.text('favorites'),
style: TextStyle(color: Colors.white, fontWeight: FontWeight.w400),
),
backgroundColor: Colors.grey[900],

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:menui_mobile/services.dart';
import 'package:menui_mobile/localizations.dart';
enum Tags {
cardPayments,
@@ -96,7 +97,7 @@ class RestaurantFilters extends StatelessWidget {
Padding(
padding: EdgeInsets.all(8),
child: Text(
'Rodzaj kuchni',
AppLocalizations.instance.text('typeOfFood'),
style: TextStyle(color: Colors.orange),
),
),
@@ -132,7 +133,7 @@ class RestaurantFilters extends StatelessWidget {
Padding(
padding: EdgeInsets.all(8),
child: Text(
'Tagi',
AppLocalizations.instance.text('tags'),
style: TextStyle(color: Colors.orange),
),
),
@@ -141,49 +142,49 @@ class RestaurantFilters extends StatelessWidget {
runSpacing: -12,
children: [
RestaurantTag(
name: "Płatność kartą",
name: AppLocalizations.instance.text('cardPayments'),
img: 'img/i_card_black.png',
onTapped: () => onSelectTag(Tags.cardPayments),
filters: filters,
filterTag: Tags.cardPayments,
),
RestaurantTag(
name: "Lubimy zwierzaki",
name: AppLocalizations.instance.text('pets'),
img: 'img/i_pets_black.png',
onTapped: () => onSelectTag(Tags.petFriendly),
filters: filters,
filterTag: Tags.petFriendly,
),
RestaurantTag(
name: "Bez glutenu",
name: AppLocalizations.instance.text('glutenFree'),
img: 'img/i_glutenFree_black.png',
onTapped: () => onSelectTag(Tags.glutenFree),
filters: filters,
filterTag: Tags.glutenFree,
),
RestaurantTag(
name: "Wegańskie",
name: AppLocalizations.instance.text('vegan'),
img: 'img/i_vegan_black.png',
onTapped: () => onSelectTag(Tags.vegan),
filters: filters,
filterTag: Tags.vegan,
),
RestaurantTag(
name: "Wegetariańskie",
name: AppLocalizations.instance.text('vegetarian'),
img: 'img/i_vegetarian_black.png',
onTapped: () => onSelectTag(Tags.vegetarian),
filters: filters,
filterTag: Tags.vegetarian,
),
RestaurantTag(
name: "Alkohol",
name: AppLocalizations.instance.text('alcohol'),
img: 'img/i_alcohol_black.png',
onTapped: () => onSelectTag(Tags.alcohol),
filters: filters,
filterTag: Tags.alcohol,
),
RestaurantTag(
name: "Dowozimy",
name: AppLocalizations.instance.text('delivery'),
img: 'img/i_delivery_black.png',
onTapped: () => onSelectTag(Tags.delivery),
filters: filters,

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:menui_mobile/localizations.dart';
import 'searchBar.dart';
import '../settings.dart';
import 'mapView.dart';
@@ -11,11 +12,12 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
settings.initLanguage(context);
return Scaffold(
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("img/bg_tile.jpg"), fit: BoxFit.cover)),
image: AssetImage("img/bg.png"), fit: BoxFit.cover)),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -26,7 +28,7 @@ class HomePage extends StatelessWidget {
),
MenuiSearchBar(''),
Text(
'lub',
AppLocalizations.instance.text('or'),
style: TextStyle(color: Colors.grey[500]),
),
RaisedButton.icon(
@@ -38,7 +40,7 @@ class HomePage extends StatelessWidget {
color: Colors.orange,
),
label: Text(
'Pokaż w pobliżu',
AppLocalizations.instance.text('geosearch'),
style: TextStyle(color: Colors.grey[300]),
),
shape: RoundedRectangleBorder(
@@ -57,27 +59,27 @@ class HomePage extends StatelessWidget {
MenuiButton(
color: Colors.orange,
icon: Icons.home_rounded,
text: "Szukaj",
text: AppLocalizations.instance.text('search'),
onPressed: () {},
),
MenuiButton(
color: Colors.orange,
icon: Icons.note_rounded,
text: "Zamównienie",
text: AppLocalizations.instance.text('order'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.favorite_rounded,
text: "Ulubione",
text: AppLocalizations.instance.text('favorites'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => FavoritesView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.settings,
text: "Ustawienia",
text: AppLocalizations.instance.text('settings'),
onPressed: () {
showSettings(context, settings);
},

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import '../services.dart';
import 'package:menui_mobile/localizations.dart';
class Allergens extends StatelessWidget {
final MenuiAllergens allergens;
@@ -32,7 +33,7 @@ class Allergens extends StatelessWidget {
height: 26,
),
Text(
'Jaja',
AppLocalizations.instance.text('eggs'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -53,7 +54,7 @@ class Allergens extends StatelessWidget {
height: 26,
),
Text(
'Gluten',
AppLocalizations.instance.text('gluten'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -74,7 +75,7 @@ class Allergens extends StatelessWidget {
height: 26,
),
Text(
'Laktoza',
AppLocalizations.instance.text('lactose'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -95,7 +96,7 @@ class Allergens extends StatelessWidget {
height: 26,
),
Text(
'Orzechy',
AppLocalizations.instance.text('peanuts'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -116,7 +117,7 @@ class Allergens extends StatelessWidget {
height: 26,
),
Text(
'Owoce morza',
AppLocalizations.instance.text('seaFood'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -137,7 +138,7 @@ class Allergens extends StatelessWidget {
height: 26,
),
Text(
'Sezam',
AppLocalizations.instance.text('sesame'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -158,7 +159,7 @@ class Allergens extends StatelessWidget {
height: 26,
),
Text(
'Soja',
AppLocalizations.instance.text('soy'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'filters.dart';
import 'package:menui_mobile/localizations.dart';
class LineOfIcons extends StatelessWidget {
final List<Tags> tags;
@@ -32,7 +33,7 @@ class LineOfIcons extends StatelessWidget {
height: 26,
),
Text(
'Alkohol',
AppLocalizations.instance.text('alcohol'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -54,12 +55,12 @@ class LineOfIcons extends StatelessWidget {
height: 26,
),
Text(
'Płatność',
AppLocalizations.instance.text('cardPayments1'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
),
Text(
'kar',
AppLocalizations.instance.text('cardPayments2'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -80,7 +81,7 @@ class LineOfIcons extends StatelessWidget {
height: 26,
),
Text(
'Dowozimy',
AppLocalizations.instance.text('delivery'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -101,7 +102,7 @@ class LineOfIcons extends StatelessWidget {
height: 26,
),
Text(
'Bezglutenowe',
AppLocalizations.instance.text('glutenFree'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -122,12 +123,12 @@ class LineOfIcons extends StatelessWidget {
height: 26,
),
Text(
'Lubimy',
AppLocalizations.instance.text('pets1'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
),
Text(
'zwierzaczki',
AppLocalizations.instance.text('pets2'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -148,7 +149,7 @@ class LineOfIcons extends StatelessWidget {
height: 26,
),
Text(
'Wegańskie',
AppLocalizations.instance.text('vegan'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)
@@ -169,7 +170,7 @@ class LineOfIcons extends StatelessWidget {
height: 26,
),
Text(
'Wegetariańskie',
AppLocalizations.instance.text('vegetarian'),
style:
TextStyle(fontSize: fontSize, color: Colors.grey[300]),
)

View File

@@ -9,6 +9,7 @@ import 'restaurantView.dart';
import 'menuiButton.dart';
import 'orderView.dart';
import 'favoritesView.dart';
import 'package:menui_mobile/localizations.dart';
class MapView extends StatefulWidget {
@override
@@ -78,7 +79,8 @@ class MapViewState extends State<MapView> with SingleTickerProviderStateMixin {
builder: (context) =>
RestaurantView(id: thisRestaurant.id))),
title: '${thisRestaurant.name}',
snippet: 'Kuchnia: ${thisRestaurant.type}'));
snippet:
'${AppLocalizations.instance.text('type')} ${thisRestaurant.type}'));
markers[markerId] = marker;
}
}
@@ -157,7 +159,7 @@ class MapViewState extends State<MapView> with SingleTickerProviderStateMixin {
color: Colors.orange,
),
Text(
'Promień',
AppLocalizations.instance.text("radius"),
style: TextStyle(
color: Colors.grey[200],
fontSize: 11,
@@ -198,7 +200,7 @@ class MapViewState extends State<MapView> with SingleTickerProviderStateMixin {
color: Colors.orange,
),
Text(
'Filtry',
AppLocalizations.instance.text("filter"),
style: TextStyle(
color: Colors.grey[200],
fontSize: 11,
@@ -254,7 +256,7 @@ class MapViewState extends State<MapView> with SingleTickerProviderStateMixin {
color: Colors.orange,
),
Text(
'Znaleziono: ${data.markers.length}',
'${AppLocalizations.instance.text('foundCounter')} ${data.markers.length}',
style:
TextStyle(color: Colors.white, fontSize: 12),
),
@@ -282,13 +284,13 @@ class MapViewState extends State<MapView> with SingleTickerProviderStateMixin {
MenuiButton(
color: Colors.orange,
icon: Icons.home_rounded,
text: "Szukaj",
text: AppLocalizations.instance.text("search"),
onPressed: () => Navigator.pop(context),
),
MenuiButton(
color: Colors.orange,
icon: Icons.note_rounded,
text: "Zamównienie",
text: AppLocalizations.instance.text("order"),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
@@ -297,7 +299,7 @@ class MapViewState extends State<MapView> with SingleTickerProviderStateMixin {
MenuiButton(
color: Colors.orange,
icon: Icons.favorite_rounded,
text: "Ulubione",
text: AppLocalizations.instance.text("favorites"),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
@@ -306,7 +308,7 @@ class MapViewState extends State<MapView> with SingleTickerProviderStateMixin {
MenuiButton(
color: Colors.orange,
icon: Icons.settings,
text: "Ustawienia",
text: AppLocalizations.instance.text("settings"),
onPressed: () {
showSettings(context, settings);
},
@@ -321,7 +323,7 @@ class MapViewState extends State<MapView> with SingleTickerProviderStateMixin {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [Text("Błąd...")],
children: [Text(AppLocalizations.instance.text("error"))],
),
);
} else {
@@ -342,7 +344,7 @@ class MapViewState extends State<MapView> with SingleTickerProviderStateMixin {
Padding(
padding: EdgeInsets.only(top: 16),
child: Text(
'Szukam restauracji...',
AppLocalizations.instance.text("searching"),
style: TextStyle(color: Colors.grey[200]),
),
)

View File

@@ -4,6 +4,7 @@ import '../settings.dart';
import 'homeScreen.dart';
import 'favoritesView.dart';
import 'menuiButton.dart';
import 'package:menui_mobile/localizations.dart';
class OrderView extends StatefulWidget {
final settings = new MenuiSettings();
@@ -19,7 +20,7 @@ class OrderViewState extends State<OrderView> {
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("img/bg_tile.jpg"), fit: BoxFit.cover)),
image: AssetImage("img/bg.png"), fit: BoxFit.cover)),
child: Column(
children: <Widget>[
FutureBuilder(
@@ -48,7 +49,7 @@ class OrderViewState extends State<OrderView> {
child: Padding(
padding: EdgeInsets.only(top: 50),
child: Text(
"Zamówienie jest puste.",
AppLocalizations.instance.text('orderEmpty'),
style: TextStyle(color: Colors.grey),
),
)),
@@ -75,27 +76,27 @@ class OrderViewState extends State<OrderView> {
MenuiButton(
color: Colors.orange,
icon: Icons.home_rounded,
text: "Szukaj",
text: AppLocalizations.instance.text('search'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => HomePage())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.note_rounded,
text: "Zamównienie",
text: AppLocalizations.instance.text('order'),
onPressed: () {},
),
MenuiButton(
color: Colors.orange,
icon: Icons.favorite_rounded,
text: "Ulubione",
text: AppLocalizations.instance.text('favorites'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => FavoritesView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.settings,
text: "Ustawienia",
text: AppLocalizations.instance.text('settings'),
onPressed: () {
showSettings(context, widget.settings);
},
@@ -105,7 +106,7 @@ class OrderViewState extends State<OrderView> {
),
appBar: AppBar(
title: Text(
'Zamówienie',
AppLocalizations.instance.text('order'),
style: TextStyle(color: Colors.white, fontWeight: FontWeight.w400),
),
backgroundColor: Colors.grey[900],
@@ -123,7 +124,7 @@ class OrderViewState extends State<OrderView> {
widget.settings.clearOrder();
setState(() {});
},
text: "Wyczyść",
text: AppLocalizations.instance.text('clear'),
icon: Icons.delete_forever_rounded,
),
],

View File

@@ -6,6 +6,7 @@ import 'orderView.dart';
import 'favoritesView.dart';
import 'homeScreen.dart';
import 'menuiButton.dart';
import 'package:menui_mobile/localizations.dart';
class RestaurantMapView extends StatefulWidget {
final List coordinates;
@@ -35,7 +36,9 @@ class RestaurantMapViewState extends State<RestaurantMapView> {
markerId: markerId,
position: LatLng(widget.coordinates[0], widget.coordinates[1]),
infoWindow: InfoWindow(
title: '${widget.name}', snippet: 'Kuchnia: ${widget.type}'));
title: '${widget.name}',
snippet:
'${AppLocalizations.instance.text('type')} ${widget.type}'));
setState(() {
markers[MarkerId("restaurant-marker")] = marker;
});
@@ -58,28 +61,28 @@ class RestaurantMapViewState extends State<RestaurantMapView> {
MenuiButton(
color: Colors.orange,
icon: Icons.home_rounded,
text: "Szukaj",
text: AppLocalizations.instance.text('search'),
onPressed: () => Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.note_rounded,
text: "Zamównienie",
text: AppLocalizations.instance.text('order'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.favorite_rounded,
text: "Ulubione",
text: AppLocalizations.instance.text('favorites'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => FavoritesView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.settings,
text: "Ustawienia",
text: AppLocalizations.instance.text('settings'),
onPressed: () {
showSettings(context, settings);
},

View File

@@ -11,6 +11,7 @@ import 'homeScreen.dart';
import 'package:share/share.dart';
import 'favoriteButton.dart';
import 'menuiButton.dart';
import 'package:menui_mobile/localizations.dart';
class RestaurantView extends StatefulWidget {
final String id;
@@ -118,7 +119,7 @@ class _RestaurantViewState extends State<RestaurantView> {
height: 8,
),
Text(
'Informacje',
AppLocalizations.instance.text('info'),
style: TextStyle(
color: Colors.orange, fontSize: 14),
),
@@ -126,23 +127,26 @@ class _RestaurantViewState extends State<RestaurantView> {
height: 6,
),
MenuiDoubleColorText(
leading: 'Kuchnia: ',
leading:
'${AppLocalizations.instance.text('type')} ',
following: '${restaurant.type}',
),
MenuiDoubleColorText(
leading: 'Adres: ',
leading:
'${AppLocalizations.instance.text('adress')} ',
following:
'${restaurant.city}, ${restaurant.adress}',
),
MenuiDoubleColorText(
leading: 'Kontakt: ',
leading:
'${AppLocalizations.instance.text('contact')} ',
following: '${restaurant.phone}',
),
SizedBox(
height: 12,
),
Text(
'Godziny otwarcia',
AppLocalizations.instance.text('hours'),
style: TextStyle(
color: Colors.orange, fontSize: 14),
),
@@ -155,7 +159,7 @@ class _RestaurantViewState extends State<RestaurantView> {
height: 12,
),
Text(
'Social media',
AppLocalizations.instance.text('social'),
style: TextStyle(
color: Colors.orange, fontSize: 14),
),
@@ -170,7 +174,7 @@ class _RestaurantViewState extends State<RestaurantView> {
),
),
SizedBox(
height: 80,
height: 120,
)
],
)
@@ -192,14 +196,14 @@ class _RestaurantViewState extends State<RestaurantView> {
elevation: 5,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25)),
color: Colors.grey[900],
color: Colors.orange,
icon: Icon(
Icons.keyboard_arrow_up_rounded,
color: Colors.orange,
color: Colors.grey[900],
),
label: Text(
"Karta dań",
style: TextStyle(color: Colors.white),
AppLocalizations.instance.text('showDishes'),
style: TextStyle(color: Colors.grey[900]),
),
onPressed: () =>
showMenu(context, restaurant.categories),
@@ -215,7 +219,7 @@ class _RestaurantViewState extends State<RestaurantView> {
MenuiButton(
color: Colors.orange,
icon: Icons.home_rounded,
text: "Szukaj",
text: AppLocalizations.instance.text('search'),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
@@ -224,7 +228,7 @@ class _RestaurantViewState extends State<RestaurantView> {
MenuiButton(
color: Colors.orange,
icon: Icons.note_rounded,
text: "Zamównienie",
text: AppLocalizations.instance.text('order'),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
@@ -233,7 +237,7 @@ class _RestaurantViewState extends State<RestaurantView> {
MenuiButton(
color: Colors.orange,
icon: Icons.favorite_rounded,
text: "Ulubione",
text: AppLocalizations.instance.text('favorites'),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
@@ -242,7 +246,7 @@ class _RestaurantViewState extends State<RestaurantView> {
MenuiButton(
color: Colors.orange,
icon: Icons.settings,
text: "Ustawienia",
text: AppLocalizations.instance.text('settings'),
onPressed: () {
showSettings(context, settings);
},
@@ -265,7 +269,7 @@ class _RestaurantViewState extends State<RestaurantView> {
MenuiButton(
color: Colors.grey,
icon: Icons.map_rounded,
text: "Mapa",
text: AppLocalizations.instance.text('map'),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
@@ -278,7 +282,7 @@ class _RestaurantViewState extends State<RestaurantView> {
MenuiButton(
color: Colors.grey,
icon: Icons.share_rounded,
text: "Udostępnij",
text: AppLocalizations.instance.text('share'),
onPressed: () => Share.share(
'https://www.menui.pl/restaurant/${restaurant.id}',
subject: '${restaurant.name}'),
@@ -350,7 +354,7 @@ class WorkingHoursDay extends StatelessWidget {
String formatTodayHours(String hours) {
if (hours == "") {
return 'nieczynne';
return AppLocalizations.instance.text('closed');
} else {
return hours;
}
@@ -412,13 +416,20 @@ class WorkingHoursList extends StatelessWidget {
runSpacing: 8.0,
alignment: WrapAlignment.center,
children: <Widget>[
WorkingHoursDay('Pn', workingHours.pn, 1),
WorkingHoursDay('Wt', workingHours.wt, 2),
WorkingHoursDay('Śr', workingHours.sr, 3),
WorkingHoursDay('Cz', workingHours.cz, 4),
WorkingHoursDay('Pt', workingHours.pt, 5),
WorkingHoursDay('So', workingHours.sb, 6),
WorkingHoursDay('Nd', workingHours.nd, 7),
WorkingHoursDay(
AppLocalizations.instance.text('mo'), workingHours.pn, 1),
WorkingHoursDay(
AppLocalizations.instance.text('tu'), workingHours.wt, 2),
WorkingHoursDay(
AppLocalizations.instance.text('we'), workingHours.sr, 3),
WorkingHoursDay(
AppLocalizations.instance.text('th'), workingHours.cz, 4),
WorkingHoursDay(
AppLocalizations.instance.text('fr'), workingHours.pt, 5),
WorkingHoursDay(
AppLocalizations.instance.text('sa'), workingHours.sb, 6),
WorkingHoursDay(
AppLocalizations.instance.text('su'), workingHours.nd, 7),
],
);
}

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../services.dart';
import 'searchResults.dart';
import 'package:menui_mobile/localizations.dart';
class MenuiSearchBar extends StatefulWidget {
final String initialValue;
@@ -82,7 +83,7 @@ class MenuiSearchBarState extends State<MenuiSearchBar> {
return OverlayEntry(
builder: (context) => GestureDetector(
behavior: HitTestBehavior.translucent,
behavior: HitTestBehavior.opaque,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
@@ -162,22 +163,28 @@ class MenuiSearchBarState extends State<MenuiSearchBar> {
padding:
const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
child: TextFormField(
onFieldSubmitted: (text) => searchRestaurantsByString(),
controller: _controller,
style: TextStyle(color: Colors.orange, fontSize: 14),
decoration: InputDecoration(
hintStyle: TextStyle(color: Colors.grey),
filled: true,
fillColor: Colors.grey[900],
hintStyle: TextStyle(color: Colors.grey[200]),
enabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.grey, width: 1.0),
BorderSide(color: Colors.grey[900], width: 1.0),
borderRadius: BorderRadius.circular(16)),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.orange, width: 2.0),
borderRadius: BorderRadius.circular(20)),
hintText: 'Wyszukaj miasto lub nazwę restauracji.',
suffixIcon: Icon(
Icons.search,
color: Colors.orange,
hintText: AppLocalizations.instance.text('searchbar'),
suffixIcon: IconButton(
onPressed: () => searchRestaurantsByString(),
icon: Icon(
Icons.search,
color: Colors.orange,
),
)),
validator: (value) {
if (value.isEmpty) {

View File

@@ -8,6 +8,7 @@ import 'orderView.dart';
import 'favoritesView.dart';
import '../settings.dart';
import 'filters.dart';
import 'package:menui_mobile/localizations.dart';
class SearchResults extends StatefulWidget {
SearchResults(
@@ -67,7 +68,7 @@ class _SearchResultsState extends State<SearchResults>
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("img/bg_tile.jpg"), fit: BoxFit.cover)),
image: AssetImage("img/bg.png"), fit: BoxFit.cover)),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
@@ -138,28 +139,28 @@ class _SearchResultsState extends State<SearchResults>
MenuiButton(
color: Colors.orange,
icon: Icons.home_rounded,
text: "Szukaj",
text: AppLocalizations.instance.text('search'),
onPressed: () => Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.note_rounded,
text: "Zamównienie",
text: AppLocalizations.instance.text('order'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.favorite_rounded,
text: "Ulubione",
text: AppLocalizations.instance.text('favorites'),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => FavoritesView())),
),
MenuiButton(
color: Colors.orange,
icon: Icons.settings,
text: "Ustawienia",
text: AppLocalizations.instance.text('settings'),
onPressed: () {
showSettings(context, widget.settings);
},
@@ -169,7 +170,7 @@ class _SearchResultsState extends State<SearchResults>
),
appBar: AppBar(
title: Text(
'Znaleziono: ${filteredRestaurants.length}',
'${AppLocalizations.instance.text('foundCounter')} ${filteredRestaurants.length}',
style: TextStyle(
color: Colors.white, fontSize: 14, fontWeight: FontWeight.w400),
),
@@ -185,7 +186,7 @@ class _SearchResultsState extends State<SearchResults>
MenuiButton(
color: Colors.grey,
icon: Icons.filter_alt_rounded,
text: "Filtruj",
text: AppLocalizations.instance.text('filter'),
onPressed: () {
setState(() {
expand = !expand;