Created
March 21, 2024 01:36
-
-
Save DMRE/1b433ef33f98f7456d7b4e22ded21da1 to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
brightness: Brightness.dark, | |
useMaterial3: true, | |
), | |
home: OrderPage(), | |
); | |
} | |
} | |
class OrderPage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Atras...'), | |
backgroundColor: Colors.black, | |
elevation: 0, | |
), | |
body: Column( | |
children: [ | |
Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: TextField( | |
decoration: InputDecoration( | |
hintText: 'Buscar en Pedidos', | |
prefixIcon: Icon(Icons.search), | |
filled: true, | |
fillColor: Colors.white, | |
border: OutlineInputBorder( | |
borderRadius: BorderRadius.circular(30.0), | |
borderSide: BorderSide.none, | |
), | |
), | |
), | |
), | |
Expanded( | |
child: ListView( | |
children: [ | |
Padding( | |
padding: const EdgeInsets.symmetric(horizontal: 16.0), | |
child: Column( | |
children: [ | |
SizedBox(height: 40), | |
Text( | |
'Agrega artículos para llenar tu bolsita', | |
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), | |
), | |
SizedBox(height: 16), | |
Text( | |
'Una vez que agregues artículos de un restaurante o negocio, se agregará a tu bolsita y aparecerá aquí.', | |
textAlign: TextAlign.center, | |
style: TextStyle(fontSize: 16), | |
), | |
SizedBox(height: 24), | |
ElevatedButton( | |
onPressed: () {}, | |
child: Text('Empieza a comprar'), | |
style: ElevatedButton.styleFrom( | |
primary: Colors.white, | |
onPrimary: Colors.black, | |
textStyle: TextStyle(fontSize: 16), | |
), | |
), | |
SizedBox(height: 40), | |
Divider(color: Colors.white), | |
SizedBox(height: 16), | |
Text( | |
'Ver historial de pedidos', | |
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), | |
), | |
SizedBox(height: 16), | |
OrderItem( | |
title: 'Mr. Sandwiches', | |
items: '2 Artículos', | |
price: '\$349', | |
date: '19-Sept', | |
status: 'Completado', | |
imageUrl: 'https://placehold.co/100x100?description=Sandwich', | |
), | |
OrderItem( | |
title: 'Pizzas Julio', | |
items: '2 Artículos', | |
price: '\$500', | |
date: '19-Sept', | |
status: 'Completado', | |
imageUrl: 'https://placehold.co/100x100?description=Pizza', | |
), | |
], | |
), | |
), | |
], | |
), | |
), | |
], | |
), | |
bottomNavigationBar: BottomNavigationBar( | |
items: const <BottomNavigationBarItem>[ | |
BottomNavigationBarItem( | |
icon: Icon(Icons.explore), | |
label: 'Explorar', | |
), | |
BottomNavigationBarItem( | |
icon: Icon(Icons.home), | |
label: 'Inicio', | |
), | |
BottomNavigationBarItem( | |
icon: Icon(Icons.store), | |
label: 'Food Market', | |
), | |
BottomNavigationBarItem( | |
icon: Icon(Icons.shopping_bag), | |
label: 'Bolsa', | |
), | |
], | |
backgroundColor: Colors.black, | |
unselectedItemColor: Colors.white54, | |
selectedItemColor: Colors.white, | |
type: BottomNavigationBarType.fixed, | |
), | |
); | |
} | |
} | |
class OrderItem extends StatelessWidget { | |
final String title; | |
final String items; | |
final String price; | |
final String date; | |
final String status; | |
final String imageUrl; | |
const OrderItem({ | |
Key? key, | |
required this.title, | |
required this.items, | |
required this.price, | |
required this.date, | |
required this.status, | |
required this.imageUrl, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
margin: EdgeInsets.only(bottom: 16), | |
decoration: BoxDecoration( | |
color: Colors.grey[900], | |
borderRadius: BorderRadius.circular(8), | |
), | |
child: Column( | |
children: [ | |
ListTile( | |
leading: Image.network(imageUrl), | |
title: Text(title, style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), | |
subtitle: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Text(items), | |
Text(price), | |
Text(date), | |
Text(status), | |
], | |
), | |
trailing: Column( | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
ElevatedButton( | |
onPressed: () {}, | |
child: Text('Ver Pedido'), | |
style: ElevatedButton.styleFrom( | |
primary: Colors.white, | |
onPrimary: Colors.black, | |
textStyle: TextStyle(fontSize: 14), | |
shape: RoundedRectangleBorder( | |
borderRadius: BorderRadius.circular(18.0), | |
), | |
), | |
), | |
SizedBox(height: 8), | |
ElevatedButton( | |
onPressed: () {}, | |
child: Text('Volver a pe..'), | |
style: ElevatedButton.styleFrom( | |
primary: Colors.white, | |
onPrimary: Colors.black, | |
textStyle: TextStyle(fontSize: 14), | |
shape: RoundedRectangleBorder( | |
borderRadius: BorderRadius.circular(18.0), | |
), | |
), | |
), | |
], | |
), | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment