Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:badges/badges.dart';
- import 'package:flutter/material.dart';
- import 'package:hexcolor/hexcolor.dart';
- class OrderPage extends StatelessWidget {
- final int sommePanier;
- final String image;
- final selectedProducts;
- final String orderPrix;
- const OrderPage(
- {Key key,
- this.sommePanier,
- this.image,
- this.selectedProducts,
- this.orderPrix})
- : super(key: key);
- @override
- Widget build(BuildContext context) {
- var width = MediaQuery.of(context).size.width;
- //var orderProduct = Provider.of<MyStore>(context);
- //var testCart = TestHomePage().of(context);
- double height = MediaQuery.of(context).size.height;
- return Scaffold(
- backgroundColor: Colors.white,
- appBar: AppBar(
- iconTheme: IconThemeData(color: Colors.black),
- title: Text(
- 'Delivecrous',
- style: TextStyle(
- color: Colors.black,
- fontWeight: FontWeight.w300,
- fontSize: 22,
- ),
- ),
- centerTitle: true,
- backgroundColor: HexColor('#FDF7EF'),
- elevation: 0.0,
- toolbarHeight: height * 0.10,
- actions: [
- Badge(
- position: BadgePosition.topEnd(top: 15, end: 0),
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 10),
- child: IconButton(
- icon: Icon(
- Icons.shopping_cart,
- size: 40,
- ),
- color: HexColor('130B11'),
- onPressed: () {
- /*Navigator.push(context,
- MaterialPageRoute(builder: (context) => RealHomePage()));*/
- },
- ),
- ),
- badgeContent: Text(
- sommePanier.toString(),
- style: TextStyle(color: Colors.white),
- ),
- badgeColor: HexColor('E33620'),
- ),
- ],
- ),
- body: Column(
- children: [
- Padding(
- padding:
- const EdgeInsets.symmetric(horizontal: 20.0, vertical: 15.0),
- child: Row(
- children: [
- Text(
- 'Panier',
- style: TextStyle(
- fontWeight: FontWeight.w300,
- fontSize: 30,
- ),
- textAlign: TextAlign.start,
- ),
- ],
- ),
- ),
- Flexible(
- child: GridView.count(
- childAspectRatio: MediaQuery.of(context).devicePixelRatio * 0.35,
- crossAxisCount: 2,
- children: List.generate(selectedProducts.length, (index) {
- //bool salut = selectedProducts.toList()[index].valeurBool;
- return Container(
- child: Align(
- alignment: Alignment.center,
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- //Text(selectedProducts.toList()[index].nomProduit.toString()),
- //Image.asset(selectedProducts.toList()[index].imageProduit),
- Card(
- elevation: 0.0,
- child: Container(
- width: width / 2,
- child: Card(
- child: Column(
- children: [
- Image.asset(selectedProducts
- .toList()[index]
- .imageProduit),
- Padding(
- padding: const EdgeInsets.only(
- left: 10.0, top: 10, right: 10),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Text(
- selectedProducts
- .toList()[index]
- .nomProduit
- .toString(),
- style: TextStyle(
- fontSize: 20,
- fontWeight: FontWeight.w300,
- ),
- ),
- Text(
- selectedProducts
- .toList()[index]
- .prix
- .toString() +
- '€',
- style: TextStyle(fontSize: 20),
- )
- ],
- ),
- ),
- SizedBox(
- height:
- MediaQuery.of(context).size.height *
- 0.01),
- Padding(
- padding: const EdgeInsets.only(
- top: 8.0, left: 10, bottom: 15),
- child: Text(
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
- style: TextStyle(
- fontWeight: FontWeight.w300,
- ),
- maxLines: 4,
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- );
- }),
- ),
- ),
- ],
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement