Skip to content

Jinal Gulhane #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Binary file added assets/images/cappuccino.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/latte.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"hosting": {
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"flutter": {
"platforms": {
"dart": {
"lib/firebase_options.dart": {
"projectId": "sharekhan-prj",
"configurations": {
"web": "1:255918967492:web:c95765475abe4f1efed791"
}
}
}
}
}
}

98 changes: 94 additions & 4 deletions lib/app/modules/cart/views/cart_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:get_flutter_fire/app/routes/app_pages.dart';
import '../../../widgets/screen_widget.dart';
import '../../../../services/auth_service.dart';
import '../controllers/cart_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../widgets/screen_widget.dart';
import '../../../../services/auth_service.dart';
import '../controllers/cart_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_flutter_fire/app/routes/app_pages.dart';
import '../../../widgets/screen_widget.dart';
Expand All @@ -8,20 +19,99 @@ import '../controllers/cart_controller.dart';

class CartView extends GetView<CartController> {
const CartView({super.key});

@override
Widget build(BuildContext context) {
return ScreenWidget(
appBar: AppBar(
title: Text('${AuthService.to.userName} Cart'),
centerTitle: true,
),
body: const Center(
child: Text(
'CartView is working',
style: TextStyle(fontSize: 20),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Your Cart',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.brown,
),
),
const SizedBox(height: 20),
Expanded(
child: ListView(
children: [
_buildCartItem('Cappuccino', 'Rich and creamy with a smooth finish.', Icons.coffee),
const SizedBox(height: 10),
_buildCartItem('Latte', 'Smooth and creamy, perfect for a relaxing afternoon.', Icons.coffee_maker),
],
),
),
],
),
),
screen: screen!,
);
}

Widget _buildCartItem(String title, String description, IconData icon) {
return Container(
padding: const EdgeInsets.all(12.0),
decoration: BoxDecoration(
color: Colors.orange.shade50,
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: Colors.grey.shade300,
blurRadius: 4,
offset: const Offset(0, 4),
),
],
),
child: Row(
children: [
Container(
width: 60,
height: 60,
decoration: BoxDecoration(
color: Colors.orange.shade100,
borderRadius: BorderRadius.circular(10),
),
child: Icon(
icon,
size: 30,
color: Colors.brown.shade600,
),
),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.brown.shade700,
),
),
const SizedBox(height: 5),
Text(
description,
style: TextStyle(
fontSize: 14,
color: Colors.brown.shade500,
),
),
],
),
),
],
),
);
}
}
158 changes: 152 additions & 6 deletions lib/app/modules/checkout/views/checkout_view.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,168 @@
import 'package:flutter/material.dart';

import 'package:get/get.dart';

import '../controllers/checkout_controller.dart';

class CheckoutView extends GetView<CheckoutController> {
const CheckoutView({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('CheckoutView'),
title: const Text('Checkout'),
centerTitle: true,
),
body: const Center(
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Checkout Summary',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.brown,
),
),
const SizedBox(height: 20),
Expanded(
child: ListView(
children: [
_buildCheckoutItem('Cappuccino', 'Rich and creamy with a smooth finish.', Icons.coffee),
const SizedBox(height: 10),
_buildCheckoutItem('Latte', 'Smooth and creamy, perfect for a relaxing afternoon.', Icons.coffee_maker),
const SizedBox(height: 20),
_buildTotalAmount(),
],
),
),
_buildCheckoutButton(),
],
),
),
);
}

Widget _buildCheckoutItem(String title, String description, IconData icon) {
return Container(
padding: const EdgeInsets.all(12.0),
decoration: BoxDecoration(
color: Colors.orange.shade50,
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: Colors.grey.shade300,
blurRadius: 4,
offset: const Offset(0, 4),
),
],
),
child: Row(
children: [
Container(
width: 60,
height: 60,
decoration: BoxDecoration(
color: Colors.orange.shade100,
borderRadius: BorderRadius.circular(10),
),
child: Icon(
icon,
size: 30,
color: Colors.brown.shade600,
),
),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.brown.shade700,
),
),
const SizedBox(height: 5),
Text(
description,
style: TextStyle(
fontSize: 14,
color: Colors.brown.shade500,
),
),
],
),
),
],
),
);
}

Widget _buildTotalAmount() {
// Placeholder amount
final totalAmount = '\$20.00';

return Container(
padding: const EdgeInsets.all(12.0),
decoration: BoxDecoration(
color: Colors.orange.shade50,
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: Colors.grey.shade300,
blurRadius: 4,
offset: const Offset(0, 4),
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Total Amount',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.brown.shade700,
),
),
Text(
totalAmount,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.brown.shade700,
),
),
],
),
);
}

Widget _buildCheckoutButton() {
return Padding(
padding: const EdgeInsets.only(top: 20.0),
child: ElevatedButton(
onPressed: () {
// Handle checkout logic
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.orange,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
),
child: Text(
'CheckoutView is working',
style: TextStyle(fontSize: 20),
'Complete Purchase',
style: TextStyle(
fontSize: 16,
color: Colors.white,
),
),
),
);
Expand Down
Loading