Skip to content

Instantly share code, notes, and snippets.

@jwson-automation
Created May 2, 2024 03:47
Show Gist options
  • Save jwson-automation/b422bb776d97a98d5248649b58457a1f to your computer and use it in GitHub Desktop.
Save jwson-automation/b422bb776d97a98d5248649b58457a1f to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
void main() {
runApp(
ProviderScope(
child: MyApp(),
),
);
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Shopping Item Detail Page',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: DetailPage(),
);
}
}
class DetailPage extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return Scaffold(
appBar: AppBar(
title: Text('Product Details'),
actions: [
IconButton(
icon: Icon(Icons.share),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.shopping_cart),
onPressed: () {},
),
],
),
body: ListView(
children: [
Image.network(
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-TUBHLKYl2lBqM1b7iE99XgMQ%2Fuser-UjOypK7HRZS7bCpwDOO1UgLB%2Fimg-9jWfYQz3Rht5IFtJYNeaa7MT.png%3Fst%3D2024-05-02T02%253A47%253A00Z%26se%3D2024-05-02T04%253A47%253A00Z%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-05-01T23%253A26%253A08Z%26ske%3D2024-05-02T23%253A26%253A08Z%26sks%3Db%26skv%3D2021-08-06%26sig%3DjEtsnrFDKKyg9WgJ5%2FmJN9wfMIQn6g6KagMKW6QPIOw%253D',
fit: BoxFit.cover,
height: 300,
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Product Title',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8),
Row(
children: [
Icon(Icons.star, color: Colors.yellow[600], size: 20),
Icon(Icons.star, color: Colors.yellow[600], size: 20),
Icon(Icons.star, color: Colors.yellow[600], size: 20),
Icon(Icons.star, color: Colors.yellow[600], size: 20),
Icon(Icons.star_half, color: Colors.yellow[600], size: 20),
SizedBox(width: 8),
Text('(571,715)'),
],
),
SizedBox(height: 16),
Text(
'Product Description',
style: TextStyle(fontSize: 16),
),
SizedBox(height: 16),
Text(
'₩10,660',
style: TextStyle(
fontSize: 24,
color: Colors.red,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8),
Text(
'₩9,100 (100g당 361원)',
style: TextStyle(
fontSize: 16,
color: Colors.blue,
decoration: TextDecoration.underline,
),
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () {},
child: Text('Add to Cart'),
style: ElevatedButton.styleFrom(
primary: Colors.red,
minimumSize: Size(double.infinity, 50),
),
),
SizedBox(height: 16),
Text(
'More Products',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8),
// Repeat this Container for each related product
Container(
height: 100,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: 15,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Image.network(
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-TUBHLKYl2lBqM1b7iE99XgMQ%2Fuser-UjOypK7HRZS7bCpwDOO1UgLB%2Fimg-c0xlccKqgKcHngOU7Cz9tIMb.png%3Fst%3D2024-05-02T02%253A47%253A02Z%26se%3D2024-05-02T04%253A47%253A02Z%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-05-01T23%253A34%253A50Z%26ske%3D2024-05-02T23%253A34%253A50Z%26sks%3Db%26skv%3D2021-08-06%26sig%3DreQLACC%252BznzmGGvSiy7WWsgLBhGiikZBDhcP66MxyBE%253D',
fit: BoxFit.cover,
),
);
},
),
),
],
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment