diff --git a/lib/components/lineOfIcons.dart b/lib/components/lineOfIcons.dart new file mode 100644 index 0000000..fae692c --- /dev/null +++ b/lib/components/lineOfIcons.dart @@ -0,0 +1,159 @@ +import 'package:flutter/material.dart'; +import '../services.dart'; + +class LineOfIcons extends StatelessWidget { + final MenuiTags tags; + + LineOfIcons({@required this.tags}); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (tags.alcohol == true) + Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + Container( + alignment: Alignment.center, + child: Image.asset( + 'img/i_alcohol.png', + width: 20, + ), + height: 30, + ), + Text( + 'Alkohol', + style: TextStyle(fontSize: 10, color: Colors.grey), + ) + ], + )), + if (tags.cardPayments == true) + Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + Container( + alignment: Alignment.center, + child: Image.asset( + 'img/i_card.png', + width: 20, + ), + height: 30, + ), + Text( + 'Płatność', + style: TextStyle(fontSize: 10, color: Colors.grey), + ), + Text( + 'kartą', + style: TextStyle(fontSize: 10, color: Colors.grey), + ) + ], + )), + if (tags.delivery == true) + Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + Container( + alignment: Alignment.center, + child: Image.asset( + 'img/i_delivery.png', + width: 20, + ), + height: 30, + ), + Text( + 'Dowozimy', + style: TextStyle(fontSize: 10, color: Colors.grey), + ) + ], + )), + if (tags.glutenFree == true) + Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + Container( + alignment: Alignment.center, + child: Image.asset( + 'img/i_glutenFree.png', + width: 20, + ), + height: 30, + ), + Text( + 'Bezglutenowe', + style: TextStyle(fontSize: 10, color: Colors.grey), + ) + ], + )), + if (tags.petFriendly == true) + Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + Container( + alignment: Alignment.center, + child: Image.asset( + 'img/i_pets.png', + width: 20, + ), + height: 30, + ), + Text( + 'Lubimy', + style: TextStyle(fontSize: 10, color: Colors.grey), + ), + Text( + 'zwierzaczki', + style: TextStyle(fontSize: 10, color: Colors.grey), + ) + ], + )), + if (tags.vegan == true) + Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + Container( + alignment: Alignment.center, + child: Image.asset( + 'img/i_vegan.png', + width: 20, + ), + height: 30, + ), + Text( + 'Wegańskie', + style: TextStyle(fontSize: 10, color: Colors.grey), + ) + ], + )), + if (tags.vegetarian == true) + Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + Container( + alignment: Alignment.center, + child: Image.asset( + 'img/i_vegetarian.png', + width: 20, + ), + height: 30, + ), + Text( + 'Wegetariańskie', + style: TextStyle(fontSize: 10, color: Colors.grey), + ) + ], + )), + ], + ); + } +} diff --git a/lib/components/restaurantCard.dart b/lib/components/restaurantCard.dart index d5cf049..4ad5950 100644 --- a/lib/components/restaurantCard.dart +++ b/lib/components/restaurantCard.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'restaurantView.dart'; import 'package:menui_mobile/services.dart'; class RestaurantCard extends StatelessWidget { @@ -10,7 +11,10 @@ class RestaurantCard extends StatelessWidget { Widget build(BuildContext context) { return Card( child: InkWell( - onTap: () {}, + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => RestaurantView(restaurant: restaurant))), child: Row( crossAxisAlignment: CrossAxisAlignment.baseline, children: [ diff --git a/lib/components/restaurantView.dart b/lib/components/restaurantView.dart new file mode 100644 index 0000000..94730b9 --- /dev/null +++ b/lib/components/restaurantView.dart @@ -0,0 +1,93 @@ +import 'package:flutter/material.dart'; +import '../services.dart'; +import 'lineOfIcons.dart'; + +class RestaurantView extends StatelessWidget { + final Restaurant restaurant; + + RestaurantView({@required this.restaurant}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage("img/bg_tile.jpg"), fit: BoxFit.cover)), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + image: NetworkImage( + restaurant.imgUrl, + ), + fit: BoxFit.cover)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 160, + ), + Row( + children: [ + Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.grey[850], + borderRadius: BorderRadius.all(Radius.circular(8))), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 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: () {}), + ) + ], + mainAxisAlignment: MainAxisAlignment.spaceBetween, + ) + ], + ), + ), + Container( + decoration: BoxDecoration(color: Colors.grey[850]), + child: Column( + children: [ + LineOfIcons( + tags: restaurant.tags, + ), + Text('1234') + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index 6fb3822..f4805f4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,6 +19,7 @@ class App extends StatelessWidget { }, child: MaterialApp( title: 'Menui', + themeMode: ThemeMode.dark, theme: ThemeData( platform: TargetPlatform.iOS, primarySwatch: Colors.orange,