Skip to content

Instantly share code, notes, and snippets.

@up1
Created March 5, 2025 14:09
Show Gist options
  • Save up1/a8e733bfb88fcc81257f530c28606182 to your computer and use it in GitHub Desktop.
Save up1/a8e733bfb88fcc81257f530c28606182 to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(useMaterial3: true),
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: const Color(0xFFB0003C),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'สวัสดีสมาชิค, 0863816736',
style: TextStyle(fontSize: 14, color: Colors.white),
),
Row(
children: const [
Icon(Icons.location_on, color: Colors.white, size: 16),
Text(
'บิ๊กซี รัชดาภิเษก- prom condo 122/64 prom con',
style: TextStyle(fontSize: 12, color: Colors.white),
),
Icon(Icons.arrow_drop_down, color: Colors.white),
],
),
],
),
actions: [
IconButton(
icon: const Icon(Icons.notifications, color: Colors.white),
onPressed: () {},
),
IconButton(
icon: const Icon(Icons.shopping_cart, color: Colors.white),
onPressed: () {},
),
],
),
body: SingleChildScrollView(
child: Column(
children: [
Container(
color: const Color(0xFFB0003C),
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
TextField(
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
hintText: 'ค้นหาสินค้า',
prefixIcon: const Icon(Icons.search),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(30),
borderSide: BorderSide.none,
),
),
),
const SizedBox(height: 10),
Image.network(
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-i80sUbnZfz5TGxVwKgB1u919%2Fuser-pCtLOxVNRM4KtX64wx3hUJyv%2Fimg-ugrWOBTxVvxwTnHZ8q99mtXQ.png%3Fst%3D2025-03-05T13%253A09%253A30Z%26se%3D2025-03-05T15%253A09%253A30Z%26sp%3Dr%26sv%3D2024-08-04%26sr%3Db%26rscd%3Dinline%26rsct%3Dimage%2Fpng%26skoid%3Dd505667d-d6c1-4a0a-bac7-5c84a87759f8%26sktid%3Da48cca56-e6da-484e-a814-9c849652bcb3%26skt%3D2025-03-05T02%253A24%253A16Z%26ske%3D2025-03-06T02%253A24%253A16Z%26sks%3Db%26skv%3D2024-08-04%26sig%3DnERTFFDxE3N4EjOpl%252BDkI%2FkCd22Dqwl2ZB8whb3qSUI%253D',
fit: BoxFit.cover,
),
],
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_buildFeatureButton('บิ๊กพอยต์', 'เริ่มใช้งาน'),
_buildFeatureButton('คูปองของฉัน', 'เริ่มต้นใช้งาน'),
],
),
),
Container(
color: Colors.grey[200],
padding: const EdgeInsets.symmetric(vertical: 10),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
_buildIconFeature(
'ส่งฟรี\nสั่งเลย!', 'https://corsproxy.io/?I+couldn%27t+generate+an+image+for+you.+I+got+this+error%3A+OpenAIClientException%28%7B%0A++%22uri%22%3A+%22https%3A%2F%2Fapi.openai.com%2Fv1%2Fimages%2Fgenerations%22%2C%0A++%22method%22%3A+%22POST%22%2C%0A++%22code%22%3A+429%2C%0A++%22message%22%3A+%22Unsuccessful+response%22%2C%0A++%22body%22%3A+%7B%0A++++%22error%22%3A+%7B%0A++++++%22code%22%3A+%22rate_limit_exceeded%22%2C%0A++++++%22message%22%3A+%22Rate+limit+exceeded+for+images+per+minute+in+organization+org-i80sUbnZfz5TGxVwKgB1u919.+Limit%3A+5%2F1min.+Current%3A+6%2F1min.+Please+visit+https%3A%2F%2Fplatform.openai.com%2Fdocs%2Fguides%2Frate-limits+to+learn+how+to+increase+your+rate+limit.%22%2C%0A++++++%22param%22%3A+null%2C%0A++++++%22type%22%3A+%22requests%22%0A++++%7D%0A++%7D%0A%7D%29'),
_buildIconFeature(
'ส่วนลด\nออนไลน์', 'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-i80sUbnZfz5TGxVwKgB1u919%2Fuser-pCtLOxVNRM4KtX64wx3hUJyv%2Fimg-QI0HtldjdhNliW0BbR0IYCuA.png%3Fst%3D2025-03-05T13%253A09%253A28Z%26se%3D2025-03-05T15%253A09%253A28Z%26sp%3Dr%26sv%3D2024-08-04%26sr%3Db%26rscd%3Dinline%26rsct%3Dimage%2Fpng%26skoid%3Dd505667d-d6c1-4a0a-bac7-5c84a87759f8%26sktid%3Da48cca56-e6da-484e-a814-9c849652bcb3%26skt%3D2025-03-05T02%253A48%253A35Z%26ske%3D2025-03-06T02%253A48%253A35Z%26sks%3Db%26skv%3D2024-08-04%26sig%3DwemKCuGAxcmyX7GxnKVGz0NYPAn2Ae9MGZY6jgKaAgU%253D'),
_buildIconFeature(
'ภารกิจบิ๊กซี', 'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-i80sUbnZfz5TGxVwKgB1u919%2Fuser-pCtLOxVNRM4KtX64wx3hUJyv%2Fimg-edLOHJGMMqZO5cg5wuXHT6UM.png%3Fst%3D2025-03-05T13%253A09%253A29Z%26se%3D2025-03-05T15%253A09%253A29Z%26sp%3Dr%26sv%3D2024-08-04%26sr%3Db%26rscd%3Dinline%26rsct%3Dimage%2Fpng%26skoid%3Dd505667d-d6c1-4a0a-bac7-5c84a87759f8%26sktid%3Da48cca56-e6da-484e-a814-9c849652bcb3%26skt%3D2025-03-05T02%253A19%253A40Z%26ske%3D2025-03-06T02%253A19%253A40Z%26sks%3Db%26skv%3D2024-08-04%26sig%3D%252B4sacVThegvKQXkxfqR3m58qwa6Cgo31AjJi7MKhCes%253D'),
_buildIconFeature(
'พาร์ทเนอร์', 'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-i80sUbnZfz5TGxVwKgB1u919%2Fuser-pCtLOxVNRM4KtX64wx3hUJyv%2Fimg-3CCAHachW0vtgkHbKgnGSb6d.png%3Fst%3D2025-03-05T13%253A09%253A29Z%26se%3D2025-03-05T15%253A09%253A29Z%26sp%3Dr%26sv%3D2024-08-04%26sr%3Db%26rscd%3Dinline%26rsct%3Dimage%2Fpng%26skoid%3Dd505667d-d6c1-4a0a-bac7-5c84a87759f8%26sktid%3Da48cca56-e6da-484e-a814-9c849652bcb3%26skt%3D2025-03-05T02%253A16%253A15Z%26ske%3D2025-03-06T02%253A16%253A15Z%26sks%3Db%26skv%3D2024-08-04%26sig%3DN6rQ9%2FRYbQ9dSdr80bQabgjGKB1OxZd9oRrcgZ7Ejao%253D'),
_buildIconFeature(
'ประกันภัย\nออนไลน์', 'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-i80sUbnZfz5TGxVwKgB1u919%2Fuser-pCtLOxVNRM4KtX64wx3hUJyv%2Fimg-iVIW79Bnj3WfEq6pprrz7Jbt.png%3Fst%3D2025-03-05T13%253A09%253A28Z%26se%3D2025-03-05T15%253A09%253A28Z%26sp%3Dr%26sv%3D2024-08-04%26sr%3Db%26rscd%3Dinline%26rsct%3Dimage%2Fpng%26skoid%3Dd505667d-d6c1-4a0a-bac7-5c84a87759f8%26sktid%3Da48cca56-e6da-484e-a814-9c849652bcb3%26skt%3D2025-03-04T14%253A19%253A11Z%26ske%3D2025-03-05T14%253A19%253A11Z%26sks%3Db%26skv%3D2024-08-04%26sig%3D%2FSp%2Fj0aJddkY1h2ODKA%2Fd1soIZNqOOtvbFzCZbYAHFE%253D'),
],
),
),
),
Image.network(
'https://corsproxy.io/?I+couldn%27t+generate+an+image+for+you.+I+got+this+error%3A+OpenAIClientException%28%7B%0A++%22uri%22%3A+%22https%3A%2F%2Fapi.openai.com%2Fv1%2Fimages%2Fgenerations%22%2C%0A++%22method%22%3A+%22POST%22%2C%0A++%22code%22%3A+429%2C%0A++%22message%22%3A+%22Unsuccessful+response%22%2C%0A++%22body%22%3A+%7B%0A++++%22error%22%3A+%7B%0A++++++%22code%22%3A+%22rate_limit_exceeded%22%2C%0A++++++%22message%22%3A+%22Rate+limit+exceeded+for+images+per+minute+in+organization+org-i80sUbnZfz5TGxVwKgB1u919.+Limit%3A+5%2F1min.+Current%3A+6%2F1min.+Please+visit+https%3A%2F%2Fplatform.openai.com%2Fdocs%2Fguides%2Frate-limits+to+learn+how+to+increase+your+rate+limit.%22%2C%0A++++++%22param%22%3A+null%2C%0A++++++%22type%22%3A+%22requests%22%0A++++%7D%0A++%7D%0A%7D%29',
fit: BoxFit.cover,
),
],
),
),
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'หน้าหลัก',
),
BottomNavigationBarItem(
icon: Icon(Icons.card_giftcard),
label: 'บิ๊กพอยต์',
),
BottomNavigationBarItem(
icon: Icon(Icons.grid_view),
label: 'สินค้า',
),
BottomNavigationBarItem(
icon: Icon(Icons.favorite),
label: 'ลิสต์ของฉัน',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'บัญชี',
),
],
),
);
}
Widget _buildFeatureButton(String title, String subtitle) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 2,
blurRadius: 5,
),
],
),
child: Column(
children: [
Text(
title,
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
Text(
subtitle,
style: const TextStyle(fontSize: 14, color: Colors.green),
),
],
),
);
}
Widget _buildIconFeature(String title, String imageUrl) {
return Container(
width: 80,
margin: const EdgeInsets.symmetric(horizontal: 5),
child: Column(
children: [
Image.network(imageUrl, width: 60, height: 60),
const SizedBox(height: 5),
Text(
title,
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 12),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment