Skip to content

Instantly share code, notes, and snippets.

@up1
Created March 6, 2025 04:59
Show Gist options
  • Save up1/6b3544720fe05c0cd74ba8db91980d4a to your computer and use it in GitHub Desktop.
Save up1/6b3544720fe05c0cd74ba8db91980d4a 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(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.red),
useMaterial3: true,
),
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFB0003A),
appBar: AppBar(
backgroundColor: Color(0xFFB0003A),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'สวัสดีสมาชิก, 0863816736',
style: TextStyle(color: Colors.white, fontSize: 16),
),
Row(
children: [
Icon(Icons.location_on, color: Colors.white, size: 16),
SizedBox(width: 4),
Expanded(
child: Text(
'บิ๊กซี รัชดาภิเษก- prom condo 122/64 prom ...',
style: TextStyle(color: Colors.white, fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
Icon(Icons.arrow_drop_down, color: Colors.white),
],
),
],
),
actions: [
IconButton(
icon: Icon(Icons.notifications, color: Colors.white),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.shopping_cart, color: Colors.white),
onPressed: () {},
),
],
),
body: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: TextField(
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
prefixIcon: Icon(Icons.search),
hintText: 'ค้นหาสินค้า',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(30),
borderSide: BorderSide.none,
),
),
),
),
Image.network(
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-i80sUbnZfz5TGxVwKgB1u919%2Fuser-pCtLOxVNRM4KtX64wx3hUJyv%2Fimg-40wuDS07Ho8EeQK71DV0irvf.png%3Fst%3D2025-03-06T03%253A59%253A00Z%26se%3D2025-03-06T05%253A59%253A00Z%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-06T02%253A31%253A21Z%26ske%3D2025-03-07T02%253A31%253A21Z%26sks%3Db%26skv%3D2024-08-04%26sig%3DFgpXaHK4L0vq6z7%2Fex4Aj9VF2E8VV9IFkW23DqtFNmQ%253D',
fit: BoxFit.cover,
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_buildFeatureCard('บิ๊กพอยต์', 'เริ่มใช้งาน'),
_buildFeatureCard('คูปองของฉัน', 'เริ่มต้นใช้งาน'),
],
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_buildIconFeature(Icons.local_shipping, 'ส่งฟรี\nสั่งเลย!'),
_buildIconFeature(Icons.discount, 'ส่วนลด\nออนไลน์'),
_buildIconFeature(Icons.notifications, 'ภารกิจบิ๊กซี'),
_buildIconFeature(Icons.group, 'พาร์ทเนอร์'),
_buildIconFeature(Icons.store, 'ปรับปรุง\nออนไลน์'),
],
),
),
Image.network(
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-i80sUbnZfz5TGxVwKgB1u919%2Fuser-pCtLOxVNRM4KtX64wx3hUJyv%2Fimg-40wuDS07Ho8EeQK71DV0irvf.png%3Fst%3D2025-03-06T03%253A59%253A00Z%26se%3D2025-03-06T05%253A59%253A00Z%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-06T02%253A31%253A21Z%26ske%3D2025-03-07T02%253A31%253A21Z%26sks%3Db%26skv%3D2024-08-04%26sig%3DFgpXaHK4L0vq6z7%2Fex4Aj9VF2E8VV9IFkW23DqtFNmQ%253D',
fit: BoxFit.cover,
),
],
),
),
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
selectedItemColor: Colors.purple,
unselectedItemColor: Colors.grey,
items: [
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 _buildFeatureCard(String title, String subtitle) {
return Container(
width: 150,
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: [
Text(
title,
style: TextStyle(color: Colors.green, fontSize: 18),
),
SizedBox(height: 8),
Text(
subtitle,
style: TextStyle(color: Colors.black, fontSize: 16),
),
],
),
);
}
Widget _buildIconFeature(IconData icon, String label) {
return Column(
children: [
CircleAvatar(
radius: 30,
backgroundColor: Colors.white,
child: Icon(icon, color: Colors.red, size: 30),
),
SizedBox(height: 8),
Text(
label,
textAlign: TextAlign.center,
style: TextStyle(color: Colors.black, fontSize: 14),
),
],
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment