Skip to content

Instantly share code, notes, and snippets.

@DMRE
Created March 21, 2024 01:40
Show Gist options
  • Save DMRE/6d7fe23283870a913228b155b34bb467 to your computer and use it in GitHub Desktop.
Save DMRE/6d7fe23283870a913228b155b34bb467 to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
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,
primarySwatch: Colors.grey,
),
home: OrderPage(),
);
}
}
class OrderPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {},
),
title: Text('Atras...'),
backgroundColor: Colors.black,
),
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: [
_buildEmptyOrderSection(),
_buildOrderHistorySection(),
],
),
),
],
),
bottomNavigationBar: _buildBottomNavigationBar(),
);
}
Widget _buildEmptyOrderSection() {
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 24.0),
child: Text(
'Agrega artículos para llenar tu bolsita',
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.network(
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-xTLNwQu3qmOZzqbtzdvh3ysR%2Fuser-GupicId7moB3L1ZsqRkpAJaO%2Fimg-gnnm3X3cRi5aiY2KsaTHFeLK.png%3Fst%3D2024-03-21T00%253A40%253A30Z%26se%3D2024-03-21T02%253A40%253A30Z%26sp%3Dr%26sv%3D2021-08-06%26sr%3Db%26rscd%3Dinline%26rsct%3Dimage%2Fpng%26skoid%3D6aaadede-4fb3-4698-a8f6-684d7786b067%26sktid%3Da48cca56-e6da-484e-a814-9c849652bcb3%26skt%3D2024-03-20T23%253A18%253A18Z%26ske%3D2024-03-21T23%253A18%253A18Z%26sks%3Db%26skv%3D2021-08-06%26sig%3DpbZn%252B%252BjYEdrtU0NzjVf8SunrLpCt7LjxduP4lurLohI%253D',
width: 50,
height: 50,
),
SizedBox(width: 16),
Image.network(
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-xTLNwQu3qmOZzqbtzdvh3ysR%2Fuser-GupicId7moB3L1ZsqRkpAJaO%2Fimg-gnnm3X3cRi5aiY2KsaTHFeLK.png%3Fst%3D2024-03-21T00%253A40%253A30Z%26se%3D2024-03-21T02%253A40%253A30Z%26sp%3Dr%26sv%3D2021-08-06%26sr%3Db%26rscd%3Dinline%26rsct%3Dimage%2Fpng%26skoid%3D6aaadede-4fb3-4698-a8f6-684d7786b067%26sktid%3Da48cca56-e6da-484e-a814-9c849652bcb3%26skt%3D2024-03-20T23%253A18%253A18Z%26ske%3D2024-03-21T23%253A18%253A18Z%26sks%3Db%26skv%3D2021-08-06%26sig%3DpbZn%252B%252BjYEdrtU0NzjVf8SunrLpCt7LjxduP4lurLohI%253D',
width: 50,
height: 50,
),
],
),
Padding(
padding: const EdgeInsets.all(16.0),
child: 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),
),
),
ElevatedButton(
onPressed: () {},
child: Text('Empieza a comprar'),
style: ElevatedButton.styleFrom(
primary: Colors.white,
onPrimary: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
),
),
Divider(color: Colors.grey, height: 32),
],
);
}
Widget _buildOrderHistorySection() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'Ver historial de pedidos',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
),
_buildOrderItem(
'Mr. Sandwiches',
'2 Artículos',
'\$349',
'19-Sept',
'Completado',
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-xTLNwQu3qmOZzqbtzdvh3ysR%2Fuser-GupicId7moB3L1ZsqRkpAJaO%2Fimg-HbTeUuiVDEea6fei1S4G4vph.png%3Fst%3D2024-03-21T00%253A40%253A36Z%26se%3D2024-03-21T02%253A40%253A36Z%26sp%3Dr%26sv%3D2021-08-06%26sr%3Db%26rscd%3Dinline%26rsct%3Dimage%2Fpng%26skoid%3D6aaadede-4fb3-4698-a8f6-684d7786b067%26sktid%3Da48cca56-e6da-484e-a814-9c849652bcb3%26skt%3D2024-03-20T23%253A22%253A50Z%26ske%3D2024-03-21T23%253A22%253A50Z%26sks%3Db%26skv%3D2021-08-06%26sig%3DAgeytzfxE2xPpYyirlnszGs8jCooBsvdYTsDeoXylRk%253D',
),
_buildOrderItem(
'Pizzas Julio',
'2 Artículos',
'\$500',
'19-Sept',
'Completado',
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-xTLNwQu3qmOZzqbtzdvh3ysR%2Fuser-GupicId7moB3L1ZsqRkpAJaO%2Fimg-0GeanAXZUqNqojO9abgsT2PJ.png%3Fst%3D2024-03-21T00%253A40%253A31Z%26se%3D2024-03-21T02%253A40%253A31Z%26sp%3Dr%26sv%3D2021-08-06%26sr%3Db%26rscd%3Dinline%26rsct%3Dimage%2Fpng%26skoid%3D6aaadede-4fb3-4698-a8f6-684d7786b067%26sktid%3Da48cca56-e6da-484e-a814-9c849652bcb3%26skt%3D2024-03-20T23%253A28%253A44Z%26ske%3D2024-03-21T23%253A28%253A44Z%26sks%3Db%26skv%3D2021-08-06%26sig%3DarVU3%252B7jwYnNyPQ6e0nUyxazkdL2gID%252Bed%2FSlcyywPU%253D',
),
Divider(color: Colors.grey, height: 32),
],
);
}
Widget _buildOrderItem(String title, String items, String price, String date, String status, String imageUrl) {
return ListTile(
leading: Image.network(imageUrl),
title: Text(title),
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,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
),
),
SizedBox(height: 8),
ElevatedButton(
onPressed: () {},
child: Text('Volver a pe...'),
style: ElevatedButton.styleFrom(
primary: Colors.white,
onPrimary: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
),
),
],
),
);
}
Widget _buildBottomNavigationBar() {
return 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',
),
],
selectedItemColor: Colors.white,
unselectedItemColor: Colors.grey,
backgroundColor: Colors.black,
type: BottomNavigationBarType.fixed,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment