Skip to content

Commit

Permalink
Merge pull request #854 from colinin/flutter
Browse files Browse the repository at this point in the history
feat(flutter): use local resource files to support localization
  • Loading branch information
colinin authored Aug 8, 2023
2 parents c7cb3a7 + ef4ae65 commit 2ee139c
Show file tree
Hide file tree
Showing 258 changed files with 6,348 additions and 1,446 deletions.
52 changes: 52 additions & 0 deletions apps/flutter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
.vscode/


# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

# Environment config
/res/config/development.json

# Business

business/
10 changes: 5 additions & 5 deletions apps/flutter/account/.flutter-plugins
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a generated file; do not edit or check into version control.
path_provider=%UserProfile%\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider-2.0.15\\
path_provider_android=%UserProfile%\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_android-2.0.27\\
path_provider_foundation=%UserProfile%\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_foundation-2.2.3\\
path_provider_linux=%UserProfile%\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_linux-2.1.11\\
path_provider_windows=%UserProfile%\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_windows-2.1.7\\
path_provider=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider-2.0.15\\
path_provider_android=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_android-2.0.27\\
path_provider_foundation=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_foundation-2.2.3\\
path_provider_linux=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_linux-2.1.11\\
path_provider_windows=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_windows-2.1.7\\
2 changes: 1 addition & 1 deletion apps/flutter/account/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_foundation-2.2.3\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_android-2.0.27\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_foundation-2.2.3\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-2.1.11\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_windows-2.1.7\\\\","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2023-07-14 11:41:46.248683","version":"3.10.5"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_foundation-2.2.3\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_android-2.0.27\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_foundation-2.2.3\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-2.1.11\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_windows-2.1.7\\\\","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2023-07-17 09:32:14.474983","version":"3.10.5"}
2 changes: 1 addition & 1 deletion apps/flutter/account/android/local.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sdk.dir=%UserProfile%\\AppData\\Local\\Android\\sdk
sdk.dir=C:\\Users\\eddlevol\\AppData\\Local\\Android\\sdk
flutter.sdk=D:\\Sdk\\Flutter
1 change: 0 additions & 1 deletion apps/flutter/account/lib/index.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export './interceptors/index.dart';
export './services/index.dart';
export 'account.module.dart';
1 change: 0 additions & 1 deletion apps/flutter/account/lib/interceptors/index.dart

This file was deleted.

21 changes: 0 additions & 21 deletions apps/flutter/account/lib/models/auth.dart

This file was deleted.

22 changes: 0 additions & 22 deletions apps/flutter/account/lib/models/auth.g.dart

This file was deleted.

6 changes: 0 additions & 6 deletions apps/flutter/account/lib/models/common.dart

This file was deleted.

12 changes: 5 additions & 7 deletions apps/flutter/account/lib/pages/login/controller.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import 'package:account/models/auth.dart';
import 'package:account/models/common.dart';
import 'package:account/pages/login/widget/portal_form.dart';
import 'package:core/index.dart';
import 'package:get/get.dart';
import 'state.dart';

class LoginController extends GetxController {
AuthService get authService => Get.find();
SessionService get sessionService => Get.find();
AuthService get authService => injector.get();
SessionService get sessionService => injector.get();

final Rx<LoginState> _state = Rx<LoginState>(LoginState(
loading: false,
Expand All @@ -28,7 +26,7 @@ class LoginController extends GetxController {

void showPortalLoginDialog() {
Get.defaultDialog(
title: 'Lable:LoginToPortal'.tr,
title: 'Label:LoginToPortal'.tr,
content: Obx(() => PortalForm(
portalProviders: state.portalProviders,
onSelected: portalLogin,
Expand All @@ -43,11 +41,11 @@ class LoginController extends GetxController {
val?.loading = true;
});
try {
var token = await authService.portal(PortalLoginParams(
await authService.portal(PortalLoginParams(
enterpriseId: provider?.id,
username: state.username.text,
password: state.password.text));
sessionService.refreshToken(token);
//sessionService.refreshToken(token);
state.username.clear();
state.password.clear();
Get.back(closeOverlays: true);
Expand Down
2 changes: 1 addition & 1 deletion apps/flutter/account/lib/pages/login/state.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:account/models/auth.dart';
import 'package:core/models/auth.dart';
import 'package:flutter/material.dart';

class LoginState {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:account/models/auth.dart';
import 'package:core/models/auth.dart';
import 'package:flutter/material.dart';

class PortalForm extends StatelessWidget {
Expand Down
3 changes: 2 additions & 1 deletion apps/flutter/account/lib/pages/user-info/controller.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'package:core/dependency/index.dart';
import 'package:core/models/auth.dart';
import 'package:core/services/index.dart';
import 'package:get/get.dart';
import 'state.dart';

class UserInfoController extends GetxController {
SessionService get sessionService => Get.find();
SessionService get sessionService => injector.get();

final Rx<UserInfoState> _state = Rx<UserInfoState>(UserInfoState());
UserInfoState get state => _state.value;
Expand Down
105 changes: 0 additions & 105 deletions apps/flutter/account/lib/services/auth.service.oauth.dart

This file was deleted.

1 change: 0 additions & 1 deletion apps/flutter/account/lib/services/index.dart
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
export 'auth.service.oauth.dart';
4 changes: 2 additions & 2 deletions apps/flutter/account/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ dependencies:
path: '../core'
components:
path: '../components'
dio:
get:
dio: ^5.2.0+1
get: ^4.6.5
json_annotation: ^4.8.1

dev_dependencies:
Expand Down
6 changes: 6 additions & 0 deletions apps/flutter/account_core/.flutter-plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This is a generated file; do not edit or check into version control.
path_provider=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider-2.0.15\\
path_provider_android=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_android-2.0.27\\
path_provider_foundation=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_foundation-2.2.4\\
path_provider_linux=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_linux-2.1.11\\
path_provider_windows=C:\\Users\\eddlevol\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_windows-2.1.7\\
1 change: 1 addition & 0 deletions apps/flutter/account_core/.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_foundation","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_android-2.0.27\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-2.1.11\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Users\\\\eddlevol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_windows-2.1.7\\\\","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2023-07-18 08:33:58.742879","version":"3.10.5"}
30 changes: 30 additions & 0 deletions apps/flutter/account_core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/
10 changes: 10 additions & 0 deletions apps/flutter/account_core/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 796c8ef79279f9c774545b3771238c3098dbefab
channel: stable

project_type: package
3 changes: 3 additions & 0 deletions apps/flutter/account_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
1 change: 1 addition & 0 deletions apps/flutter/account_core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO: Add your license here.
Loading

0 comments on commit 2ee139c

Please sign in to comment.