import '../services.dart'; import 'package:flutter/material.dart'; import 'package:menui_mobile/components/restaurantCard.dart'; import 'searchBar.dart'; import 'menuiButton.dart'; import 'homeScreen.dart'; import 'orderView.dart'; import 'favoritesView.dart'; import '../settings.dart'; class SearchResults extends StatelessWidget { final List restaurants; final MenuiSettings settings = new MenuiSettings(); SearchResults({@required this.restaurants}); @override Widget build(BuildContext context) { return Scaffold( body: Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage("img/bg_tile.jpg"), fit: BoxFit.cover)), child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( height: 30, ), Image.asset( "img/logo_orange.png", width: 60, ), MenuiSearchBar(), Row(children: [ Container( padding: EdgeInsets.only(left: 12), child: Text( 'Znaleziono: ${restaurants.length}', style: TextStyle(color: Colors.grey), ), ) ]), Expanded( child: ListView.builder( itemCount: restaurants.length, itemBuilder: (context, index) { return RestaurantCard( restaurant: restaurants[index], ); }, )) ], ), ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: Container( decoration: BoxDecoration(color: Colors.grey[900]), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ MenuiButton( color: Colors.orange, icon: Icons.home_rounded, text: "Szukaj", onPressed: () => Navigator.push( context, MaterialPageRoute(builder: (context) => HomePage())), ), MenuiButton( color: Colors.orange, icon: Icons.note_rounded, text: "Zamównienie", onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (context) => OrderView())), ), MenuiButton( color: Colors.orange, icon: Icons.favorite_rounded, text: "Ulubione", onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (context) => FavoritesView())), ), MenuiButton( color: Colors.orange, icon: Icons.settings, text: "Ustawienia", onPressed: () { showSettings(context, settings); }, ), ], ), ), ); } }