Created
May 3, 2024 03:48
-
-
Save jwson-automation/8478ba5228b916bea95c288a3eee1fa3 to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
This file contains 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'; | |
import 'package:flutter/services.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Shopping App', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
visualDensity: VisualDensity.adaptivePlatformDensity, | |
), | |
home: ShoppingPage(), | |
debugShowCheckedModeBanner: false, | |
); | |
} | |
} | |
class ShoppingPage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( | |
statusBarColor: Colors.transparent, | |
)); | |
return Scaffold( | |
body: CustomScrollView( | |
slivers: [ | |
SliverAppBar( | |
expandedHeight: 200.0, | |
floating: false, | |
pinned: true, | |
flexibleSpace: FlexibleSpaceBar( | |
background: Image.network( | |
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-TUBHLKYl2lBqM1b7iE99XgMQ%2Fuser-UjOypK7HRZS7bCpwDOO1UgLB%2Fimg-QqAr8RGCw0Su8XFbPxY6uqsj.png%3Fst%3D2024-05-03T02%253A48%253A47Z%26se%3D2024-05-03T04%253A48%253A47Z%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-02T23%253A31%253A46Z%26ske%3D2024-05-03T23%253A31%253A46Z%26sks%3Db%26skv%3D2021-08-06%26sig%3DrAFYMxt0p8EbRDZUyRtsgfW%2FV%2Fwb1fdcNO8ojjcGPII%253D', | |
fit: BoxFit.cover, | |
), | |
), | |
), | |
SliverToBoxAdapter( | |
child: SizedBox( | |
height: 100.0, | |
child: ListView.builder( | |
scrollDirection: Axis.horizontal, | |
itemCount: 15, | |
itemBuilder: (BuildContext context, int index) { | |
return Container( | |
width: 100.0, | |
child: Card( | |
child: Center( | |
child: Icon(Icons.star, color: Colors.amber), | |
), | |
), | |
); | |
}, | |
), | |
), | |
), | |
SliverGrid( | |
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | |
crossAxisCount: 3, | |
childAspectRatio: 1.0, | |
mainAxisSpacing: 10.0, | |
crossAxisSpacing: 10.0, | |
), | |
delegate: SliverChildBuilderDelegate( | |
(BuildContext context, int index) { | |
return Container( | |
alignment: Alignment.center, | |
decoration: BoxDecoration( | |
color: Colors.white, | |
border: Border.all(color: Colors.grey, width: 0.5), | |
borderRadius: BorderRadius.circular(10), | |
), | |
child: Text('Item $index'), | |
); | |
}, | |
childCount: 15, | |
), | |
), | |
SliverToBoxAdapter( | |
child: Container( | |
padding: EdgeInsets.all(16.0), | |
child: Text( | |
'Featured Products', | |
style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold), | |
), | |
), | |
), | |
SliverList( | |
delegate: SliverChildBuilderDelegate( | |
(BuildContext context, int index) { | |
return ListTile( | |
leading: Image.network( | |
'https://corsproxy.io/?https%3A%2F%2Foaidalleapiprodscus.blob.core.windows.net%2Fprivate%2Forg-TUBHLKYl2lBqM1b7iE99XgMQ%2Fuser-UjOypK7HRZS7bCpwDOO1UgLB%2Fimg-nxl4vsx59gIgz0UiZ1uX7IYz.png%3Fst%3D2024-05-03T02%253A48%253A48Z%26se%3D2024-05-03T04%253A48%253A48Z%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-02T23%253A39%253A49Z%26ske%3D2024-05-03T23%253A39%253A49Z%26sks%3Db%26skv%3D2021-08-06%26sig%3DYXA1j08FuAXi35JtftkelYczdU7TpPaxxiXhlIMO36M%253D', | |
fit: BoxFit.cover, | |
), | |
title: Text('Product $index'), | |
subtitle: Text('This is a description of product $index.'), | |
trailing: Icon(Icons.shopping_cart), | |
); | |
}, | |
childCount: 15, | |
), | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment