diff --git a/lib/components/homeScreen.dart b/lib/components/homeScreen.dart index 65dd9a6..78e2081 100644 --- a/lib/components/homeScreen.dart +++ b/lib/components/homeScreen.dart @@ -46,15 +46,77 @@ class HomePage extends StatelessWidget { ), ), ), - floatingActionButton: FloatingActionButton( - onPressed: () { - showSettings(context); - }, - child: Icon( - Icons.settings, - color: Colors.orange, + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, + floatingActionButton: Container( + decoration: BoxDecoration(color: Colors.grey[850]), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: EdgeInsets.all(8), + onPressed: () { + showSettings(context); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.note_rounded, + color: Colors.orange, + ), + Text( + 'Zamówienie', + style: TextStyle(color: Colors.grey[200], fontSize: 12), + ) + ], + ), + ), + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: EdgeInsets.all(8), + onPressed: () { + showSettings(context); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.favorite_rounded, + color: Colors.orange, + ), + Text( + 'Ulubione', + style: TextStyle(color: Colors.grey[200], fontSize: 12), + ) + ], + ), + ), + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: EdgeInsets.all(8), + onPressed: () { + showSettings(context); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.settings, + color: Colors.orange, + ), + Text( + 'Ustawienia', + style: TextStyle(color: Colors.grey[200], fontSize: 12), + ) + ], + ), + ) + ], ), - backgroundColor: Colors.grey[850], ), ); } diff --git a/lib/components/mapView.dart b/lib/components/mapView.dart index 479826e..1bba3b3 100644 --- a/lib/components/mapView.dart +++ b/lib/components/mapView.dart @@ -58,13 +58,164 @@ class MapViewState extends State { target: data.coordinates, zoom: 14, ); - child = GoogleMap( - mapType: MapType.normal, - initialCameraPosition: _initialPosition, - onMapCreated: (GoogleMapController controller) { - _controller.complete(controller); - }, - markers: Set.of(data.markers.values), + child = Column( + children: [ + Container( + height: 70, + decoration: BoxDecoration(color: Colors.grey[850]), + child: Column( + children: [ + SizedBox( + height: 40, + ), + Container( + height: 30, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.search_rounded, + color: Colors.orange, + ), + SizedBox( + width: 8, + ), + Text( + 'Znaleziono: ${data.markers.length}', + style: TextStyle(color: Colors.white), + ), + ], + ), + ) + ], + ), + ), + Expanded( + child: GoogleMap( + mapType: MapType.normal, + initialCameraPosition: _initialPosition, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + }, + markers: Set.of(data.markers.values), + ), + ), + Container( + decoration: BoxDecoration(color: Colors.grey[850]), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: + EdgeInsets.symmetric(vertical: 12, horizontal: 4), + onPressed: () { + Navigator.pop(context); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.arrow_back, + color: Colors.orange, + ), + Text( + 'Cofnij', + style: TextStyle( + color: Colors.grey[200], fontSize: 12), + ) + ], + ), + ), + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: + EdgeInsets.symmetric(vertical: 12, horizontal: 4), + onPressed: () { + Navigator.pop(context); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.location_pin, + color: Colors.orange, + ), + Text( + 'Promień', + style: TextStyle( + color: Colors.grey[200], fontSize: 12), + ), + Text( + '600m', + style: + TextStyle(color: Colors.grey, fontSize: 10), + ) + ], + ), + ), + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: + EdgeInsets.symmetric(vertical: 12, horizontal: 4), + onPressed: () { + Navigator.pop(context); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.map_rounded, + color: Colors.orange, + ), + Text( + 'Kuchnia', + style: TextStyle( + color: Colors.grey[200], fontSize: 12), + ), + Text( + 'Wszystkie', + style: + TextStyle(color: Colors.grey, fontSize: 10), + ) + ], + ), + ), + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: + EdgeInsets.symmetric(vertical: 12, horizontal: 4), + onPressed: () { + Navigator.pop(context); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.filter_list_alt, + color: Colors.orange, + ), + Text( + 'Filtry', + style: TextStyle( + color: Colors.grey[200], fontSize: 12), + ), + Text( + 'Brak', + style: + TextStyle(color: Colors.grey, fontSize: 10), + ) + ], + ), + ), + ], + ), + ), + ], ); } else if (snapshot.hasError) { child = Center( @@ -75,41 +226,34 @@ class MapViewState extends State { ), ); } else { - child = Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - child: CircularProgressIndicator(), - width: 60, - height: 60, + child = Container( + decoration: BoxDecoration(color: Colors.grey[850]), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + child: CircularProgressIndicator( + backgroundColor: Colors.white, + ), + width: 60, + height: 60, + ), + Padding( + padding: EdgeInsets.only(top: 16), + child: Text( + 'Szukam restauracji...', + style: TextStyle(color: Colors.grey[200]), + ), + ) + ], ), - Padding( - padding: EdgeInsets.only(top: 16), - child: Text('Szukam restauracji...'), - ) - ], - ), - ); + )); } return child; }, ), - floatingActionButton: Padding( - padding: EdgeInsets.only(bottom: 20), - child: FloatingActionButton( - backgroundColor: Colors.grey[800], - onPressed: () { - Navigator.pop(context); - }, - child: Icon( - Icons.arrow_back_outlined, - color: Colors.orange, - ), - ), - ), - floatingActionButtonLocation: FloatingActionButtonLocation.startDocked, ); } } diff --git a/lib/components/restaurantCard.dart b/lib/components/restaurantCard.dart index e9dc681..4728919 100644 --- a/lib/components/restaurantCard.dart +++ b/lib/components/restaurantCard.dart @@ -11,117 +11,120 @@ class RestaurantCard extends StatelessWidget { @override Widget build(BuildContext context) { String _openHours = _services.getTodayHours(restaurant.workingHours); - return Card( - child: InkWell( - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => RestaurantView(id: restaurant.id))), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: ClipRRect( - child: Image.network( - restaurant.imgUrl, - width: 100, - height: 100, - fit: BoxFit.cover, + return Padding( + padding: EdgeInsets.only(bottom: 8), + child: Card( + child: InkWell( + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => RestaurantView(id: restaurant.id))), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: ClipRRect( + child: Image.network( + restaurant.imgUrl, + width: 100, + height: 100, + fit: BoxFit.cover, + ), + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(12), + topLeft: Radius.circular(12)), ), - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(12), - topLeft: Radius.circular(12)), + padding: EdgeInsets.only(right: 8), ), - padding: EdgeInsets.only(right: 8), - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Text( - restaurant.name, - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: TextStyle(color: Colors.orange[600], fontSize: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Text( + restaurant.name, + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle(color: Colors.orange[600], fontSize: 16), + ), + Container( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon( + Icons.location_city, + size: 14, + color: Colors.white, + ), + Padding( + padding: EdgeInsets.only(left: 4), + child: Text( + '${restaurant.city}, ${restaurant.adress}', + style: + TextStyle(color: Colors.grey, fontSize: 12), + ), + ), + ]), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon( + Icons.restaurant, + size: 14, + color: Colors.white, + ), + Padding( + padding: EdgeInsets.only(left: 4), + child: Text( + '${restaurant.type}', + style: + TextStyle(color: Colors.grey, fontSize: 12), + ), + ), + ]), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon( + Icons.timer, + size: 14, + color: Colors.white, + ), + Padding( + padding: EdgeInsets.only(left: 4), + child: Text( + '$_openHours', + style: + TextStyle(color: Colors.grey, fontSize: 12), + ), + ), + ]), + Padding( + child: LineOfIconsSmall(tags: restaurant.tags), + padding: EdgeInsets.only(top: 4), + ) + ], + )), + ], + )), + Container( + child: Icon( + Icons.arrow_right, + color: Colors.white, + size: 28, ), - Container( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Icon( - Icons.location_city, - size: 14, - color: Colors.white, - ), - Padding( - padding: EdgeInsets.only(left: 4), - child: Text( - '${restaurant.city}, ${restaurant.adress}', - style: - TextStyle(color: Colors.grey, fontSize: 12), - ), - ), - ]), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Icon( - Icons.restaurant, - size: 14, - color: Colors.white, - ), - Padding( - padding: EdgeInsets.only(left: 4), - child: Text( - '${restaurant.type}', - style: - TextStyle(color: Colors.grey, fontSize: 12), - ), - ), - ]), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Icon( - Icons.timer, - size: 14, - color: Colors.white, - ), - Padding( - padding: EdgeInsets.only(left: 4), - child: Text( - '$_openHours', - style: - TextStyle(color: Colors.grey, fontSize: 12), - ), - ), - ]), - Padding( - child: LineOfIconsSmall(tags: restaurant.tags), - padding: EdgeInsets.only(top: 4), - ) - ], - )), - ], - )), - Container( - child: Icon( - Icons.arrow_right, - color: Colors.white, - size: 28, - ), - ) - ], + ) + ], + ), ), + color: Color.fromRGBO(50, 50, 50, 0.8), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + margin: EdgeInsets.symmetric(horizontal: 12), ), - color: Color.fromRGBO(50, 50, 50, 0.8), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), - margin: EdgeInsets.symmetric(horizontal: 12), ); } } diff --git a/lib/components/searchResults.dart b/lib/components/searchResults.dart index 528294e..4643cd7 100644 --- a/lib/components/searchResults.dart +++ b/lib/components/searchResults.dart @@ -49,6 +49,93 @@ class SearchResults extends StatelessWidget { ), ), ), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, + floatingActionButton: Container( + decoration: BoxDecoration(color: Colors.grey[850]), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: EdgeInsets.symmetric(vertical: 12, horizontal: 4), + onPressed: () { + Navigator.pop(context); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.arrow_back_rounded, + color: Colors.orange, + ), + Text( + 'Cofnij', + style: TextStyle(color: Colors.grey[200], fontSize: 12), + ) + ], + ), + ), + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: EdgeInsets.all(8), + onPressed: () {}, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.note_rounded, + color: Colors.orange, + ), + Text( + 'Zamówienie', + style: TextStyle(color: Colors.grey[200], fontSize: 12), + ) + ], + ), + ), + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: EdgeInsets.all(8), + onPressed: () {}, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.favorite_rounded, + color: Colors.orange, + ), + Text( + 'Ulubione', + style: TextStyle(color: Colors.grey[200], fontSize: 12), + ) + ], + ), + ), + RaisedButton( + color: Colors.grey[850], + elevation: 0, + padding: EdgeInsets.all(8), + onPressed: () {}, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.settings, + color: Colors.orange, + ), + Text( + 'Ustawienia', + style: TextStyle(color: Colors.grey[200], fontSize: 12), + ) + ], + ), + ) + ], + ), + ), ); } }