56 lines
1.7 KiB
Dart
56 lines
1.7 KiB
Dart
import 'package:cloud_firestore/cloud_firestore.dart';
|
|
import 'package:e_commerce/const/AppColors.dart';
|
|
import 'package:e_commerce/ui/detail_order.dart';
|
|
import 'package:e_commerce/widgets/fetchProducts.dart';
|
|
import 'package:firebase_auth/firebase_auth.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class Cart extends StatefulWidget {
|
|
@override
|
|
_CartState createState() => _CartState();
|
|
}
|
|
|
|
class _CartState extends State<Cart> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: SafeArea(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
height: MediaQuery.of(context).size.height / 1.5,
|
|
decoration: const BoxDecoration(
|
|
color: Colors.white,
|
|
),
|
|
child: fetchData("users-cart-items"),
|
|
),
|
|
const SizedBox(
|
|
height: 10.0,
|
|
),
|
|
ElevatedButton(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: AppColors.deep_orange,
|
|
shape: ContinuousRectangleBorder(
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
),
|
|
),
|
|
onPressed: () {
|
|
Navigator.push(context,
|
|
CupertinoPageRoute(builder: (_) => detail_order()));
|
|
},
|
|
child: const Text(
|
|
"Order Now",
|
|
style: TextStyle(fontSize: 16, color: Colors.white),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|