visual improvements / icons wrap / hours wrap / autocomplete fix
This commit is contained in:
@@ -10,146 +10,224 @@ class DishView extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Container(
|
body: Container(
|
||||||
decoration: BoxDecoration(color: Colors.grey[850]),
|
decoration: BoxDecoration(color: Colors.grey[850]),
|
||||||
child: Column(
|
child: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Column(
|
||||||
decoration: BoxDecoration(
|
children: <Widget>[
|
||||||
image: DecorationImage(
|
Container(
|
||||||
image: NetworkImage(
|
decoration: BoxDecoration(
|
||||||
dish.imgUrl,
|
image: DecorationImage(
|
||||||
|
image: NetworkImage(
|
||||||
|
dish.imgUrl,
|
||||||
|
),
|
||||||
|
fit: BoxFit.cover),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
height: 160,
|
||||||
|
width: double.infinity,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey[850],
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.all(Radius.circular(8))),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(
|
||||||
|
Icons.restaurant,
|
||||||
|
color: Colors.orange,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 8,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
dish.name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24,
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.w300),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.all(12),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
fit: BoxFit.cover),
|
SizedBox(
|
||||||
),
|
height: 6,
|
||||||
child: Column(
|
),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
if (dish.allergens.hasAllergens()) SizedBox(height: 8),
|
||||||
children: <Widget>[
|
if (dish.allergens.hasAllergens())
|
||||||
SizedBox(
|
Text(
|
||||||
height: 160,
|
'Może zawierać',
|
||||||
width: double.infinity,
|
style: TextStyle(color: Colors.orange, fontSize: 14),
|
||||||
),
|
),
|
||||||
Container(
|
Allergens(allergens: dish.allergens),
|
||||||
padding: EdgeInsets.all(12),
|
if (dish.allergens.hasAllergens())
|
||||||
decoration: BoxDecoration(
|
Divider(
|
||||||
color: Colors.grey[850],
|
height: 14,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8))),
|
thickness: 4,
|
||||||
child: Row(
|
),
|
||||||
mainAxisSize: MainAxisSize.min,
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
Prices(prices: dish.prices),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 14,
|
||||||
|
thickness: 4,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 6,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Składniki',
|
||||||
|
style: TextStyle(color: Colors.orange, fontSize: 14),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||||
|
child: Text(
|
||||||
|
'${dish.ingredients}',
|
||||||
|
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 6,
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 14,
|
||||||
|
thickness: 4,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 6,
|
||||||
|
),
|
||||||
|
Wrap(
|
||||||
|
spacing: 10,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(
|
IconChip(
|
||||||
Icons.restaurant,
|
icon: Icons.battery_charging_full,
|
||||||
color: Colors.orange,
|
leading: "Wartość energetyczna",
|
||||||
),
|
value: (() {
|
||||||
SizedBox(
|
if (dish.kCal != "") {
|
||||||
width: 8,
|
return dish.kCal + " kcal";
|
||||||
),
|
} else {
|
||||||
Text(
|
return "";
|
||||||
dish.name,
|
}
|
||||||
style: TextStyle(
|
}())),
|
||||||
fontSize: 24,
|
IconChip(
|
||||||
color: Colors.white,
|
icon: Icons.cake,
|
||||||
fontWeight: FontWeight.w300),
|
leading: "Indeks glikemiczny",
|
||||||
),
|
value: dish.glicemicIndex),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
margin: EdgeInsets.all(12),
|
SizedBox(
|
||||||
)
|
height: 12,
|
||||||
],
|
),
|
||||||
),
|
if (dish.notes != "")
|
||||||
),
|
Text(
|
||||||
SizedBox(height: 8),
|
'Uwagi',
|
||||||
Text(
|
style: TextStyle(color: Colors.orange, fontSize: 14),
|
||||||
'Może zawierać',
|
),
|
||||||
style: TextStyle(color: Colors.orange, fontSize: 14),
|
SizedBox(
|
||||||
),
|
height: 12,
|
||||||
Allergens(allergens: dish.allergens),
|
),
|
||||||
Divider(
|
if (dish.notes != "")
|
||||||
height: 14,
|
Text(
|
||||||
thickness: 4,
|
'${dish.notes}',
|
||||||
),
|
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
||||||
SizedBox(
|
),
|
||||||
height: 8,
|
if (dish.vegan)
|
||||||
),
|
Row(
|
||||||
Prices(prices: dish.prices),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
SizedBox(
|
children: [
|
||||||
height: 8,
|
Icon(
|
||||||
),
|
Icons.info_rounded,
|
||||||
Divider(
|
color: Colors.grey,
|
||||||
height: 14,
|
),
|
||||||
thickness: 4,
|
SizedBox(
|
||||||
),
|
width: 6,
|
||||||
SizedBox(
|
),
|
||||||
height: 6,
|
Text(
|
||||||
),
|
'Danie wegańskie',
|
||||||
Text(
|
style: TextStyle(
|
||||||
'Składniki',
|
color: Colors.grey[200], fontSize: 12),
|
||||||
style: TextStyle(color: Colors.orange, fontSize: 14),
|
),
|
||||||
),
|
],
|
||||||
SizedBox(
|
),
|
||||||
height: 12,
|
if (dish.vegetarian)
|
||||||
),
|
Row(
|
||||||
Text(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
'${dish.ingredients}',
|
children: [
|
||||||
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
Icon(
|
||||||
),
|
Icons.info_rounded,
|
||||||
SizedBox(
|
color: Colors.grey,
|
||||||
height: 6,
|
),
|
||||||
),
|
SizedBox(
|
||||||
Divider(
|
width: 6,
|
||||||
height: 14,
|
),
|
||||||
thickness: 4,
|
Text(
|
||||||
),
|
'Danie wegetariańskie',
|
||||||
SizedBox(
|
style: TextStyle(
|
||||||
height: 6,
|
color: Colors.grey[200], fontSize: 12),
|
||||||
),
|
),
|
||||||
Wrap(
|
],
|
||||||
spacing: 10,
|
),
|
||||||
children: <Widget>[
|
],
|
||||||
IconChip(
|
),
|
||||||
icon: Icons.battery_charging_full,
|
SizedBox(
|
||||||
leading: "Wartość energetyczna",
|
height: 28,
|
||||||
value: dish.kCal),
|
)
|
||||||
IconChip(
|
|
||||||
icon: Icons.cake,
|
|
||||||
leading: "Indeks glikemiczny",
|
|
||||||
value: dish.glicemicIndex),
|
|
||||||
],
|
],
|
||||||
),
|
)),
|
||||||
SizedBox(
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||||
height: 12,
|
floatingActionButton: Stack(
|
||||||
),
|
children: <Widget>[
|
||||||
Text(
|
Align(
|
||||||
'Uwagi',
|
alignment: Alignment.bottomLeft,
|
||||||
style: TextStyle(color: Colors.orange, fontSize: 14),
|
child: Padding(
|
||||||
),
|
padding: EdgeInsets.only(left: 18),
|
||||||
SizedBox(
|
child: FloatingActionButton(
|
||||||
height: 12,
|
heroTag: null,
|
||||||
),
|
backgroundColor: Colors.grey[900],
|
||||||
if (dish.notes == "")
|
child: Icon(
|
||||||
Text(
|
Icons.arrow_back_rounded,
|
||||||
'---',
|
color: Colors.orange,
|
||||||
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
),
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
if (dish.notes != "")
|
),
|
||||||
Text(
|
Align(
|
||||||
'${dish.notes}',
|
alignment: Alignment.bottomRight,
|
||||||
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
child: Padding(
|
||||||
),
|
padding: EdgeInsets.only(right: 18),
|
||||||
if (dish.vegan)
|
child: FloatingActionButton(
|
||||||
Text(
|
heroTag: null,
|
||||||
'Danie wegańskie',
|
backgroundColor: Colors.grey[900],
|
||||||
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
child: Icon(
|
||||||
),
|
Icons.favorite_rounded,
|
||||||
if (dish.vegetarian)
|
color: Colors.orange,
|
||||||
Text(
|
),
|
||||||
'Danie wegetariańskie',
|
onPressed: () {},
|
||||||
style: TextStyle(color: Colors.grey[200], fontSize: 12),
|
),
|
||||||
),
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
));
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +239,7 @@ class Prices extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (prices.price1.priceName == "")
|
if (prices.price1.priceName == "")
|
||||||
Container(
|
Container(
|
||||||
@@ -185,6 +263,7 @@ class Prices extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (prices.price1.priceName != "")
|
if (prices.price1.priceName != "")
|
||||||
Container(
|
Container(
|
||||||
|
margin: EdgeInsets.all(10),
|
||||||
padding: EdgeInsets.all(12),
|
padding: EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey[800],
|
color: Colors.grey[800],
|
||||||
@@ -209,6 +288,7 @@ class Prices extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (prices.price2.priceName != "")
|
if (prices.price2.priceName != "")
|
||||||
Container(
|
Container(
|
||||||
|
margin: EdgeInsets.all(10),
|
||||||
padding: EdgeInsets.all(12),
|
padding: EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey[800],
|
color: Colors.grey[800],
|
||||||
@@ -233,6 +313,7 @@ class Prices extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (prices.price3.priceName != "")
|
if (prices.price3.priceName != "")
|
||||||
Container(
|
Container(
|
||||||
|
margin: EdgeInsets.all(10),
|
||||||
padding: EdgeInsets.all(12),
|
padding: EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey[800],
|
color: Colors.grey[800],
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class IconChip extends StatelessWidget {
|
|||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
if (value == "")
|
if (value == "")
|
||||||
Text(
|
Text(
|
||||||
'brak danych :(',
|
'-',
|
||||||
style: TextStyle(color: Colors.white, fontSize: 14),
|
style: TextStyle(color: Colors.white, fontSize: 14),
|
||||||
),
|
),
|
||||||
if (value != "")
|
if (value != "")
|
||||||
|
|||||||
@@ -4,16 +4,18 @@ import '../services.dart';
|
|||||||
class Allergens extends StatelessWidget {
|
class Allergens extends StatelessWidget {
|
||||||
final MenuiAllergens allergens;
|
final MenuiAllergens allergens;
|
||||||
final double edgeInsets = 4;
|
final double edgeInsets = 4;
|
||||||
final double imagesWidth = 14;
|
final double imagesWidth = 16;
|
||||||
final double fontSize = 8;
|
final double fontSize = 9;
|
||||||
|
final double maxWidth = 50;
|
||||||
|
|
||||||
Allergens({@required this.allergens});
|
Allergens({@required this.allergens});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return Wrap(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
spacing: 4.0,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
alignment: WrapAlignment.center,
|
||||||
|
direction: Axis.horizontal,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (allergens.eggs == true)
|
if (allergens.eggs == true)
|
||||||
Container(
|
Container(
|
||||||
@@ -21,6 +23,7 @@ class Allergens extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_eggs.png',
|
'img/i_eggs.png',
|
||||||
@@ -41,6 +44,7 @@ class Allergens extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_gluten.png',
|
'img/i_gluten.png',
|
||||||
@@ -61,6 +65,7 @@ class Allergens extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_lactose.png',
|
'img/i_lactose.png',
|
||||||
@@ -81,6 +86,7 @@ class Allergens extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_peanuts.png',
|
'img/i_peanuts.png',
|
||||||
@@ -101,6 +107,7 @@ class Allergens extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_seaFood.png',
|
'img/i_seaFood.png',
|
||||||
@@ -121,6 +128,7 @@ class Allergens extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_sesame.png',
|
'img/i_sesame.png',
|
||||||
@@ -141,6 +149,7 @@ class Allergens extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_soy.png',
|
'img/i_soy.png',
|
||||||
|
|||||||
@@ -4,16 +4,18 @@ import '../services.dart';
|
|||||||
class LineOfIcons extends StatelessWidget {
|
class LineOfIcons extends StatelessWidget {
|
||||||
final MenuiTags tags;
|
final MenuiTags tags;
|
||||||
final double edgeInsets = 4;
|
final double edgeInsets = 4;
|
||||||
final double imagesWidth = 14;
|
final double imagesWidth = 16;
|
||||||
final double fontSize = 8;
|
final double fontSize = 9;
|
||||||
|
final double maxWidth = 50;
|
||||||
|
|
||||||
LineOfIcons({@required this.tags});
|
LineOfIcons({@required this.tags});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return Wrap(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
spacing: 4.0,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
alignment: WrapAlignment.center,
|
||||||
|
direction: Axis.horizontal,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (tags.alcohol == true)
|
if (tags.alcohol == true)
|
||||||
Container(
|
Container(
|
||||||
@@ -21,6 +23,7 @@ class LineOfIcons extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_alcohol.png',
|
'img/i_alcohol.png',
|
||||||
@@ -41,6 +44,8 @@ class LineOfIcons extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
|
width: maxWidth,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_card.png',
|
'img/i_card.png',
|
||||||
@@ -66,6 +71,7 @@ class LineOfIcons extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_delivery.png',
|
'img/i_delivery.png',
|
||||||
@@ -86,6 +92,7 @@ class LineOfIcons extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_glutenFree.png',
|
'img/i_glutenFree.png',
|
||||||
@@ -106,6 +113,7 @@ class LineOfIcons extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_pets.png',
|
'img/i_pets.png',
|
||||||
@@ -131,6 +139,7 @@ class LineOfIcons extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_vegan.png',
|
'img/i_vegan.png',
|
||||||
@@ -151,6 +160,7 @@ class LineOfIcons extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'img/i_vegetarian.png',
|
'img/i_vegetarian.png',
|
||||||
|
|||||||
@@ -16,187 +16,239 @@ class RestaurantView extends StatelessWidget {
|
|||||||
services.fetchAllDishes(id);
|
services.fetchAllDishes(id);
|
||||||
List<String> categories = [];
|
List<String> categories = [];
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Container(
|
body: Container(
|
||||||
decoration: BoxDecoration(color: Colors.grey[850]),
|
decoration: BoxDecoration(color: Colors.grey[850]),
|
||||||
child: FutureBuilder<Restaurant>(
|
child: FutureBuilder<Restaurant>(
|
||||||
future: services.fetchRestaurant(id),
|
future: services.fetchRestaurant(id),
|
||||||
builder:
|
builder:
|
||||||
(BuildContext context, AsyncSnapshot<Restaurant> snapshot) {
|
(BuildContext context, AsyncSnapshot<Restaurant> snapshot) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
final Restaurant restaurant = snapshot.data;
|
final Restaurant restaurant = snapshot.data;
|
||||||
categories = restaurant.categories;
|
categories = restaurant.categories;
|
||||||
return Column(
|
return ListView(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
Column(
|
||||||
children: <Widget>[
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
Container(
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
decoration: BoxDecoration(
|
children: <Widget>[
|
||||||
image: DecorationImage(
|
Container(
|
||||||
image: NetworkImage(
|
decoration: BoxDecoration(
|
||||||
restaurant.imgUrl,
|
image: DecorationImage(
|
||||||
),
|
image: NetworkImage(
|
||||||
fit: BoxFit.cover)),
|
restaurant.imgUrl,
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(
|
|
||||||
height: 160,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.all(12),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.grey[850],
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.all(Radius.circular(8))),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
restaurant.name,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 24,
|
|
||||||
color: Colors.orange,
|
|
||||||
fontWeight: FontWeight.w300),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
restaurant.city,
|
|
||||||
style: TextStyle(color: Colors.grey),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
margin: EdgeInsets.all(12),
|
fit: BoxFit.cover)),
|
||||||
),
|
child: Column(
|
||||||
Container(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
margin: EdgeInsets.only(right: 12),
|
children: <Widget>[
|
||||||
decoration: BoxDecoration(
|
SizedBox(
|
||||||
color: Colors.grey[850],
|
height: 160,
|
||||||
borderRadius: BorderRadius.circular(30)),
|
|
||||||
child: IconButton(
|
|
||||||
icon: Icon(
|
|
||||||
Icons.map,
|
|
||||||
color: Colors.orange,
|
|
||||||
),
|
|
||||||
onPressed: () => Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) =>
|
|
||||||
RestaurantMapView(
|
|
||||||
coordinates:
|
|
||||||
restaurant.coordinates,
|
|
||||||
name: restaurant.name,
|
|
||||||
type: restaurant.type,
|
|
||||||
)))),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(color: Colors.grey[850]),
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
LineOfIcons(
|
|
||||||
tags: restaurant.tags,
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
height: 14,
|
|
||||||
thickness: 4,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
vertical: 4, horizontal: 12),
|
|
||||||
child: Text(
|
|
||||||
restaurant.description,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12, color: Colors.grey[300]),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
Divider(
|
children: <Widget>[
|
||||||
height: 14,
|
Container(
|
||||||
thickness: 4,
|
padding: EdgeInsets.all(12),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
Text(
|
color: Colors.grey[850],
|
||||||
'Informacje',
|
borderRadius: BorderRadius.all(
|
||||||
style:
|
Radius.circular(8))),
|
||||||
TextStyle(color: Colors.orange, fontSize: 14),
|
child: Column(
|
||||||
),
|
crossAxisAlignment:
|
||||||
SizedBox(
|
CrossAxisAlignment.start,
|
||||||
height: 6,
|
children: <Widget>[
|
||||||
),
|
Text(
|
||||||
MenuiDoubleColorText(
|
restaurant.name,
|
||||||
leading: 'Kuchnia: ',
|
style: TextStyle(
|
||||||
following: '${restaurant.type}',
|
fontSize: 24,
|
||||||
),
|
color: Colors.orange,
|
||||||
MenuiDoubleColorText(
|
fontWeight: FontWeight.w300),
|
||||||
leading: 'Adres: ',
|
),
|
||||||
following:
|
Text(
|
||||||
'${restaurant.city}, ${restaurant.adress}',
|
restaurant.city,
|
||||||
),
|
style: TextStyle(color: Colors.grey),
|
||||||
MenuiDoubleColorText(
|
)
|
||||||
leading: 'Kontakt: ',
|
],
|
||||||
following: '${restaurant.phone}',
|
),
|
||||||
),
|
margin: EdgeInsets.all(12),
|
||||||
SizedBox(
|
),
|
||||||
height: 6,
|
Container(
|
||||||
),
|
margin: EdgeInsets.only(right: 12),
|
||||||
Text(
|
decoration: BoxDecoration(
|
||||||
'Godziny otwarcia',
|
color: Colors.grey[850],
|
||||||
style:
|
borderRadius:
|
||||||
TextStyle(color: Colors.orange, fontSize: 14),
|
BorderRadius.circular(30)),
|
||||||
),
|
child: IconButton(
|
||||||
SizedBox(
|
icon: Icon(
|
||||||
height: 6,
|
Icons.map,
|
||||||
),
|
color: Colors.orange,
|
||||||
WorkingHoursList(
|
),
|
||||||
workingHours: restaurant.workingHours),
|
onPressed: () => Navigator.push(
|
||||||
SizedBox(
|
context,
|
||||||
height: 6,
|
MaterialPageRoute(
|
||||||
),
|
builder: (context) =>
|
||||||
Text(
|
RestaurantMapView(
|
||||||
'Social media',
|
coordinates: restaurant
|
||||||
style:
|
.coordinates,
|
||||||
TextStyle(color: Colors.orange, fontSize: 14),
|
name: restaurant.name,
|
||||||
),
|
type: restaurant.type,
|
||||||
SizedBox(
|
)))),
|
||||||
height: 6,
|
)
|
||||||
),
|
],
|
||||||
SocialMedia(links: restaurant.links),
|
mainAxisAlignment:
|
||||||
SizedBox(
|
MainAxisAlignment.spaceBetween,
|
||||||
height: 6,
|
)
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
)
|
Container(
|
||||||
],
|
decoration: BoxDecoration(color: Colors.grey[850]),
|
||||||
);
|
child: Column(
|
||||||
} else {
|
children: <Widget>[
|
||||||
return Center(
|
LineOfIcons(
|
||||||
child: CircularProgressIndicator(),
|
tags: restaurant.tags,
|
||||||
);
|
),
|
||||||
}
|
Divider(
|
||||||
},
|
height: 14,
|
||||||
)),
|
thickness: 4,
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
),
|
||||||
floatingActionButton: FloatingActionButton.extended(
|
Padding(
|
||||||
onPressed: () {
|
padding: EdgeInsets.symmetric(
|
||||||
showMenu(context, categories);
|
vertical: 4, horizontal: 20),
|
||||||
},
|
child: Text(
|
||||||
label: Text(
|
restaurant.description,
|
||||||
'Menu',
|
style: TextStyle(
|
||||||
style: TextStyle(color: Colors.white, fontWeight: FontWeight.w400),
|
fontSize: 12, color: Colors.grey[300]),
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
icon: Icon(
|
),
|
||||||
Icons.arrow_upward_rounded,
|
),
|
||||||
color: Colors.orange,
|
Divider(
|
||||||
),
|
height: 14,
|
||||||
backgroundColor: Colors.grey[900],
|
thickness: 4,
|
||||||
));
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Informacje',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.orange, fontSize: 14),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 6,
|
||||||
|
),
|
||||||
|
MenuiDoubleColorText(
|
||||||
|
leading: 'Kuchnia: ',
|
||||||
|
following: '${restaurant.type}',
|
||||||
|
),
|
||||||
|
MenuiDoubleColorText(
|
||||||
|
leading: 'Adres: ',
|
||||||
|
following:
|
||||||
|
'${restaurant.city}, ${restaurant.adress}',
|
||||||
|
),
|
||||||
|
MenuiDoubleColorText(
|
||||||
|
leading: 'Kontakt: ',
|
||||||
|
following: '${restaurant.phone}',
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Godziny otwarcia',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.orange, fontSize: 14),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
WorkingHoursList(
|
||||||
|
workingHours: restaurant.workingHours),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Social media',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.orange, fontSize: 14),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 6,
|
||||||
|
),
|
||||||
|
SocialMedia(links: restaurant.links),
|
||||||
|
SizedBox(
|
||||||
|
height: 6,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 80,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Center(
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||||
|
floatingActionButton: Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(bottom: 4),
|
||||||
|
child: FloatingActionButton.extended(
|
||||||
|
heroTag: null,
|
||||||
|
onPressed: () {
|
||||||
|
showMenu(context, categories);
|
||||||
|
},
|
||||||
|
label: Text(
|
||||||
|
'Karta dań',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white, fontWeight: FontWeight.w400),
|
||||||
|
),
|
||||||
|
icon: Icon(
|
||||||
|
Icons.arrow_upward_rounded,
|
||||||
|
color: Colors.orange,
|
||||||
|
),
|
||||||
|
backgroundColor: Colors.grey[900],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomLeft,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(left: 16),
|
||||||
|
child: FloatingActionButton(
|
||||||
|
heroTag: null,
|
||||||
|
backgroundColor: Colors.grey[900],
|
||||||
|
child: Icon(
|
||||||
|
Icons.arrow_back_rounded,
|
||||||
|
color: Colors.orange,
|
||||||
|
),
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomRight,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(right: 16),
|
||||||
|
child: FloatingActionButton(
|
||||||
|
heroTag: null,
|
||||||
|
backgroundColor: Colors.grey[900],
|
||||||
|
child: Icon(
|
||||||
|
Icons.favorite_rounded,
|
||||||
|
color: Colors.orange,
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
showMenu(BuildContext context, List<String> categories) {
|
showMenu(BuildContext context, List<String> categories) {
|
||||||
@@ -265,31 +317,37 @@ class WorkingHoursDay extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Container(
|
||||||
padding: EdgeInsets.all(6),
|
constraints: BoxConstraints(maxWidth: 80),
|
||||||
child: Container(
|
padding: EdgeInsets.all(8),
|
||||||
padding: EdgeInsets.all(6),
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
color: background(),
|
||||||
color: background(),
|
borderRadius: BorderRadius.all(Radius.circular(8))),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8))),
|
child: Column(
|
||||||
child: Column(
|
children: <Widget>[
|
||||||
children: <Widget>[
|
Text(
|
||||||
Text(
|
day,
|
||||||
day,
|
style:
|
||||||
style: TextStyle(fontWeight: FontWeight.w300),
|
TextStyle(fontWeight: FontWeight.w300, color: Colors.grey[200]),
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
height: 4,
|
|
||||||
thickness: 2,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
formatTodayHours(workingHours),
|
|
||||||
style: TextStyle(color: Colors.white, fontSize: 11),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
));
|
SizedBox(
|
||||||
|
height: 4,
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 4,
|
||||||
|
thickness: 1,
|
||||||
|
color: Colors.grey[850],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 4,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
formatTodayHours(workingHours),
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 11),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,23 +357,18 @@ class WorkingHoursList extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Wrap(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
spacing: 8.0,
|
||||||
|
runSpacing: 8.0,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
WorkingHoursDay('Pn', workingHours.pn, 1),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
WorkingHoursDay('Wt', workingHours.wt, 2),
|
||||||
children: [
|
WorkingHoursDay('Śr', workingHours.sr, 3),
|
||||||
WorkingHoursDay('Pn', workingHours.pn, 1),
|
WorkingHoursDay('Cz', workingHours.cz, 4),
|
||||||
WorkingHoursDay('Wt', workingHours.wt, 2),
|
WorkingHoursDay('Pt', workingHours.pt, 5),
|
||||||
WorkingHoursDay('Śr', workingHours.sr, 3),
|
WorkingHoursDay('So', workingHours.sb, 6),
|
||||||
WorkingHoursDay('Cz', workingHours.cz, 4),
|
WorkingHoursDay('Nd', workingHours.nd, 7),
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
|
||||||
WorkingHoursDay('Pt', workingHours.pt, 5),
|
|
||||||
WorkingHoursDay('So', workingHours.sb, 6),
|
|
||||||
WorkingHoursDay('Nd', workingHours.nd, 7),
|
|
||||||
])
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -409,6 +409,20 @@ class MenuiAllergens {
|
|||||||
|
|
||||||
MenuiAllergens(this.gluten, this.lactose, this.soy, this.eggs, this.seaFood,
|
MenuiAllergens(this.gluten, this.lactose, this.soy, this.eggs, this.seaFood,
|
||||||
this.peanuts, this.sesame);
|
this.peanuts, this.sesame);
|
||||||
|
|
||||||
|
bool hasAllergens() {
|
||||||
|
if (!this.gluten &&
|
||||||
|
!this.lactose &&
|
||||||
|
!this.soy &&
|
||||||
|
!this.eggs &&
|
||||||
|
!this.seaFood &&
|
||||||
|
!this.peanuts &&
|
||||||
|
!this.sesame) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MenuiLunchMenuSet {
|
class MenuiLunchMenuSet {
|
||||||
|
|||||||
Reference in New Issue
Block a user