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