diff --git a/.gitignore b/.gitignore index 1ba9c33..c4c7ab6 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ app.*.map.json # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +android/key.properties diff --git a/.vscode/launch.json b/.vscode/launch.json index 0f0fd6c..62ecdbb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,16 +9,20 @@ "args": [ "-t", "lib/main-dev.dart", + "--flavor", + "dev" ], }, { - "name": "Flutter Dev2", + "name": "Flutter Pro", "request": "launch", "type": "dart", - "program": "lib/main-dev.dart", + "program": "lib/main-prod.dart", "args": [ "-t", - "lib/main-dev.dart", + "lib/main-prod.dart", + "--flavor", + "prod" ], }, ] diff --git a/android/app/build.gradle b/android/app/build.gradle index bf27151..6002305 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -24,6 +24,12 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + android { compileSdkVersion 28 @@ -32,20 +38,53 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.mokkon.fcs_dev.fcs" minSdkVersion 21 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName + multiDexEnabled true + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + + + flavorDimensions "app" + productFlavors { + prod { + dimension "app" + applicationId "com.mokkon.fcs" + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + dev { + dimension "app" + applicationId "com.mokkon.fcs.dev" + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + } + + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } } buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release + + minifyEnabled true + useProguard false + + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } + debug { + debuggable true + } + } } @@ -58,6 +97,9 @@ dependencies { androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' implementation 'com.android.support:multidex:1.0.3' + implementation 'com.google.firebase:firebase-analytics:17.5.0' implementation 'com.google.firebase:firebase-auth:19.0.0' implementation 'com.google.firebase:firebase-messaging:20.1.0' -} \ No newline at end of file +} + +apply plugin: 'com.google.gms.google-services' diff --git a/android/app/src/dev/AndroidManifest.xml b/android/app/src/dev/AndroidManifest.xml new file mode 100644 index 0000000..d269aae --- /dev/null +++ b/android/app/src/dev/AndroidManifest.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/dev/google-services.json b/android/app/src/dev/google-services.json new file mode 100644 index 0000000..c6afa35 --- /dev/null +++ b/android/app/src/dev/google-services.json @@ -0,0 +1,40 @@ +{ + "project_info": { + "project_number": "944560757353", + "firebase_url": "https://fcs-dev1.firebaseio.com", + "project_id": "fcs-dev1", + "storage_bucket": "fcs-dev1.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:944560757353:android:d21ae04e44e82f10fa60f8", + "android_client_info": { + "package_name": "com.mokkon.fcs.dev" + } + }, + "oauth_client": [ + { + "client_id": "944560757353-n44kricufdgign6ki6eu1fqvh7ppa29m.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyA3v2o4UqvL61fw8sVHer6pYU9tGiBagu8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "944560757353-n44kricufdgign6ki6eu1fqvh7ppa29m.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/dev/res/values/strings.xml b/android/app/src/dev/res/values/strings.xml new file mode 100644 index 0000000..7fc4de4 --- /dev/null +++ b/android/app/src/dev/res/values/strings.xml @@ -0,0 +1,4 @@ + + + FCS - Dev + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index e26cdfa..b7eb249 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -12,7 +12,7 @@ FlutterApplication and put your custom class here. --> + + FCS + diff --git a/android/build.gradle b/android/build.gradle index e0d7ae2..9234dae 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,7 +5,8 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:3.5.3' + classpath 'com.google.gms:google-services:4.3.3' } } diff --git a/android/proguard-rules.pro b/android/proguard-rules.pro new file mode 100644 index 0000000..70885bd --- /dev/null +++ b/android/proguard-rules.pro @@ -0,0 +1,7 @@ +## Flutter wrapper +-keep class io.flutter.app.** { *; } +-keep class io.flutter.plugin.** { *; } +-keep class io.flutter.util.** { *; } +-keep class io.flutter.view.** { *; } +-keep class io.flutter.** { *; } +-keep class io.flutter.plugins.** { *; } \ No newline at end of file diff --git a/assets/logo.png b/assets/logo.png index 6254dd0..96a4619 100644 Binary files a/assets/logo.png and b/assets/logo.png differ diff --git a/lib/main-dev.dart b/lib/main-dev.dart index cec96f1..050eee0 100644 --- a/lib/main-dev.dart +++ b/lib/main-dev.dart @@ -7,7 +7,7 @@ import 'app.dart'; void main() { Config( - flavor: Flavor.PRODUCTION, + flavor: Flavor.DEV, color: Colors.blue, apiURL: "https://asia-northeast1-mokkon-wholesale-dev.cloudfunctions.net/APIOK", diff --git a/lib/main-prod.dart b/lib/main-prod.dart new file mode 100644 index 0000000..7314fac --- /dev/null +++ b/lib/main-prod.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; +import 'package:logging/logging.dart'; +import 'package:fcs/config.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import 'app.dart'; + +void main() { + Config( + flavor: Flavor.PRODUCTION, + color: Colors.blue, + apiURL: + "https://asia-northeast1-mokkon-wholesale-dev.cloudfunctions.net/APIOK", + reportURL: "http://petrok-dev.mokkon.com:8080", + reportProjectID: "prod", + level: Level.ALL); + runApp(App()); +} diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 700e2b5..4b02747 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -8,6 +8,7 @@ import 'package:fcs/pages_fcs/delivery_list.dart'; import 'package:fcs/pages_fcs/package_list.dart'; import 'package:fcs/widget/bottom_up_page_route.dart'; import 'package:fcs/widget/localization/transalation.dart'; +import 'package:fcs/widget/right_left_page_route%20copy.dart'; import 'package:flutter/material.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; @@ -245,11 +246,8 @@ class _HomePageState extends State { ), IconButton( onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => Profile()), - ); + Navigator.of(context) + .push(RightLeftPageRoute(Profile())); }, iconSize: 30, icon: Icon(Icons.account_circle), @@ -326,35 +324,41 @@ class _HomePageState extends State { child: Column( children: [ Expanded( - child: ListView(children: [ - Wrap( - alignment: WrapAlignment.center, - children: widgets, - ), - ]), + child: Padding( + padding: const EdgeInsets.only(top: 8.0), + child: ListView(children: [ + Wrap( + alignment: WrapAlignment.center, + children: widgets, + ), + ]), + ), ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // _buildSmallButton( - // "Policies", FontAwesomeIcons.fileContract), - InkWell( - onTap: () { - Navigator.of(context).push( - MaterialPageRoute(builder: (_) => Contact())); - }, - child: _buildSmallButton( - "Contact Us", SimpleLineIcons.support), - ), - InkWell( - onTap: () { - Navigator.of(context).push( - MaterialPageRoute(builder: (_) => Term())); - }, - child: _buildSmallButton( - "Terms of service", Icons.info_outline), - ), - ], + Container( + height: 80, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // _buildSmallButton( + // "Policies", FontAwesomeIcons.fileContract), + InkWell( + onTap: () { + Navigator.of(context) + .push(BottomUpPageRoute(Contact())); + }, + child: _buildSmallButton( + "Contact Us", SimpleLineIcons.support), + ), + InkWell( + onTap: () { + Navigator.of(context) + .push(BottomUpPageRoute(Term())); + }, + child: _buildSmallButton( + "Terms of service", Icons.info_outline), + ), + ], + ), ) ], ))), @@ -463,20 +467,23 @@ class _HomePageState extends State { ), ), - FittedBox( - fit: BoxFit.fitWidth, - child: Text(AppTranslations.of(context).text(title), - style: languageModel.isEng - ? TextStyle( - color: Colors.white, - fontWeight: FontWeight.w500, - fontSize: 14.0, - fontFamily: "Roboto") - : TextStyle( - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: 12.0, - fontFamily: "MyanmarUnicode")), + Container( + height: 30, + child: FittedBox( + fit: BoxFit.fitWidth, + child: Text(AppTranslations.of(context).text(title), + style: languageModel.isEng + ? TextStyle( + color: Colors.white, + fontWeight: FontWeight.w500, + fontSize: 14.0, + fontFamily: "Roboto") + : TextStyle( + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: 12.0, + fontFamily: "MyanmarUnicode")), + ), ), ]), ), diff --git a/lib/widget/right_left_page_route copy.dart b/lib/widget/right_left_page_route copy.dart new file mode 100644 index 0000000..04adf51 --- /dev/null +++ b/lib/widget/right_left_page_route copy.dart @@ -0,0 +1,23 @@ +import 'package:flutter/cupertino.dart'; + +class RightLeftPageRoute extends PageRouteBuilder { + final Widget child; + + RightLeftPageRoute(this.child) + : super( + pageBuilder: (context, animation, secondaryAnimation) => child, + transitionsBuilder: (context, animation, secondaryAnimation, child) { + var begin = Offset(1.0, 0.0); + var end = Offset.zero; + var curve = Curves.ease; + + var tween = + Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); + + return SlideTransition( + position: animation.drive(tween), + child: child, + ); + }, + ); +} diff --git a/pubspec.lock b/pubspec.lock index bbce1c0..cffe47f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,7 +21,14 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.1" + version: "2.4.2" + barcode_scan: + dependency: "direct main" + description: + name: barcode_scan + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" boolean_selector: dependency: transitive description: @@ -36,6 +43,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.3+2" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" charcode: dependency: transitive description: @@ -57,13 +71,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.8.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" cloud_firestore: dependency: "direct main" description: name: cloud_firestore url: "https://pub.dartlang.org" source: hosted - version: "0.13.6" + version: "0.13.7" cloud_firestore_platform_interface: dependency: transitive description: @@ -84,21 +105,28 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.12" + version: "1.14.13" connectivity: dependency: "direct main" description: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "0.4.8+6" + version: "0.4.9+2" + connectivity_for_web: + dependency: transitive + description: + name: connectivity_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.1+2" connectivity_macos: dependency: transitive description: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.1.0+3" + version: "0.1.0+4" connectivity_platform_interface: dependency: transitive description: @@ -119,7 +147,7 @@ packages: name: country_code_picker url: "https://pub.dartlang.org" source: hosted - version: "1.3.15" + version: "1.4.0" country_icons: dependency: "direct main" description: @@ -133,7 +161,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.5" cupertino_icons: dependency: "direct main" description: @@ -147,21 +175,28 @@ packages: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "0.4.2+4" + version: "0.4.2+7" + device_info_platform_interface: + dependency: transitive + description: + name: device_info_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" dio: dependency: "direct main" description: name: dio url: "https://pub.dartlang.org" source: hosted - version: "3.0.9" + version: "3.0.10" dots_indicator: dependency: transitive description: name: dots_indicator url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" downloads_path_provider: dependency: "direct main" description: @@ -169,6 +204,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.0" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" faker: dependency: "direct main" description: @@ -183,6 +225,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.3" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.1" firebase: dependency: transitive description: @@ -232,6 +281,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.6" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.11" flutter: dependency: "direct main" description: flutter @@ -250,14 +306,14 @@ packages: name: flutter_datetime_picker url: "https://pub.dartlang.org" source: hosted - version: "1.3.8" + version: "1.4.0" flutter_downloader: dependency: "direct main" description: name: flutter_downloader url: "https://pub.dartlang.org" source: hosted - version: "1.4.4" + version: "1.5.0" flutter_icons: dependency: "direct main" description: @@ -284,6 +340,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.3.5" + flutter_pdfview: + dependency: "direct main" + description: + name: flutter_pdfview + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3+3" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -318,7 +381,7 @@ packages: name: flutter_staggered_grid_view url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.3.2" flutter_test: dependency: "direct dev" description: flutter @@ -358,7 +421,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.1" + version: "0.12.2" http_parser: dependency: "direct main" description: @@ -379,14 +442,14 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.1.12" + version: "2.1.14" image_picker: dependency: "direct main" description: name: image_picker url: "https://pub.dartlang.org" source: hosted - version: "0.6.7" + version: "0.6.7+7" image_picker_platform_interface: dependency: transitive description: @@ -407,14 +470,14 @@ packages: name: introduction_screen url: "https://pub.dartlang.org" source: hosted - version: "1.0.8" + version: "1.0.9" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.1+1" + version: "0.6.2" logging: dependency: "direct main" description: @@ -428,14 +491,14 @@ packages: name: markdown url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.8" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.8" meta: dependency: transitive description: @@ -449,7 +512,7 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.6+3" + version: "0.9.7" notus: dependency: transitive description: @@ -470,21 +533,28 @@ packages: name: package_info url: "https://pub.dartlang.org" source: hosted - version: "0.4.0+18" + version: "0.4.3" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" + version: "1.7.0" path_provider: dependency: "direct main" description: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.9" + version: "1.6.14" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+2" path_provider_macos: dependency: transitive description: @@ -498,7 +568,7 @@ packages: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" pedantic: dependency: transitive description: @@ -526,7 +596,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "3.0.4" photo_view: dependency: "direct main" description: @@ -540,7 +610,7 @@ packages: name: pin_input_text_field url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.0.5" platform: dependency: transitive description: @@ -562,6 +632,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.2" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.13" progress: dependency: "direct main" description: @@ -569,6 +646,13 @@ packages: relative: true source: path version: "0.0.1" + protobuf: + dependency: transitive + description: + name: protobuf + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" provider: dependency: "direct main" description: @@ -589,7 +673,7 @@ packages: name: qr url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" qr_flutter: dependency: "direct main" description: @@ -624,14 +708,21 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.7+3" + version: "0.5.10" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2+2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+9" + version: "0.0.1+10" shared_preferences_platform_interface: dependency: transitive description: @@ -664,7 +755,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.9.5" stream_channel: dependency: transitive description: @@ -692,7 +783,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.15" + version: "0.2.17" timeline_list: dependency: "direct main" description: @@ -706,14 +797,21 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.2.0" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.4.10" + version: "5.5.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+1" url_launcher_macos: dependency: transitive description: @@ -734,14 +832,14 @@ packages: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.1+6" + version: "0.1.2+1" uuid: dependency: "direct main" description: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.2.0" vector_math: dependency: transitive description: @@ -749,13 +847,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.6.1" + version: "4.2.0" yaml: dependency: transitive description: @@ -766,10 +871,12 @@ packages: zefyr: dependency: "direct main" description: - name: zefyr - url: "https://pub.dartlang.org" - source: hosted + path: "packages/zefyr" + ref: HEAD + resolved-ref: "20b890b7714fd54ccd0028da5b354d3d8ac68251" + url: "git://github.com/masewo/zefyr.git" + source: git version: "0.11.0" sdks: - dart: ">=2.7.0 <3.0.0" - flutter: ">=1.12.13+hotfix.6 <2.0.0" + dart: ">=2.9.0-14.0.dev <3.0.0" + flutter: ">=1.17.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index d6a6116..06777d8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,6 +41,10 @@ dependencies: photo_view: ^0.9.0 uuid: ^2.0.4 zefyr: + git: + url: git://github.com/masewo/zefyr.git + path: packages/zefyr + commit: 2e379982e97cc9b5aeb4fc0fcd85d6d32833f4ea flutter_signature_pad: ^2.0.0+1 path_provider: ^1.6.11 flutter_ringtone_player: ^2.0.0