Skip to content

Commit

Permalink
cart 2 and ecommerce 4 screens
Browse files Browse the repository at this point in the history
  • Loading branch information
lohanidamodar committed Jan 21, 2020
1 parent 4c30832 commit 78000bf
Show file tree
Hide file tree
Showing 6 changed files with 446 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ The code for Springy Widget is taken and refactored from (https://github.com/mat

## Ecommerce

<img height="480px" src="screenshots/checkout1.png"> <img height="480px" src="screenshots/ecommerce_details3.png"> <img height="480px" src="screenshots/home_page1.png"> <img height="480px" src="screenshots/confirm_order1.png"> <img height="480px" src="screenshots/cart1.png"> <img height="480px" src="screenshots/ecommerce1.png"> <img height="480px" src="screenshots/ecommerce2.png"> <img height="480px" src="screenshots/ecommerce_detail1.png"> <img height="480px" src="screenshots/ecommerce_detail2.png">
<img height="480px" src="screenshots/cart2.png"> <img height="480px" src="screenshots/ecommerce4.png"> <img height="480px" src="screenshots/checkout1.png"> <img height="480px" src="screenshots/ecommerce_details3.png"> <img height="480px" src="screenshots/home_page1.png"> <img height="480px" src="screenshots/confirm_order1.png"> <img height="480px" src="screenshots/cart1.png"> <img height="480px" src="screenshots/ecommerce1.png"> <img height="480px" src="screenshots/ecommerce2.png"> <img height="480px" src="screenshots/ecommerce_detail1.png"> <img height="480px" src="screenshots/ecommerce_detail2.png">

## User Flow Screens

Expand Down
8 changes: 6 additions & 2 deletions lib/core/presentation/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import 'package:flutter_ui_challenges/src/pages/animations/anim5.dart';
import 'package:flutter_ui_challenges/src/pages/bike/bike_details.dart';
import 'package:flutter_ui_challenges/src/pages/bike/home_page.dart';
import 'package:flutter_ui_challenges/src/pages/blog/sports_news1.dart';
import 'package:flutter_ui_challenges/src/pages/ecommerce/cart2.dart';
import 'package:flutter_ui_challenges/src/pages/ecommerce/checkout1.dart';
import 'package:flutter_ui_challenges/src/pages/ecommerce/ecommerce4.dart';
import 'package:flutter_ui_challenges/src/pages/invitation/inauth.dart';
import 'package:flutter_ui_challenges/src/pages/invitation/inlanding.dart';
import 'package:flutter_ui_challenges/src/pages/invitation/invitation1.dart';
Expand Down Expand Up @@ -163,6 +165,10 @@ final List<dynamic> pages = [
SubMenuItem("Details Page", InvitationPageOne(), path: InvitationPageOne.path),
]),
MenuItem(title: "Ecommerce", icon: Icons.shopping_basket, items: [
SubMenuItem("Cart Two", CartTwoPage(),
path: CartTwoPage.path),
SubMenuItem("Ecommerce Four", EcommerceFourPage(),
path: EcommerceFourPage.path),
SubMenuItem("Checkout One", CheckoutOnePage(),
path: CheckoutOnePage.path),
SubMenuItem("Ecommerce One", EcommerceOnePage(),
Expand All @@ -173,8 +179,6 @@ final List<dynamic> pages = [
path: SliverAppbarPage.path),
SubMenuItem("Ecommerce Grocery", EcommerceFivePage(),
path: EcommerceFivePage.path),
// SubMenuItem("Ecommerce Four", EcommerceFourPage(),
// path: EcommerceFourPage.path),
SubMenuItem("Confirm Order", ConfirmOrderPage(),
path: ConfirmOrderPage.path),
SubMenuItem("Ecommerce Cart One", CartOnePage(), path: CartOnePage.path),
Expand Down
219 changes: 219 additions & 0 deletions lib/src/pages/ecommerce/cart2.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_ui_challenges/core/presentation/widgets/rounded_bordered_container.dart';
import 'package:flutter_ui_challenges/src/pages/animations/animation1/animation1.dart';

class CartTwoPage extends StatelessWidget {
static final String path = "lib/src/pages/ecommerce/cart2.dart";
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('My Cart'),
),
body: Column(
children: <Widget>[
Flexible(
child: ListView.builder(
itemCount: 6,
itemBuilder: (context, int index) {
return cartItems(index);
},
),
),
_checkoutSection()
],
));
}

Widget cartItems(int index) {
return RoundedContainer(
padding: const EdgeInsets.all(0),
margin: EdgeInsets.all(10),
height: 130,
child: Row(
children: <Widget>[
Container(
width: 130,
decoration: BoxDecoration(
image: DecorationImage(
image: CachedNetworkImageProvider(images[1]),
fit: BoxFit.cover,
)
),
),
Flexible(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Flexible(
child: Text(
"Item 1" + index.toString(),
overflow: TextOverflow.fade,
softWrap: true,
style: TextStyle(
fontWeight: FontWeight.w600, fontSize: 15),
),
),
Container(
width: 50,
child: IconButton(
onPressed: () {
print("Button Pressed");
},
color: Colors.red,
icon: Icon(Icons.delete),
iconSize: 20,
),
)
],
),
Row(
children: <Widget>[
Text("Price: "),
SizedBox(
width: 5,
),
Text(
'\$200',
style: TextStyle(
fontSize: 16, fontWeight: FontWeight.w300),
)
],
),
Row(
children: <Widget>[
Text("Sub Total: "),
SizedBox(
width: 5,
),
Text('\$400',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w300,
color: Colors.orange,
))
],
),
Row(
children: <Widget>[
Text(
"Ships Free",
style: TextStyle(color: Colors.orange),
),
Spacer(),
Row(
children: <Widget>[
InkWell(
onTap: () {},
splashColor: Colors.redAccent.shade200,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50)),
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.all(6.0),
child: Icon(
Icons.remove,
color: Colors.redAccent,
size: 20,
),
),
),
),
SizedBox(
width: 4,
),
Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text('2'),
),
),
SizedBox(
width: 4,
),
InkWell(
onTap: () {},
splashColor: Colors.lightBlue,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50)),
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.all(6.0),
child: Icon(
Icons.add,
color: Colors.green,
size: 20,
),
),
),
),
],
)
],
),
],
),
),
)
],
),
);
}

Widget _checkoutSection() {
return Material(
color: Colors.black12,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 10, left: 10, right: 10),
child: Row(
children: <Widget>[
Text(
"Checkout Price:",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w400),
),
Spacer(),
Text(
"Rs. 5000",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
)
],
)),
Padding(
padding: const EdgeInsets.all(10.0),
child: Material(
color: Colors.red,
elevation: 1.0,
child: InkWell(
splashColor: Colors.redAccent,
onTap: () {},
child: Container(
width: double.infinity,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Text(
"Checkout",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.w700),
),
),
),
),
),
),
],
),
);
}
}
Loading

0 comments on commit 78000bf

Please sign in to comment.