Skip to content
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

Ec 78 update UI for order #16

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
bdcd889
Update gradle configs for build android
pdax-manmai May 14, 2022
faef926
Add packages
pdax-manmai May 16, 2022
caf9a6e
Add base setup for Getx
pdax-manmai May 16, 2022
32b2db9
Add login and verify user when open app
pdax-manmai May 17, 2022
068c2e8
Add auth service
pdax-manmai May 21, 2022
aee9ce6
Merge pull request #1 from maimand/EC-38-integrate-api-authentication
maimand May 21, 2022
350447a
Add reset password
pdax-manmai May 21, 2022
782143d
Fix wrong behaviour
pdax-manmai May 21, 2022
2fba81d
Get user info when login successfully
pdax-manmai May 21, 2022
d0d43da
Add address page
pdax-manmai May 21, 2022
54f7ca2
Merge pull request #2 from maimand/EC-40-integrate-api-profile
maimand May 21, 2022
342e466
Add product and category provider and repository
maimand May 25, 2022
a33a2d5
Rename product and category model
maimand May 25, 2022
cfbff88
Implement category screen
maimand May 25, 2022
ef58e33
Update product and refactoring
maimand May 28, 2022
92d1499
Merge pull request #3 from maimand/EC-60-get-list-products
maimand May 28, 2022
d620a97
Add search product and product detail
maimand May 28, 2022
08087e0
Merge pull request #4 from maimand/EC-61-search-products-category
maimand May 28, 2022
ae9bb95
Refactor home view
maimand May 28, 2022
048f439
Update profile screen
maimand May 28, 2022
1a5051a
Update splash screen
maimand May 28, 2022
2ba883f
Add provider and repository for cart
maimand May 28, 2022
686cb80
Update cart flow
maimand May 28, 2022
d648256
Add product to cart, add loading
maimand May 29, 2022
a3086d0
Update purchase flow
maimand Jun 1, 2022
d56f188
Fix product get issue
maimand Jun 2, 2022
4301c0f
Fix address issues
maimand Jun 2, 2022
afb283d
Check out cart to order
maimand Jun 3, 2022
f68bb55
Complete order flow
maimand Jun 3, 2022
b943ea5
Merge pull request #5 from maimand/EC-56-cart-integrate-api
maimand Jun 3, 2022
986adc5
Merge pull request #6 from maimand/EC-55-order-integrate-api
maimand Jun 3, 2022
9cda588
Add make payment to order
maimand Jun 3, 2022
43893a4
Complete order flow
maimand Jun 4, 2022
34758b2
Update your order page
maimand Jun 5, 2022
aa0c6ae
Integrate webview to pay with paypal
maimand Jun 7, 2022
4b70409
Merge pull request #7 from maimand/EC-3-payment-integrate-api
maimand Jun 7, 2022
d864b4f
Add cart button for search and product detail
maimand Jun 7, 2022
ef82ede
Update search
maimand Jun 9, 2022
67e5cfd
Update UI for product_card
maimand Jun 9, 2022
bafe442
Merge pull request #8 from maimand/EC-77-search-product-by-keyword
maimand Jun 12, 2022
cc2a764
Add item for home views
pdax-manmai Jun 14, 2022
1f66c1d
Merge pull request #9 from maimand/EC-39-integrate-api-home
maimand Jun 14, 2022
8785705
Merge branch 'master' into EC-82-add-cart-item-to-go-to-cart-in-produ…
maimand Jun 14, 2022
1256915
Merge pull request #10 from maimand/EC-82-add-cart-item-to-go-to-cart…
maimand Jun 14, 2022
22ec2e9
Fix some isssues
pdax-manmai Jun 14, 2022
0e9ca53
Fix bugs
pdax-manmai Jun 16, 2022
bbbd534
Add merchant page
pdax-manmai Jun 16, 2022
0c0c1e6
Fix bug in merchant view
pdax-manmai Jun 16, 2022
106a61e
Update UI for order list and order detail view
pdax-manmai Jun 16, 2022
0b01e7a
Fix flow app
pdax-manmai Jun 19, 2022
fce6c57
Refactor code
pdax-manmai Jun 19, 2022
c9f54ec
Update UI for product_card
pdax-manmai Jun 21, 2022
f90d104
Fix address
pdax-manmai Jun 21, 2022
3d0e209
Fix address
pdax-manmai Jun 21, 2022
86318c7
Add review and merchant
pdax-manmai Jun 22, 2022
a897884
Add payment for cart
pdax-manmai Jun 22, 2022
0db8615
Fix bugs
pdax-manmai Jun 23, 2022
b2c87a1
Fix bugs
pdax-manmai Jun 23, 2022
dad7f34
Update tab orders
pdax-manmai Jun 23, 2022
90a9a44
Update category view
pdax-manmai Jun 23, 2022
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
1 change: 1 addition & 0 deletions .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_ios","path":"D:\\\\Flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_ios-2.0.9\\\\","dependencies":[]},{"name":"webview_flutter_wkwebview","path":"D:\\\\Flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\webview_flutter_wkwebview-2.7.5\\\\","dependencies":[]}],"android":[{"name":"path_provider_android","path":"D:\\\\Flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_android-2.0.14\\\\","dependencies":[]},{"name":"webview_flutter_android","path":"D:\\\\Flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\webview_flutter_android-2.8.10\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\Flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.6\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\Flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.6\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\Flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.6\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2022-06-23 15:27:58.328689","version":"2.10.4"}
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (keystorePropertiesFile.exists()) {
}

android {
compileSdkVersion 28
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -45,8 +45,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.int2.ecommerce_int2"
minSdkVersion 16
targetSdkVersion 28
minSdkVersion 19
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
7 changes: 4 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>

</manifest>
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
18 changes: 0 additions & 18 deletions ios/Flutter/Flutter.podspec

This file was deleted.

11 changes: 5 additions & 6 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/macbooki9/Documents/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/macbooki9/Documents/personal/flutter_ecommerce_template"
export "FLUTTER_ROOT=D:\Flutter\flutter_windows_1.22.5-stable\flutter"
export "FLUTTER_APPLICATION_PATH=D:\Workspace\Flutter\do-an\flutter_ecommerce_template"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=/Users/macbooki9/Documents/personal/flutter_ecommerce_template/lib/main.dart"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.1"
export "FLUTTER_BUILD_NUMBER=1.0.1"
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=/Users/macbooki9/Documents/personal/flutter_ecommerce_template/.dart_tool/package_config.json"
export "PACKAGE_CONFIG=.packages"
36 changes: 36 additions & 0 deletions lib/data/models/address.model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class Address {
String? id;
String? address;
String? city;
String? country;
String? zipCode;
bool? isDefault;

Address(
{this.id,
this.address,
this.city,
this.country = "Viet Name",
this.zipCode = "+84",
this.isDefault = false});

Address.fromJson(Map<String, dynamic> json) {
id = json['_id'];
address = json['address'];
city = json['city'];
country = json['country'];
zipCode = json['zipCode'];
isDefault = json['isDefault'] ?? false;
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['address'] = this.address;
data['city'] = this.city;
data['country'] = this.country;
data['zipCode'] = this.zipCode;
data['isDefault'] = this.isDefault;
return data;
}
}
83 changes: 83 additions & 0 deletions lib/data/models/cart.model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import 'package:ecommerce_int2/data/models/product.model.dart';

class CartResponse {
bool? success;
String? message;
List<CartModel>? data;

CartResponse({this.success, this.message, this.data});

CartResponse.fromJson(Map<String, dynamic> json) {
success = json['success'];
message = json['message'];
if (json['data'] != null) {
data = <CartModel>[];
json['data'].forEach((v) {
data!.add(new CartModel.fromJson(v));
});
}
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['success'] = this.success;
data['message'] = this.message;
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
return data;
}
}

class CartModel {
String? sId;
List<Product>? products;
String? user;
String? merchant;
int? total;
bool? isOrdered;
String? created;
int? iV;

CartModel(
{this.sId,
this.products,
this.user,
this.merchant,
this.total,
this.isOrdered,
this.created,
this.iV});

CartModel.fromJson(Map<String, dynamic> json) {
sId = json['_id'];
if (json['products'] != null) {
products = <Product>[];
json['products'].forEach((v) {
products!.add(new Product.fromJson(v));
});
}
user = json['user'];
merchant = json['merchant'] != null ?
(json['merchant'] is String? ? json['merchant'] : json['merchant']['_id']) : '';
total = json['total'];
isOrdered = json['isOrdered'];
created = json['created'];
iV = json['__v'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.sId;
if (this.products != null) {
data['products'] = this.products!.map((v) => v.toJson()).toList();
}
data['user'] = this.user;
data['merchant'] = this.merchant;
data['total'] = this.total;
data['isOrdered'] = this.isOrdered;
data['created'] = this.created;
data['__v'] = this.iV;
return data;
}
}
100 changes: 100 additions & 0 deletions lib/data/models/category.model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
class CategoryList {
List<Category>? data;

CategoryList({this.data});

CategoryList.fromJson(Map<String, dynamic> json) {
if (json['data'] != null) {
data = <Category>[];
json['data'].forEach((v) {
data!.add(new Category.fromJson(v));
});
}
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
return data;
}
}

class Category {
String? id;
String? name;
String? description;
List<SubCategory>? subcategories;

Category({this.id, this.name, this.description, this.subcategories});

Category.fromJson(Map<String, dynamic> json) {
id = json['_id'];
name = json['name'];
description = json['description'];
if (json['subcategories'] != null) {
subcategories = <SubCategory>[];
json['subcategories'].forEach((v) {
subcategories!.add(new SubCategory.fromJson(v));
});
}
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.id;
data['name'] = this.name;
data['description'] = this.description;
if (this.subcategories != null) {
data['subcategories'] =
this.subcategories!.map((v) => v.toJson()).toList();
}
return data;
}
}

class SubCategory {
String? sId;
String? name;
String? description;
bool? isActive;
String? category;
String? created;
String? slug;
int? iV;

SubCategory(
{this.sId,
this.name,
this.description,
this.isActive,
this.category,
this.created,
this.slug,
this.iV});

SubCategory.fromJson(Map<String, dynamic> json) {
sId = json['_id'];
name = json['name'];
description = json['description'];
isActive = json['isActive'];
category = json['category'];
created = json['created'];
slug = json['slug'];
iV = json['__v'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.sId;
data['name'] = this.name;
data['description'] = this.description;
data['isActive'] = this.isActive;
data['category'] = this.category;
data['created'] = this.created;
data['slug'] = this.slug;
data['__v'] = this.iV;
return data;
}
}
18 changes: 18 additions & 0 deletions lib/data/models/login.result.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:ecommerce_int2/data/models/user.model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'login.result.g.dart';

@JsonSerializable(explicitToJson: true)
class LoginResult {
final String token;
final bool success;
final UserModel data;

LoginResult(this.token, this.success, this.data);


factory LoginResult.fromJson(Map<String, dynamic> json) =>
_$LoginResultFromJson(json);

Map<String, dynamic> toJson() => _$LoginResultToJson(this);
}
22 changes: 22 additions & 0 deletions lib/data/models/login.result.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading