Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() {
- runApp(MyStoreApp());
- }
- class MyStoreApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'My Store',
- theme: ThemeData(
- primarySwatch: Colors.blue,
- ),
- home: MyHomePage(),
- );
- }
- }
- class MyHomePage extends StatefulWidget {
- @override
- _MyHomePageState createState() => _MyHomePageState();
- }
- class _MyHomePageState extends State<MyHomePage> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text('My Store'),
- ),
- body: Column(
- children: [
- // Add your categories and products here as widgets
- // For example:
- // Category(title: 'Apparel'),
- // Product(title: 'Ankle Boots', price: 49.99),
- ],
- ),
- bottomNavigationBar: BottomAppBar(
- shape: CircularNotchedRectangle(),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- IconButton(icon: Icon(Icons.search), onPressed: () {}),
- IconButton(icon: Icon(Icons.shopping_cart), onPressed: () {}),
- IconButton(icon: Icon(Icons.person), onPressed: () {}),
- ],
- ),
- ),
- floatingActionButton: FloatingActionButton(
- onPressed: () {},
- tooltip: 'Add to cart',
- child: Icon(Icons.add),
- ),
- );
- }
- }
- class Category extends StatelessWidget {
- final String title;
- const Category({Key key, this.title}) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.all(8.0),
- child: Text(title),
- );
- }
- }
- class Product extends StatelessWidget {
- final String title;
- final double price;
- const Product({Key key, this.title, this.price}) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return Card(
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- Text(title),
- Text('\$$price'),
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement