Browse Source

feat(flutter): use local resource files to support localization

pull/854/head
colin 2 years ago
parent
commit
ef4ae65be9
  1. 52
      apps/flutter/.gitignore
  2. 10
      apps/flutter/account/.flutter-plugins
  3. 2
      apps/flutter/account/.flutter-plugins-dependencies
  4. 2
      apps/flutter/account/android/local.properties
  5. 1
      apps/flutter/account/lib/index.dart
  6. 1
      apps/flutter/account/lib/interceptors/index.dart
  7. 21
      apps/flutter/account/lib/models/auth.dart
  8. 22
      apps/flutter/account/lib/models/auth.g.dart
  9. 6
      apps/flutter/account/lib/models/common.dart
  10. 12
      apps/flutter/account/lib/pages/login/controller.dart
  11. 2
      apps/flutter/account/lib/pages/login/state.dart
  12. 2
      apps/flutter/account/lib/pages/login/widget/portal_form.dart
  13. 3
      apps/flutter/account/lib/pages/user-info/controller.dart
  14. 105
      apps/flutter/account/lib/services/auth.service.oauth.dart
  15. 1
      apps/flutter/account/lib/services/index.dart
  16. 1
      apps/flutter/account/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux
  17. 4
      apps/flutter/account/pubspec.yaml
  18. 6
      apps/flutter/account_core/.flutter-plugins
  19. 1
      apps/flutter/account_core/.flutter-plugins-dependencies
  20. 30
      apps/flutter/account_core/.gitignore
  21. 10
      apps/flutter/account_core/.metadata
  22. 3
      apps/flutter/account_core/CHANGELOG.md
  23. 1
      apps/flutter/account_core/LICENSE
  24. 39
      apps/flutter/account_core/README.md
  25. 4
      apps/flutter/account_core/analysis_options.yaml
  26. 25
      apps/flutter/account_core/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
  27. 2
      apps/flutter/account_core/android/local.properties
  28. 14
      apps/flutter/account_core/ios/Flutter/Generated.xcconfig
  29. 13
      apps/flutter/account_core/ios/Flutter/flutter_export_environment.sh
  30. 19
      apps/flutter/account_core/ios/Runner/GeneratedPluginRegistrant.h
  31. 21
      apps/flutter/account_core/ios/Runner/GeneratedPluginRegistrant.m
  32. 5
      apps/flutter/account_core/lib/account.core.module.dart
  33. 1
      apps/flutter/account_core/lib/index.dart
  34. 0
      apps/flutter/account_core/lib/models/common.dart
  35. 89
      apps/flutter/account_core/lib/models/profile.dto.dart
  36. 84
      apps/flutter/account_core/lib/models/profile.dto.g.dart
  37. 1
      apps/flutter/account_core/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux
  38. 11
      apps/flutter/account_core/linux/flutter/generated_plugin_registrant.cc
  39. 15
      apps/flutter/account_core/linux/flutter/generated_plugin_registrant.h
  40. 23
      apps/flutter/account_core/linux/flutter/generated_plugins.cmake
  41. 11
      apps/flutter/account_core/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
  42. 12
      apps/flutter/account_core/macos/Flutter/ephemeral/flutter_export_environment.sh
  43. 62
      apps/flutter/account_core/pubspec.yaml
  44. 11
      apps/flutter/account_core/windows/flutter/generated_plugin_registrant.cc
  45. 15
      apps/flutter/account_core/windows/flutter/generated_plugin_registrant.h
  46. 23
      apps/flutter/account_core/windows/flutter/generated_plugins.cmake
  47. 10
      apps/flutter/components/.flutter-plugins
  48. 2
      apps/flutter/components/.flutter-plugins-dependencies
  49. 2
      apps/flutter/components/android/local.properties
  50. 7
      apps/flutter/components/lib/components.module.dart
  51. 3
      apps/flutter/components/lib/config/avatar.config.dart
  52. 1
      apps/flutter/components/lib/config/index.dart
  53. 2
      apps/flutter/components/lib/index.dart
  54. 1
      apps/flutter/components/lib/pages/index.dart
  55. 8
      apps/flutter/components/lib/pages/widget.base.dart
  56. 17
      apps/flutter/components/lib/widgets/avatar/index.dart
  57. 86
      apps/flutter/components/lib/widgets/back-to-top/index.dart
  58. 1
      apps/flutter/components/lib/widgets/index.dart
  59. 1
      apps/flutter/components/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux
  60. 2
      apps/flutter/components/pubspec.yaml
  61. 10
      apps/flutter/core/.flutter-plugins
  62. 2
      apps/flutter/core/.flutter-plugins-dependencies
  63. 2
      apps/flutter/core/android/local.properties
  64. 1
      apps/flutter/core/lib/abstracts/index.dart
  65. 84
      apps/flutter/core/lib/abstracts/signalr.service.dart
  66. 107
      apps/flutter/core/lib/config/env.config.dart
  67. 51
      apps/flutter/core/lib/config/env.config.g.dart
  68. 1
      apps/flutter/core/lib/config/index.dart
  69. 33
      apps/flutter/core/lib/core.module.dart
  70. 1
      apps/flutter/core/lib/dependency/index.dart
  71. 5
      apps/flutter/core/lib/dependency/injector.builder.dart
  72. 22
      apps/flutter/core/lib/dependency/injector.dart
  73. 1
      apps/flutter/core/lib/index.dart
  74. 6
      apps/flutter/core/lib/interceptors/api.authorization.interceptor.dart
  75. 2
      apps/flutter/core/lib/interceptors/api.logger.interceptor.dart
  76. 3
      apps/flutter/core/lib/interceptors/api.wrapper.result.interceptor.dart
  77. 1
      apps/flutter/core/lib/interceptors/index.dart
  78. 431
      apps/flutter/core/lib/models/abp.dto.dart
  79. 627
      apps/flutter/core/lib/models/abp.dto.g.dart
  80. 3
      apps/flutter/core/lib/models/abp.entity.dart
  81. 34
      apps/flutter/core/lib/models/auth.dart
  82. 4
      apps/flutter/core/lib/models/auth.g.dart
  83. 27
      apps/flutter/core/lib/models/common.dart
  84. 342
      apps/flutter/core/lib/models/environment.dart
  85. 178
      apps/flutter/core/lib/models/environment.g.dart
  86. 2
      apps/flutter/core/lib/models/index.dart
  87. 20
      apps/flutter/core/lib/models/request.dart
  88. 1
      apps/flutter/core/lib/models/session.dart
  89. 56
      apps/flutter/core/lib/modularity/module.dart
  90. 15
      apps/flutter/core/lib/proxy/lingyun/abp/asp-net-core/mvc/localization/language.service.dart
  91. 14
      apps/flutter/core/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.dart
  92. 16
      apps/flutter/core/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.dart
  93. 14
      apps/flutter/core/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service.dart
  94. 20
      apps/flutter/core/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/abp-tenant.service.dart
  95. 5
      apps/flutter/core/lib/services/application.initial.dart
  96. 14
      apps/flutter/core/lib/services/auth.service.dart
  97. 27
      apps/flutter/core/lib/services/config.state.service.dart
  98. 49
      apps/flutter/core/lib/services/environment.service.dart
  99. 14
      apps/flutter/core/lib/services/error.reporter.service.dart
  100. 5
      apps/flutter/core/lib/services/index.dart

52
apps/flutter/.gitignore

@ -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
apps/flutter/account/.flutter-plugins

@ -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
apps/flutter/account/.flutter-plugins-dependencies

@ -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
apps/flutter/account/android/local.properties

@ -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
apps/flutter/account/lib/index.dart

@ -1,3 +1,2 @@
export './interceptors/index.dart';
export './services/index.dart';
export 'account.module.dart';

1
apps/flutter/account/lib/interceptors/index.dart

@ -1 +0,0 @@
export 'oauth.api.interceptor.dart';

21
apps/flutter/account/lib/models/auth.dart

@ -1,21 +0,0 @@
import 'package:json_annotation/json_annotation.dart';
part 'auth.g.dart';
@JsonSerializable()
class PortalLoginProvider {
PortalLoginProvider({
required this.id,
required this.name,
this.logo,
});
@JsonKey(name: 'Id')
String id;
@JsonKey(name: 'Name')
String name;
@JsonKey(name: 'Logo')
String? logo;
factory PortalLoginProvider.fromJson(Map<String, dynamic> json) => _$PortalLoginProviderFromJson(json);
Map<String, dynamic> toJson() => _$PortalLoginProviderToJson(this);
}

22
apps/flutter/account/lib/models/auth.g.dart

@ -1,22 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'auth.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PortalLoginProvider _$PortalLoginProviderFromJson(Map<String, dynamic> json) =>
PortalLoginProvider(
id: json['Id'] as String,
name: json['Name'] as String,
logo: json['Logo'] as String?,
);
Map<String, dynamic> _$PortalLoginProviderToJson(
PortalLoginProvider instance) =>
<String, dynamic>{
'Id': instance.id,
'Name': instance.name,
'Logo': instance.logo,
};

6
apps/flutter/account/lib/models/common.dart

@ -1,6 +0,0 @@
import 'auth.dart';
class PortalLoginException implements Exception {
PortalLoginException(this.providers);
List<PortalLoginProvider> providers;
}

12
apps/flutter/account/lib/pages/login/controller.dart

@ -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,
@ -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,
@ -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);

2
apps/flutter/account/lib/pages/login/state.dart

@ -1,4 +1,4 @@
import 'package:account/models/auth.dart';
import 'package:core/models/auth.dart';
import 'package:flutter/material.dart';
class LoginState {

2
apps/flutter/account/lib/pages/login/widget/portal_form.dart

@ -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 {

3
apps/flutter/account/lib/pages/user-info/controller.dart

@ -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;

105
apps/flutter/account/lib/services/auth.service.oauth.dart

@ -1,105 +0,0 @@
import 'dart:convert';
import 'package:account/models/auth.dart';
import 'package:account/models/common.dart';
import 'package:core/models/auth.dart';
import 'package:core/models/oauth.dart';
import 'package:core/services/index.dart';
import 'package:core/tokens/http.token.dart';
import 'package:dio/dio.dart';
class OAuthService extends AuthService {
OAuthService({
required this.clientId,
this.clientSecret,
});
RestService get _restService => find();
final String clientId;
final String? clientSecret;
@override
Future<Token> password(LoginParams params) {
var request = PasswordTokenRequest(
clientId: clientId,
clientSecret: clientSecret,
userName: params.username,
password: params.password);
return _restService.post('/connect/token',
data: request.toFormUrlencodedData(),
options: Options(
extra: {
HttpTokens.ignoreToken: true,
},
contentType: 'application/x-www-form-urlencoded',
)).then((res) => Token.fromJson(res.data));
}
@override
Future<Token> portal(PortalLoginParams params) {
var request = PortalTokenRequest(
clientId: clientId,
clientSecret: clientSecret,
userName: params.username,
password: params.password,
enterpriseId: params.enterpriseId);
return _restService.post('/connect/token',
data: request.toFormUrlencodedData(),
options: Options(
extra: {
HttpTokens.ignoreToken: true,
HttpTokens.ignoreError: true,
},
contentType: 'application/x-www-form-urlencoded',
)).then((res) => Token.fromJson(res.data))
.catchError((error) {
var portalProviders = (jsonDecode(error.response.data["Enterprises"]) as List<dynamic>)
.map((e) => PortalLoginProvider.fromJson(e)).toList();
throw PortalLoginException(portalProviders);
}, test:(error) {
var err = error as dynamic;
if (err?.response?.statusCode == 400 && err?.response?.data != null &&
err?.response?.data["Enterprises"] != null) {
return true;
}
return false;
});
}
@override
Future<Token> phoneNumber(SmsLoginParams params) {
var request = PhoneNumberTokenRequest(
clientId: clientId,
clientSecret: clientSecret,
phoneNumber: params.phonenumber,
code: params.code);
return _restService.post('/connect/token',
data: request.toFormUrlencodedData(),
options: Options(
extra: {
HttpTokens.ignoreToken: true,
},
contentType: 'application/x-www-form-urlencoded',
)).then((res) => Token.fromJson(res.data));
}
@override
Future<Token> refreshToken(RefreshTokenParams params) {
var request = RefreshTokenRequest(
clientId: clientId,
clientSecret: clientSecret,
refreshToken: params.refreshToken,
);
return _restService.post('/connect/token',
data: request.toFormUrlencodedData(),
options: Options(
contentType: 'application/x-www-form-urlencoded',
)).then((res) => Token.fromJson(res.data));
}
@override
Future<UserProfile> getProfile() {
return _restService.get('/connect/userinfo')
.then((res) => UserProfile.fromJson(res.data));
}
}

1
apps/flutter/account/lib/services/index.dart

@ -1 +0,0 @@
export 'auth.service.oauth.dart';

1
apps/flutter/account/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux

@ -0,0 +1 @@
C:/Users/eddlevol/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/path_provider_linux-2.1.11/

4
apps/flutter/account/pubspec.yaml

@ -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:

6
apps/flutter/account_core/.flutter-plugins

@ -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
apps/flutter/account_core/.flutter-plugins-dependencies

@ -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
apps/flutter/account_core/.gitignore

@ -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
apps/flutter/account_core/.metadata

@ -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
apps/flutter/account_core/CHANGELOG.md

@ -0,0 +1,3 @@
## 0.0.1
* TODO: Describe initial release.

1
apps/flutter/account_core/LICENSE

@ -0,0 +1 @@
TODO: Add your license here.

39
apps/flutter/account_core/README.md

@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->
TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
## Features
TODO: List what your package can do. Maybe include images, gifs, or videos.
## Getting started
TODO: List prerequisites and provide or point to information on how to
start using the package.
## Usage
TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.
```dart
const like = 'sample';
```
## Additional information
TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.

4
apps/flutter/account_core/analysis_options.yaml

@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

25
apps/flutter/account_core/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

@ -0,0 +1,25 @@
package io.flutter.plugins;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.pathprovider.PathProviderPlugin;
/**
* Generated file. Do not edit.
*/
public final class GeneratedPluginRegistrant {
public static void registerWith(PluginRegistry registry) {
if (alreadyRegisteredWith(registry)) {
return;
}
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
}
private static boolean alreadyRegisteredWith(PluginRegistry registry) {
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
if (registry.hasPlugin(key)) {
return true;
}
registry.registrarFor(key);
return false;
}
}

2
apps/flutter/account_core/android/local.properties

@ -0,0 +1,2 @@
sdk.dir=C:\\Users\\eddlevol\\AppData\\Local\\Android\\sdk
flutter.sdk=D:\\Sdk\\Flutter

14
apps/flutter/account_core/ios/Flutter/Generated.xcconfig

@ -0,0 +1,14 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=D:\Sdk\Flutter
FLUTTER_APPLICATION_PATH=D:\C Sharp\Open-Sources\abp-next-admin\apps\flutter\account_core
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib\main.dart
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=0.0.1
FLUTTER_BUILD_NUMBER=0.0.1
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json

13
apps/flutter/account_core/ios/Flutter/flutter_export_environment.sh

@ -0,0 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=D:\Sdk\Flutter"
export "FLUTTER_APPLICATION_PATH=D:\C Sharp\Open-Sources\abp-next-admin\apps\flutter\account_core"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=0.0.1"
export "FLUTTER_BUILD_NUMBER=0.0.1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"

19
apps/flutter/account_core/ios/Runner/GeneratedPluginRegistrant.h

@ -0,0 +1,19 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end
NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */

21
apps/flutter/account_core/ios/Runner/GeneratedPluginRegistrant.m

@ -0,0 +1,21 @@
//
// Generated file. Do not edit.
//
// clang-format off
#import "GeneratedPluginRegistrant.h"
#if __has_include(<path_provider_foundation/PathProviderPlugin.h>)
#import <path_provider_foundation/PathProviderPlugin.h>
#else
@import path_provider_foundation;
#endif
@implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]];
}
@end

5
apps/flutter/account_core/lib/account.core.module.dart

@ -0,0 +1,5 @@
import 'package:core/modularity/index.dart';
class AccountCoreModule extends Module {
}

1
apps/flutter/account_core/lib/index.dart

@ -0,0 +1 @@
export 'account.core.module.dart';

0
apps/flutter/account_core/lib/models/common.dart

89
apps/flutter/account_core/lib/models/profile.dto.dart

@ -0,0 +1,89 @@
import 'package:core/models/abp.dto.dart';
import 'package:json_annotation/json_annotation.dart';
part 'profile.dto.g.dart';
@JsonSerializable()
class ProfileDto extends ExtensibleObject {
ProfileDto({
this.userName,
this.email,
this.name,
this.surname,
this.phoneNumber,
this.concurrencyStamp,
this.isExternal = false,
this.hasPassword = false,
super.extraProperties,
});
String? userName;
String? email;
String? name;
String? surname;
String? phoneNumber;
bool isExternal;
bool hasPassword;
String? concurrencyStamp;
factory ProfileDto.fromJson(Map<String, dynamic> json) => _$ProfileDtoFromJson(json);
@override
Map<String, dynamic> toJson() => _$ProfileDtoToJson(this);
}
@JsonSerializable()
class ChangePasswordInput {
ChangePasswordInput({
this.currentPassword,
required this.newPassword,
});
String? currentPassword;
String newPassword;
factory ChangePasswordInput.fromJson(Map<String, dynamic> json) => _$ChangePasswordInputFromJson(json);
Map<String, dynamic> toJson() => _$ChangePasswordInputToJson(this);
}
@JsonSerializable()
class RegisterDto extends ExtensibleObject {
RegisterDto({
required this.userName,
required this.emailAddress,
required this.password,
this.appName = 'abp-flutter',
super.extraProperties,
});
String userName;
String emailAddress;
String password;
String appName;
factory RegisterDto.fromJson(Map<String, dynamic> json) => _$RegisterDtoFromJson(json);
@override
Map<String, dynamic> toJson() => _$RegisterDtoToJson(this);
}
@JsonSerializable()
class UpdateProfileDto extends ExtensibleObject {
UpdateProfileDto({
this.userName,
this.email,
this.name,
this.surname,
this.phoneNumber,
this.concurrencyStamp,
super.extraProperties,
});
String? userName;
String? email;
String? name;
String? surname;
String? phoneNumber;
String? concurrencyStamp;
factory UpdateProfileDto.fromJson(Map<String, dynamic> json) => _$UpdateProfileDtoFromJson(json);
@override
Map<String, dynamic> toJson() => _$UpdateProfileDtoToJson(this);
}

84
apps/flutter/account_core/lib/models/profile.dto.g.dart

@ -0,0 +1,84 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'profile.dto.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ProfileDto _$ProfileDtoFromJson(Map<String, dynamic> json) => ProfileDto(
userName: json['userName'] as String?,
email: json['email'] as String?,
name: json['name'] as String?,
surname: json['surname'] as String?,
phoneNumber: json['phoneNumber'] as String?,
concurrencyStamp: json['concurrencyStamp'] as String?,
isExternal: json['isExternal'] as bool? ?? false,
hasPassword: json['hasPassword'] as bool? ?? false,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ProfileDtoToJson(ProfileDto instance) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'userName': instance.userName,
'email': instance.email,
'name': instance.name,
'surname': instance.surname,
'phoneNumber': instance.phoneNumber,
'isExternal': instance.isExternal,
'hasPassword': instance.hasPassword,
'concurrencyStamp': instance.concurrencyStamp,
};
ChangePasswordInput _$ChangePasswordInputFromJson(Map<String, dynamic> json) =>
ChangePasswordInput(
currentPassword: json['currentPassword'] as String?,
newPassword: json['newPassword'] as String,
);
Map<String, dynamic> _$ChangePasswordInputToJson(
ChangePasswordInput instance) =>
<String, dynamic>{
'currentPassword': instance.currentPassword,
'newPassword': instance.newPassword,
};
RegisterDto _$RegisterDtoFromJson(Map<String, dynamic> json) => RegisterDto(
userName: json['userName'] as String,
emailAddress: json['emailAddress'] as String,
password: json['password'] as String,
appName: json['appName'] as String? ?? 'abp-flutter',
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$RegisterDtoToJson(RegisterDto instance) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'userName': instance.userName,
'emailAddress': instance.emailAddress,
'password': instance.password,
'appName': instance.appName,
};
UpdateProfileDto _$UpdateProfileDtoFromJson(Map<String, dynamic> json) =>
UpdateProfileDto(
userName: json['userName'] as String?,
email: json['email'] as String?,
name: json['name'] as String?,
surname: json['surname'] as String?,
phoneNumber: json['phoneNumber'] as String?,
concurrencyStamp: json['concurrencyStamp'] as String?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$UpdateProfileDtoToJson(UpdateProfileDto instance) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'userName': instance.userName,
'email': instance.email,
'name': instance.name,
'surname': instance.surname,
'phoneNumber': instance.phoneNumber,
'concurrencyStamp': instance.concurrencyStamp,
};

1
apps/flutter/account_core/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux

@ -0,0 +1 @@
C:/Users/eddlevol/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/path_provider_linux-2.1.11/

11
apps/flutter/account_core/linux/flutter/generated_plugin_registrant.cc

@ -0,0 +1,11 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void fl_register_plugins(FlPluginRegistry* registry) {
}

15
apps/flutter/account_core/linux/flutter/generated_plugin_registrant.h

@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include <flutter_linux/flutter_linux.h>
// Registers Flutter plugins.
void fl_register_plugins(FlPluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_

23
apps/flutter/account_core/linux/flutter/generated_plugins.cmake

@ -0,0 +1,23 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

11
apps/flutter/account_core/macos/Flutter/ephemeral/Flutter-Generated.xcconfig

@ -0,0 +1,11 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=D:\Sdk\Flutter
FLUTTER_APPLICATION_PATH=D:\C Sharp\Open-Sources\abp-next-admin\apps\flutter\account_core
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=0.0.1
FLUTTER_BUILD_NUMBER=0.0.1
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json

12
apps/flutter/account_core/macos/Flutter/ephemeral/flutter_export_environment.sh

@ -0,0 +1,12 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=D:\Sdk\Flutter"
export "FLUTTER_APPLICATION_PATH=D:\C Sharp\Open-Sources\abp-next-admin\apps\flutter\account_core"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=0.0.1"
export "FLUTTER_BUILD_NUMBER=0.0.1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"

62
apps/flutter/account_core/pubspec.yaml

@ -0,0 +1,62 @@
name: account_core
description: A new Flutter package project.
version: 0.0.1
homepage:
publish_to: none
environment:
sdk: '>=3.0.5 <4.0.0'
flutter: ">=1.17.0"
dependencies:
flutter:
sdk: flutter
core:
path: '../core'
json_annotation: ^4.8.1
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
build_runner: ^2.4.5
json_serializable: ^6.7.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter:
# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.dev/assets-and-images/#from-packages
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware
# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.dev/custom-fonts/#from-packages

11
apps/flutter/account_core/windows/flutter/generated_plugin_registrant.cc

@ -0,0 +1,11 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void RegisterPlugins(flutter::PluginRegistry* registry) {
}

15
apps/flutter/account_core/windows/flutter/generated_plugin_registrant.h

@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include <flutter/plugin_registry.h>
// Registers Flutter plugins.
void RegisterPlugins(flutter::PluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_

23
apps/flutter/account_core/windows/flutter/generated_plugins.cmake

@ -0,0 +1,23 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

10
apps/flutter/components/.flutter-plugins

@ -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
apps/flutter/components/.flutter-plugins-dependencies

@ -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-16 10:47:15.025132","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:19.079179","version":"3.10.5"}

2
apps/flutter/components/android/local.properties

@ -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

7
apps/flutter/components/lib/components.module.dart

@ -0,0 +1,7 @@
import 'package:core/core.module.dart';
import 'package:core/modularity/index.dart';
class ComponentsModule extends Module {
@override
List<Module> get dependencies => [CoreModule()];
}

3
apps/flutter/components/lib/config/avatar.config.dart

@ -1,3 +0,0 @@
class AvatarConfig {
static String baseUrl = 'http://127.0.0.1:8080/blob/avatars';
}

1
apps/flutter/components/lib/config/index.dart

@ -1 +0,0 @@
export 'avatar.config.dart';

2
apps/flutter/components/lib/index.dart

@ -1,3 +1,3 @@
export './config/index.dart';
export './pages/index.dart';
export './widgets/index.dart';
export 'components.module.dart';

1
apps/flutter/components/lib/pages/index.dart

@ -1 +1,2 @@
export 'page.base.dart';
export 'widget.base.dart';

8
apps/flutter/components/lib/pages/widget.base.dart

@ -0,0 +1,8 @@
import 'package:core/dependency/index.dart';
import 'package:get/get.dart';
abstract class BaseWidget<Bloc extends GetLifeCycleBase?> extends GetWidget<Bloc> {
const BaseWidget({super.key});
Bloc get bloc => Injector.instance.get(tag: tag);
}

17
apps/flutter/components/lib/widgets/avatar/index.dart

@ -1,6 +1,5 @@
import 'package:core/utils/string.extensions.dart';
import 'package:flutter/material.dart';
import 'package:components/config/avatar.config.dart';
class Avatar extends StatelessWidget {
const Avatar({
@ -16,26 +15,12 @@ class Avatar extends StatelessWidget {
final String? schema;
final String? takeToken;
String get avatarUrl {
var formatUrl = url ?? '';
if (!formatUrl.isNullOrWhiteSpace()) {
var urlSchema = schema ?? AvatarConfig.baseUrl;
if (!formatUrl.startsWith(urlSchema)) {
formatUrl = "$urlSchema$formatUrl";
}
}
if (!takeToken.isNullOrWhiteSpace()) {
formatUrl += "?access_token=$takeToken";
}
return formatUrl;
}
@override
Widget build(BuildContext context) {
return CircleAvatar(
child: !url.isNullOrWhiteSpace()
? CircleAvatar(
backgroundImage: NetworkImage(avatarUrl),
backgroundImage: NetworkImage(url!),
)
: Text(!hintText.isNullOrWhiteSpace() && hintText!.length > 3 ? hintText!.substring(0, 3) : hintText ?? 'A',
style: const TextStyle(

86
apps/flutter/components/lib/widgets/back-to-top/index.dart

@ -0,0 +1,86 @@
import 'package:flutter/material.dart';
class BackToTop extends StatefulWidget {
const BackToTop({
super.key,
required this.controller,
this.bottom,
});
final double? bottom;
final ScrollController controller;
@override
State<StatefulWidget> createState() => _BackToTopState();
}
class _BackToTopState extends State<BackToTop> {
bool shown = false;
@override
void initState() {
super.initState();
widget.controller.addListener(isScroll);
}
void isScroll() {
final bool toShow = widget.controller.offset > MediaQuery.of(context).size.height / 2;
if (toShow ^ shown) {
setState(() {
shown = toShow;
});
}
}
@override
Widget build(BuildContext context) {
return Positioned(
bottom: MediaQuery.of(context).padding.bottom + (widget.bottom ?? 40),
right: 20,
child: Offstage(
offstage: !shown,
child: GestureDetector(
onTap: () {
widget.controller.animateTo(0,
duration: const Duration(milliseconds: 200),
curve: Curves.easeIn);
},
child: Container(
height: 48,
width: 48,
alignment: const Alignment(0, 0),
decoration: BoxDecoration(
color: Theme.of(context).highlightColor,
borderRadius: const BorderRadius.all(Radius.circular(20)),
boxShadow: [
BoxShadow(
color: const Color(0xFF000000).withOpacity(0.1),
blurRadius: 4,
spreadRadius: 0),
]),
child: Column(
children: <Widget>[
Container(
margin: const EdgeInsets.only(top: 4),
child: Icon(
Icons.vertical_align_top,
size: 20,
color: Theme.of(context).hintColor,
),
),
Container(
margin: const EdgeInsets.only(top: 0),
child: const Text(
'Top',
//style: TextStyle(fontSize: 10, color: Color(0xFFA1A6AA)),
),
)
],
)
),
),
)
);
}
}

1
apps/flutter/components/lib/widgets/index.dart

@ -1,4 +1,5 @@
export 'avatar/index.dart';
export 'action-button/index.dart';
export 'back-to-top/index.dart';
export 'bottom-button/index.dart';
export 'empty/index.dart';

1
apps/flutter/components/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux

@ -0,0 +1 @@
C:/Users/eddlevol/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/path_provider_linux-2.1.11/

2
apps/flutter/components/pubspec.yaml

@ -13,7 +13,7 @@ dependencies:
sdk: flutter
core:
path: '../core'
get:
get: ^4.6.5
dev_dependencies:
flutter_test:

10
apps/flutter/core/.flutter-plugins

@ -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
apps/flutter/core/.flutter-plugins-dependencies

@ -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-16 08:23:33.451996","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-19 11:21:40.892667","version":"3.10.5"}

2
apps/flutter/core/android/local.properties

@ -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
apps/flutter/core/lib/abstracts/index.dart

@ -1,2 +1,3 @@
export 'copy.with.dart';
export 'logging.dart';
export 'signalr.service.dart';

84
apps/flutter/core/lib/abstracts/signalr.service.dart

@ -0,0 +1,84 @@
import 'dart:async';
import 'package:core/models/common.dart';
import 'package:core/utils/logging.dart';
abstract class SignalrService {
Future<void>? start();
Future<void> stop();
StreamSubscription<Exception?> onClose(Function(Exception?) listen, { bool Function(Exception?)? filter});
StreamSubscription<Exception?> onReconnecting(Function(Exception?) listen, { bool Function(Exception?)? filter});
StreamSubscription<String?> onReconnected(Function(String?) listen, { bool Function(String?)? filter});
Stream<SignalrMessage> subscribe(String methodName);
void unsubscribe(String methodName);
Future<void> send(String methodName, { List<Object>? args });
Future<dynamic> invoke(String methodName, { List<Object>? args });
}
class NullSignalrService extends SignalrService {
@override
Future invoke(String methodName, {List<Object>? args}) {
logger.warn('signalr - invoke method not implemented!');
return Future.value();
}
@override
StreamSubscription<Exception?> onClose(Function(Exception? p1) listen, {bool Function(Exception? p1)? filter}) {
logger.warn('signalr - onClose method not implemented!');
Exception? nullValue;
return Stream.value(nullValue).listen(logger.debug);
}
@override
StreamSubscription<String?> onReconnected(Function(String? p1) listen, {bool Function(String? p1)? filter}) {
logger.warn('signalr - onReconnected method not implemented!');
String? nullValue;
return Stream.value(nullValue).listen(logger.debug);
}
@override
StreamSubscription<Exception?> onReconnecting(Function(Exception? p1) listen, {bool Function(Exception? p1)? filter}) {
logger.warn('signalr - onReconnecting method not implemented!');
Exception? nullValue;
return Stream.value(nullValue).listen(logger.debug);
}
@override
Future<void> send(String methodName, {List<Object>? args}) {
logger.warn('signalr - send method not implemented!');
return Future.value();
}
@override
Future<void>? start() {
logger.warn('signalr - start method not implemented!');
return Future.value();
}
@override
Future<void> stop() {
logger.warn('signalr - stop method not implemented!');
return Future.value();
}
@override
Stream<SignalrMessage> subscribe(String methodName) {
logger.warn('signalr - subscribe method not implemented!');
return Stream.value(SignalrMessage(methodName, []));
}
@override
void unsubscribe(String methodName) {
logger.warn('signalr - unsubscribe method not implemented!');
}
}

107
apps/flutter/core/lib/config/env.config.dart

@ -1,107 +0,0 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_app_environment/flutter_app_environment.dart' as envlib;
part 'env.config.g.dart';
@JsonSerializable(createToJson: false)
class EnvConfig {
EnvConfig({
required this.clientId,
this.clientSecret,
required this.authority,
required this.baseUrl,
this.uploadFilesUrl,
this.staticFilesUrl,
this.tenantKey = '__tenant',
this.defaultLanguage = 'en',
this.notifications,
});
String clientId;
String? clientSecret;
String authority;
String baseUrl;
String? uploadFilesUrl;
String? staticFilesUrl;
String? tenantKey;
String? defaultLanguage;
NotificationConfig? notifications;
factory EnvConfig.fromJson(Map<String, dynamic> json) => _$EnvConfigFromJson(json);
}
@JsonSerializable(createToJson: false)
class NotificationConfig {
NotificationConfig({
this.android,
this.darwin,
this.linux,
});
AndroidNotification? android;
DarwinNotification? darwin;
LinuxNotification? linux;
factory NotificationConfig.fromJson(Map<String, dynamic> json) => _$NotificationConfigFromJson(json);
}
@JsonSerializable(createToJson: false)
class LinuxNotification {
LinuxNotification({
required this.defaultActionName,
});
String defaultActionName;
factory LinuxNotification.fromJson(Map<String, dynamic> json) => _$LinuxNotificationFromJson(json);
}
@JsonSerializable(createToJson: false)
class AndroidNotification {
AndroidNotification({
required this.channelId,
required this.channelName,
this.channelDescription,
});
String channelId;
String channelName;
String? channelDescription;
factory AndroidNotification.fromJson(Map<String, dynamic> json) => _$AndroidNotificationFromJson(json);
}
@JsonSerializable(createToJson: false)
class DarwinNotification {
DarwinNotification();
factory DarwinNotification.fromJson(Map<String, dynamic> json) => _$DarwinNotificationFromJson(json);
}
enum Env {
development('DEV', 'Development'),
profile('PROF', 'Profile'),
production('PROD', 'Production');
final String name;
final String value;
const Env(this.name, this.value);
}
class Environment {
static Future<void> initAsync() async {
var envType = envlib.EnvironmentType.development;
if (kReleaseMode) {
envType = envlib.EnvironmentType.production;
} else if (kProfileMode) {
envType = envlib.EnvironmentType.test;
}
await envlib.Environment.initFromJson<EnvConfig>(
environmentType: envType,
fromJson: EnvConfig.fromJson,
);
Environment.current = envlib.Environment<EnvConfig>.instance().config;
}
static late EnvConfig current;
}

51
apps/flutter/core/lib/config/env.config.g.dart

@ -1,51 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'env.config.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
EnvConfig _$EnvConfigFromJson(Map<String, dynamic> json) => EnvConfig(
clientId: json['clientId'] as String,
clientSecret: json['clientSecret'] as String?,
authority: json['authority'] as String,
baseUrl: json['baseUrl'] as String,
uploadFilesUrl: json['uploadFilesUrl'] as String?,
staticFilesUrl: json['staticFilesUrl'] as String?,
tenantKey: json['tenantKey'] as String? ?? '__tenant',
defaultLanguage: json['defaultLanguage'] as String? ?? 'en',
notifications: json['notifications'] == null
? null
: NotificationConfig.fromJson(
json['notifications'] as Map<String, dynamic>),
);
NotificationConfig _$NotificationConfigFromJson(Map<String, dynamic> json) =>
NotificationConfig(
android: json['android'] == null
? null
: AndroidNotification.fromJson(
json['android'] as Map<String, dynamic>),
darwin: json['darwin'] == null
? null
: DarwinNotification.fromJson(json['darwin'] as Map<String, dynamic>),
linux: json['linux'] == null
? null
: LinuxNotification.fromJson(json['linux'] as Map<String, dynamic>),
);
LinuxNotification _$LinuxNotificationFromJson(Map<String, dynamic> json) =>
LinuxNotification(
defaultActionName: json['defaultActionName'] as String,
);
AndroidNotification _$AndroidNotificationFromJson(Map<String, dynamic> json) =>
AndroidNotification(
channelId: json['channelId'] as String,
channelName: json['channelName'] as String,
channelDescription: json['channelDescription'] as String?,
);
DarwinNotification _$DarwinNotificationFromJson(Map<String, dynamic> json) =>
DarwinNotification();

1
apps/flutter/core/lib/config/index.dart

@ -1 +0,0 @@
export 'env.config.dart';

33
apps/flutter/core/lib/core.module.dart

@ -1,35 +1,34 @@
import 'package:core/dependency/injector.dart';
import 'package:core/modularity/module.dart';
import 'package:core/services/index.dart';
import 'proxy/index.dart';
class CoreModule extends Module {
@override
Future<void> configureServicesAsync() async {
await injectAsync<StorageService>(() async {
await injectAsync<StorageService>((injector) async {
if (await GetxStorageService.init()) {
return GetxStorageService();
return GetxStorageService(injector);
}
return StorageService();
return StorageService(injector);
}, permanent: true);
await super.configureServicesAsync();
}
@override
void configureServices() {
inject(Injector.instance);
inject<CoreModule>(this);
inject(ConfigStateService(), permanent: true);
inject(ThemeService(), permanent: true);
inject<CoreModule>(this, permanent: true);
inject(EnvironmentService(injector), permanent: true);
inject(ConfigStateService(injector), permanent: true);
inject(ThemeService(injector), permanent: true);
inject(ErrorReporterService(), permanent: true);
lazyInject(() => SessionService(), fenix: true);
lazyInject(() => SubscriptionService(), fenix: true);
lazyInject(() => LanguageService(), fenix: true);
lazyInject(() => LocalizationService(), fenix: true);
lazyInject(() => AbpTenantService(), fenix: true);
lazyInject(() => AbpApiDefinitionService(), fenix: true);
lazyInject(() => AbpApplicationLocalizationService(), fenix: true);
lazyInject(() => AbpApplicationConfigurationService(), fenix: true);
lazyInject((injector) => SubscriptionService(injector));
lazyInject((injector) => SessionService(injector), fenix: true);
lazyInject((injector) => LanguageService(injector), fenix: true);
lazyInject((injector) => LocalizationService(injector), fenix: true);
lazyInject((injector) => AbpTenantService(injector), fenix: true);
lazyInject((injector) => AbpApiDefinitionService(injector), fenix: true);
lazyInject((injector) => AbpApplicationLocalizationService(injector), fenix: true);
lazyInject((injector) => AbpApplicationConfigurationService(injector), fenix: true);
}
}

1
apps/flutter/core/lib/dependency/index.dart

@ -1 +1,2 @@
export 'injector.dart';
export 'injector.builder.dart';

5
apps/flutter/core/lib/dependency/injector.builder.dart

@ -0,0 +1,5 @@
import 'injector.dart';
typedef InjectorBuilderFactory<T> = T Function(Injector injector);
typedef AsyncInjectorBuilderFactory<T> = Future<T> Function(Injector injector);

22
apps/flutter/core/lib/dependency/injector.dart

@ -1,5 +1,9 @@
import 'package:get/get.dart';
import 'injector.builder.dart';
final Injector injector = Injector.instance;
class Injector {
factory Injector() => _getInstance ??= const Injector._();
@ -16,30 +20,32 @@ class Injector {
{
String? tag,
bool permanent = false,
InstanceBuilderCallback<T>? builder,
}) => Get.put(dependency, tag: tag, permanent: permanent, builder: builder);
InjectorBuilderFactory<T>? builder,
}) => Get.put(dependency, tag: tag, permanent: permanent, builder: () {
return builder != null ? builder(get()) : dependency;
});
void create<T>(
InstanceBuilderCallback<T> builder,
InjectorBuilderFactory<T> builder,
{
String? tag,
bool permanent = true,
}
) => Get.create(builder, tag: tag, permanent: permanent);
) => Get.create(() => builder(get()), tag: tag, permanent: permanent);
void lazyInject<T>(
InstanceBuilderCallback<T> builder,
InjectorBuilderFactory<T> builder,
{
String? tag,
bool fenix = false,
}) => Get.lazyPut(builder, tag: tag, fenix: fenix);
}) => Get.lazyPut(() => builder(get()), tag: tag, fenix: fenix);
Future<T> injectAsync<T>(
AsyncInstanceBuilderCallback<T> builder,
AsyncInjectorBuilderFactory<T> builder,
{
String? tag,
bool permanent = false,
}) => Get.putAsync(builder, tag: tag, permanent: permanent);
}) => Get.putAsync(() => builder(get()), tag: tag, permanent: permanent);
bool isInjected({String? tag}) => Get.isRegistered(tag: tag);
}

1
apps/flutter/core/lib/index.dart

@ -1,5 +1,4 @@
export './abstracts/index.dart';
export './config/index.dart';
export './dependency/index.dart';
export './interceptors/index.dart';
export './middlewares/index.dart';

6
apps/flutter/account/lib/interceptors/oauth.api.interceptor.dart → apps/flutter/core/lib/interceptors/api.authorization.interceptor.dart

@ -7,7 +7,7 @@ import 'package:core/tokens/http.token.dart';
import 'package:core/utils/string.extensions.dart';
import 'package:dio/dio.dart';
class OAuthApiInterceptor extends Interceptor {
class ApiAuthorizationInterceptor extends Interceptor {
@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
if (!options.extra.containsKey(HttpTokens.ignoreToken)) {
@ -33,9 +33,9 @@ class OAuthApiInterceptor extends Interceptor {
var authService = AuthService.to;
authService.refreshToken(RefreshTokenParams(token.refreshToken!))
.then((value) {
SessionService.to.refreshToken(value);
//SessionService.to.setToken(value);
//err.requestOptions
RestService.to.request(
RestService.to.dio.request(
err.requestOptions.path,
data: err.requestOptions.data,
queryParameters: err.requestOptions.queryParameters,

2
apps/flutter/core/lib/interceptors/api.logger.interceptor.dart

@ -16,7 +16,7 @@ class LoggerInterceptor extends Interceptor {
@override
void onError(DioException err, ErrorInterceptorHandler handler) {
logger.debug('网络请求错误', err, err.stackTrace);
logger.error('网络请求错误', err, err.stackTrace);
return handler.next(err);
}
}

3
apps/flutter/core/lib/interceptors/api.wrapper.result.interceptor.dart

@ -1,5 +1,6 @@
import 'package:core/models/wrapper.dart';
import 'package:dio/dio.dart';
import 'package:get/get.dart' show Trans;
class WrapperResultInterceptor extends Interceptor {
@override
@ -10,7 +11,7 @@ class WrapperResultInterceptor extends Interceptor {
requestOptions: response.requestOptions,
response: response,
type: DioExceptionType.badResponse,
message: '请求出错, 请稍后再试!'));
message: 'Prompt:ApiRequestFailed'.tr));
return;
}
var result = Wrapper.fromJson(response.data!);

1
apps/flutter/core/lib/interceptors/index.dart

@ -1,3 +1,4 @@
export 'api.abp.wrapper.error.interceptor.dart';
export 'api.authorization.interceptor.dart';
export 'api.wrapper.result.interceptor.dart';
export 'api.logger.interceptor.dart';

431
apps/flutter/core/lib/models/abp.dto.dart

@ -1,3 +1,8 @@
import 'package:json_annotation/json_annotation.dart';
part 'abp.dto.g.dart';
@JsonSerializable()
class LocalizableStringInfo {
LocalizableStringInfo({
required this.resourceName,
@ -8,135 +13,38 @@ class LocalizableStringInfo {
String name;
Map<String, dynamic>? values;
factory LocalizableStringInfo.fromJson(Map<String, dynamic> json) =>
LocalizableStringInfo(
resourceName: json['resourceName'] as String,
name: json['name'] as String,
values: json['values'] as Map<String, dynamic>?,
);
Map<String, dynamic> toJson() => <String, dynamic>{
'resourceName': resourceName,
'name': name,
'values': values,
};
}
class ExtraPropertyDictionary implements Map<String, dynamic> {
ExtraPropertyDictionary({
Map<String, dynamic>? map
}) {
_innerMap = map ?? {};
}
late Map<String, dynamic> _innerMap = {};
@override
operator [](Object? key) {
return _innerMap[key];
}
@override
void operator []=(String key, value) {
_innerMap[key] = value;
}
@override
void addAll(Map<String, dynamic> other) {
_innerMap.addAll(other);
}
@override
void addEntries(Iterable<MapEntry<String, dynamic>> newEntries) {
_innerMap.addEntries(newEntries);
}
@override
Map<RK, RV> cast<RK, RV>() {
return _innerMap.cast<RK, RV>();
}
@override
void clear() {
_innerMap.clear();
}
@override
bool containsKey(Object? key) {
return _innerMap.containsKey(key);
}
@override
bool containsValue(Object? value) {
return _innerMap.containsValue(value);
}
@override
Iterable<MapEntry<String, dynamic>> get entries => _innerMap.entries;
@override
void forEach(void Function(String key, dynamic value) action) {
_innerMap.forEach(action);
}
@override
bool get isEmpty => _innerMap.isEmpty;
@override
bool get isNotEmpty => _innerMap.isNotEmpty;
@override
Iterable<String> get keys => _innerMap.keys;
@override
int get length => _innerMap.length;
@override
Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> Function(String key, dynamic value) convert) {
return _innerMap.map<K2, V2>(convert);
}
@override
putIfAbsent(String key, Function() ifAbsent) {
return _innerMap.putIfAbsent(key, ifAbsent);
}
@override
remove(Object? key) {
return _innerMap.remove(key);
}
@override
void removeWhere(bool Function(String key, dynamic value) test) {
_innerMap.removeWhere(test);
}
@override
update(String key, Function(dynamic value) update, {Function()? ifAbsent}) {
return _innerMap.update(key, update, ifAbsent: ifAbsent);
}
@override
void updateAll(Function(String key, dynamic value) update) {
_innerMap.updateAll(update);
}
@override
Iterable get values => _innerMap.values;
factory LocalizableStringInfo.fromJson(Map<String, dynamic> json) => _$LocalizableStringInfoFromJson(json);
Map<String, dynamic> toJson() => _$LocalizableStringInfoToJson(this);
}
@JsonSerializable()
class ExtensibleObject {
ExtensibleObject({
this.extraProperties,
});
ExtraPropertyDictionary? extraProperties;
Map<String, dynamic>? extraProperties;
factory ExtensibleObject.fromJson(Map<String, dynamic> json) => _$ExtensibleObjectFromJson(json);
Map<String, dynamic> toJson() => _$ExtensibleObjectToJson(this);
}
@JsonSerializable(genericArgumentFactories: true)
class EntityDto<TPrimaryKey> {
EntityDto({
required this.id,
});
TPrimaryKey id;
factory EntityDto.fromJson(
Map<String, dynamic> json,
{ TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey }) =>
_$EntityDtoFromJson(json, fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey);
Map<String, dynamic> toJson({ Object? Function(TPrimaryKey value)? toJsonTPrimaryKey }) =>
_$EntityDtoToJson(this, toJsonTPrimaryKey ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class CreationAuditedEntityDto<TPrimaryKey> extends EntityDto<TPrimaryKey> {
CreationAuditedEntityDto({
required super.id,
@ -145,8 +53,18 @@ class CreationAuditedEntityDto<TPrimaryKey> extends EntityDto<TPrimaryKey> {
});
DateTime creationTime;
String? creatorId;
factory CreationAuditedEntityDto.fromJson(
Map<String, dynamic> json,
{ TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey }) =>
_$CreationAuditedEntityDtoFromJson(json, fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey);
@override
Map<String, dynamic> toJson({ Object? Function(TPrimaryKey value)? toJsonTPrimaryKey }) =>
_$CreationAuditedEntityDtoToJson(this, toJsonTPrimaryKey ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class CreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends CreationAuditedEntityDto<TPrimaryKey> {
CreationAuditedEntityWithUserDto({
required super.id,
@ -155,8 +73,29 @@ class CreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends CreationAu
super.creatorId,
});
TUserDto creator;
factory CreationAuditedEntityWithUserDto.fromJson(
Map<String, dynamic> json,
{
TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey,
TUserDto Function(Object? json)? fromJsonTUserDto,
}) =>
_$CreationAuditedEntityWithUserDtoFromJson(json,
fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey,
fromJsonTUserDto ?? (json) => json as TUserDto);
@override
Map<String, dynamic> toJson(
{
Object? Function(TPrimaryKey value)? toJsonTPrimaryKey,
Object? Function(TUserDto value)? toJsonTUserDto,
}) =>
_$CreationAuditedEntityWithUserDtoToJson(this,
toJsonTPrimaryKey ?? (instance) => instance,
toJsonTUserDto ?? (instance) => instance);
}
@JsonSerializable(genericArgumentFactories: true)
class AuditedEntityDto<TPrimaryKey> extends CreationAuditedEntityDto<TPrimaryKey> {
AuditedEntityDto({
required super.id,
@ -167,8 +106,18 @@ class AuditedEntityDto<TPrimaryKey> extends CreationAuditedEntityDto<TPrimaryKey
});
DateTime? lastModificationTime;
String? lastModifierId;
factory AuditedEntityDto.fromJson(
Map<String, dynamic> json,
{ TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey }) =>
_$AuditedEntityDtoFromJson(json, fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey);
@override
Map<String, dynamic> toJson({ Object? Function(TPrimaryKey value)? toJsonTPrimaryKey }) =>
_$AuditedEntityDtoToJson(this, toJsonTPrimaryKey ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class AuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends AuditedEntityDto<TPrimaryKey> {
AuditedEntityWithUserDto({
required super.id,
@ -181,8 +130,29 @@ class AuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends AuditedEntityDto<T
});
TUserDto creator;
TUserDto lastModifier;
factory AuditedEntityWithUserDto.fromJson(
Map<String, dynamic> json,
{
TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey,
TUserDto Function(Object? json)? fromJsonTUserDto,
}) =>
_$AuditedEntityWithUserDtoFromJson(json,
fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey,
fromJsonTUserDto ?? (json) => json as TUserDto);
@override
Map<String, dynamic> toJson(
{
Object? Function(TPrimaryKey value)? toJsonTPrimaryKey,
Object? Function(TUserDto value)? toJsonTUserDto,
}) =>
_$AuditedEntityWithUserDtoToJson(this,
toJsonTPrimaryKey ?? (instance) => instance,
toJsonTUserDto ?? (instance) => instance);
}
@JsonSerializable(genericArgumentFactories: true)
class FullAuditedEntityDto<TPrimaryKey> extends AuditedEntityDto<TPrimaryKey> {
FullAuditedEntityDto({
required super.id,
@ -197,8 +167,18 @@ class FullAuditedEntityDto<TPrimaryKey> extends AuditedEntityDto<TPrimaryKey> {
bool isDeleted;
String? deleterId;
DateTime? deletionTime;
factory FullAuditedEntityDto.fromJson(
Map<String, dynamic> json,
{ TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey }) =>
_$FullAuditedEntityDtoFromJson(json, fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey);
@override
Map<String, dynamic> toJson({ Object? Function(TPrimaryKey value)? toJsonTPrimaryKey }) =>
_$FullAuditedEntityDtoToJson(this, toJsonTPrimaryKey ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class FullAuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends FullAuditedEntityDto<TPrimaryKey> {
FullAuditedEntityWithUserDto({
required super.id,
@ -216,35 +196,100 @@ class FullAuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends FullAuditedEnt
TUserDto creator;
TUserDto lastModifier;
TUserDto deleter;
factory FullAuditedEntityWithUserDto.fromJson(
Map<String, dynamic> json,
{
TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey,
TUserDto Function(Object? json)? fromJsonTUserDto,
}) =>
_$FullAuditedEntityWithUserDtoFromJson(json,
fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey,
fromJsonTUserDto ?? (json) => json as TUserDto);
@override
Map<String, dynamic> toJson(
{
Object? Function(TPrimaryKey value)? toJsonTPrimaryKey,
Object? Function(TUserDto value)? toJsonTUserDto,
}) =>
_$FullAuditedEntityWithUserDtoToJson(this,
toJsonTPrimaryKey ?? (instance) => instance,
toJsonTUserDto ?? (instance) => instance);
}
class ExtensibleEntityDto<TKey> extends ExtensibleObject {
@JsonSerializable(genericArgumentFactories: true)
class ExtensibleEntityDto<TPrimaryKey> extends ExtensibleObject {
ExtensibleEntityDto({
required this.id,
super.extraProperties,
});
TKey id;
TPrimaryKey id;
factory ExtensibleEntityDto.fromJson(
Map<String, dynamic> json,
{ TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey }) =>
_$ExtensibleEntityDtoFromJson(json, fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey);
@override
Map<String, dynamic> toJson({ Object? Function(TPrimaryKey value)? toJsonTPrimaryKey }) =>
_$ExtensibleEntityDtoToJson(this, toJsonTPrimaryKey ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class ExtensibleCreationAuditedEntityDto<TPrimaryKey> extends ExtensibleEntityDto<TPrimaryKey> {
ExtensibleCreationAuditedEntityDto({
required super.id,
required this.creationTime,
this.creatorId,
super.extraProperties,
});
DateTime creationTime;
String? creatorId;
factory ExtensibleCreationAuditedEntityDto.fromJson(
Map<String, dynamic> json,
{ TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey }) =>
_$ExtensibleCreationAuditedEntityDtoFromJson(json, fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey);
@override
Map<String, dynamic> toJson({ Object? Function(TPrimaryKey value)? toJsonTPrimaryKey }) =>
_$ExtensibleCreationAuditedEntityDtoToJson(this, toJsonTPrimaryKey ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class ExtensibleCreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends ExtensibleCreationAuditedEntityDto<TPrimaryKey> {
ExtensibleCreationAuditedEntityWithUserDto({
required super.id,
required this.creator,
required super.creationTime,
super.creatorId,
super.extraProperties,
});
TUserDto creator;
factory ExtensibleCreationAuditedEntityWithUserDto.fromJson(
Map<String, dynamic> json,
{
TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey,
TUserDto Function(Object? json)? fromJsonTUserDto,
}) =>
_$ExtensibleCreationAuditedEntityWithUserDtoFromJson(json,
fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey,
fromJsonTUserDto ?? (json) => json as TUserDto);
@override
Map<String, dynamic> toJson(
{
Object? Function(TPrimaryKey value)? toJsonTPrimaryKey,
Object? Function(TUserDto value)? toJsonTUserDto,
}) =>
_$ExtensibleCreationAuditedEntityWithUserDtoToJson(this,
toJsonTPrimaryKey ?? (instance) => instance,
toJsonTUserDto ?? (instance) => instance);
}
@JsonSerializable(genericArgumentFactories: true)
class ExtensibleAuditedEntityDto<TPrimaryKey> extends ExtensibleCreationAuditedEntityDto<TPrimaryKey> {
ExtensibleAuditedEntityDto({
required super.id,
@ -252,11 +297,22 @@ class ExtensibleAuditedEntityDto<TPrimaryKey> extends ExtensibleCreationAuditedE
super.creatorId,
this.lastModificationTime,
this.lastModifierId,
super.extraProperties,
});
DateTime? lastModificationTime;
String? lastModifierId;
factory ExtensibleAuditedEntityDto.fromJson(
Map<String, dynamic> json,
{ TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey }) =>
_$ExtensibleAuditedEntityDtoFromJson(json, fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey);
@override
Map<String, dynamic> toJson({ Object? Function(TPrimaryKey value)? toJsonTPrimaryKey }) =>
_$ExtensibleAuditedEntityDtoToJson(this, toJsonTPrimaryKey ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class ExtensibleAuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends ExtensibleAuditedEntityDto<TPrimaryKey> {
ExtensibleAuditedEntityWithUserDto({
required super.id,
@ -266,11 +322,33 @@ class ExtensibleAuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends Extensib
super.creatorId,
super.lastModificationTime,
super.lastModifierId,
super.extraProperties,
});
TUserDto creator;
TUserDto lastModifier;
factory ExtensibleAuditedEntityWithUserDto.fromJson(
Map<String, dynamic> json,
{
TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey,
TUserDto Function(Object? json)? fromJsonTUserDto,
}) =>
_$ExtensibleAuditedEntityWithUserDtoFromJson(json,
fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey,
fromJsonTUserDto ?? (json) => json as TUserDto);
@override
Map<String, dynamic> toJson(
{
Object? Function(TPrimaryKey value)? toJsonTPrimaryKey,
Object? Function(TUserDto value)? toJsonTUserDto,
}) =>
_$ExtensibleAuditedEntityWithUserDtoToJson(this,
toJsonTPrimaryKey ?? (instance) => instance,
toJsonTUserDto ?? (instance) => instance);
}
@JsonSerializable(genericArgumentFactories: true)
class ExtensibleFullAuditedEntityDto<TPrimaryKey> extends ExtensibleAuditedEntityDto<TPrimaryKey> {
ExtensibleFullAuditedEntityDto({
required super.id,
@ -281,12 +359,23 @@ class ExtensibleFullAuditedEntityDto<TPrimaryKey> extends ExtensibleAuditedEntit
super.creatorId,
super.lastModificationTime,
super.lastModifierId,
super.extraProperties,
});
bool isDeleted;
String? deleterId;
DateTime? deletionTime;
factory ExtensibleFullAuditedEntityDto.fromJson(
Map<String, dynamic> json,
{ TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey }) =>
_$ExtensibleFullAuditedEntityDtoFromJson(json, fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey);
@override
Map<String, dynamic> toJson({ Object? Function(TPrimaryKey value)? toJsonTPrimaryKey }) =>
_$ExtensibleFullAuditedEntityDtoToJson(this, toJsonTPrimaryKey ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class ExtensibleFullAuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends ExtensibleFullAuditedEntityDto<TPrimaryKey> {
ExtensibleFullAuditedEntityWithUserDto({
required super.id,
@ -300,74 +389,157 @@ class ExtensibleFullAuditedEntityWithUserDto<TPrimaryKey, TUserDto> extends Exte
super.creatorId,
super.lastModificationTime,
super.lastModifierId,
super.extraProperties,
});
TUserDto creator;
TUserDto lastModifier;
TUserDto deleter;
factory ExtensibleFullAuditedEntityWithUserDto.fromJson(
Map<String, dynamic> json,
{
TPrimaryKey Function(Object? json)? fromJsonTPrimaryKey,
TUserDto Function(Object? json)? fromJsonTUserDto,
}) =>
_$ExtensibleFullAuditedEntityWithUserDtoFromJson(json,
fromJsonTPrimaryKey ?? (json) => json as TPrimaryKey,
fromJsonTUserDto ?? (json) => json as TUserDto);
@override
Map<String, dynamic> toJson(
{
Object? Function(TPrimaryKey value)? toJsonTPrimaryKey,
Object? Function(TUserDto value)? toJsonTUserDto,
}) =>
_$ExtensibleFullAuditedEntityWithUserDtoToJson(this,
toJsonTPrimaryKey ?? (instance) => instance,
toJsonTUserDto ?? (instance) => instance);
}
@JsonSerializable(genericArgumentFactories: true)
class ListResultDto<T> {
ListResultDto({
required this.items,
});
List<T> items;
factory ListResultDto.fromJson(
Map<String, dynamic> json,
{ T Function(Object? json)? fromJsonT }) =>
_$ListResultDtoFromJson(json, fromJsonT ?? (json) => json as T);
Map<String, dynamic> toJson({ Object? Function(T value)? toJsonT }) =>
_$ListResultDtoToJson(this, toJsonT ?? (json) => json);
}
@JsonSerializable()
class LimitedResultRequestDto {
LimitedResultRequestDto({
this.maxResultCount,
});
int? maxResultCount = 10;
factory LimitedResultRequestDto.fromJson(Map<String, dynamic> json) => _$LimitedResultRequestDtoFromJson(json);
Map<String, dynamic> toJson() => _$LimitedResultRequestDtoToJson(this);
}
@JsonSerializable()
class ExtensibleLimitedResultRequestDto extends LimitedResultRequestDto {
ExtensibleLimitedResultRequestDto({
super.maxResultCount,
this.extraProperties,
});
ExtraPropertyDictionary? extraProperties;
Map<String, dynamic>? extraProperties;
factory ExtensibleLimitedResultRequestDto.fromJson(Map<String, dynamic> json) => _$ExtensibleLimitedResultRequestDtoFromJson(json);
@override
Map<String, dynamic> toJson() => _$ExtensibleLimitedResultRequestDtoToJson(this);
}
@JsonSerializable(genericArgumentFactories: true)
class ExtensibleListResultDto<T> extends ListResultDto<T> {
ExtensibleListResultDto({
required super.items,
this.extraProperties,
});
ExtraPropertyDictionary? extraProperties;
Map<String, dynamic>? extraProperties;
factory ExtensibleListResultDto.fromJson(
Map<String, dynamic> json,
{ T Function(Object? json)? fromJsonT }) =>
_$ExtensibleListResultDtoFromJson(json, fromJsonT ?? (json) => json as T);
@override
Map<String, dynamic> toJson({ Object? Function(T value)? toJsonT }) =>
_$ExtensibleListResultDtoToJson(this, toJsonT ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class PagedResultDto<T> extends ListResultDto<T> {
PagedResultDto({
required this.totalCount,
required super.items,
});
int totalCount;
factory PagedResultDto.fromJson(
Map<String, dynamic> json,
{ T Function(Object? json)? fromJsonT }) =>
_$PagedResultDtoFromJson(json, fromJsonT ?? (json) => json as T);
@override
Map<String, dynamic> toJson({ Object? Function(T value)? toJsonT }) =>
_$PagedResultDtoToJson(this, toJsonT ?? (json) => json);
}
@JsonSerializable(genericArgumentFactories: true)
class ExtensiblePagedResultDto<T> extends PagedResultDto<T> {
ExtensiblePagedResultDto({
required super.totalCount,
required super.items,
this.extraProperties,
});
ExtraPropertyDictionary? extraProperties;
Map<String, dynamic>? extraProperties;
factory ExtensiblePagedResultDto.fromJson(
Map<String, dynamic> json,
{ T Function(Object? json)? fromJsonT }) =>
_$ExtensiblePagedResultDtoFromJson(json, fromJsonT ?? (json) => json as T);
@override
Map<String, dynamic> toJson({ Object? Function(T value)? toJsonT }) =>
_$ExtensiblePagedResultDtoToJson(this, toJsonT ?? (json) => json);
}
@JsonSerializable()
class SortedResultRequest {
SortedResultRequest({
this.sorting,
});
String? sorting;
factory SortedResultRequest.fromJson(Map<String, dynamic> json) => _$SortedResultRequestFromJson(json);
Map<String, dynamic> toJson() => _$SortedResultRequestToJson(this);
}
@JsonSerializable()
class PagedResultRequestDto extends LimitedResultRequestDto {
PagedResultRequestDto({
this.skipCount,
super.maxResultCount,
});
int? skipCount = 0;
factory PagedResultRequestDto.fromJson(Map<String, dynamic> json) => _$PagedResultRequestDtoFromJson(json);
@override
Map<String, dynamic> toJson() => _$PagedResultRequestDtoToJson(this);
}
@JsonSerializable()
class PagedAndSortedResultRequestDto extends PagedResultRequestDto {
PagedAndSortedResultRequestDto({
super.skipCount,
@ -375,8 +547,14 @@ class PagedAndSortedResultRequestDto extends PagedResultRequestDto {
this.sorting,
});
String? sorting;
factory PagedAndSortedResultRequestDto.fromJson(Map<String, dynamic> json) => _$PagedAndSortedResultRequestDtoFromJson(json);
@override
Map<String, dynamic> toJson() => _$PagedAndSortedResultRequestDtoToJson(this);
}
@JsonSerializable()
class ExtensiblePagedAndSortedResultRequestDto extends PagedAndSortedResultRequestDto {
ExtensiblePagedAndSortedResultRequestDto({
super.skipCount,
@ -384,14 +562,25 @@ class ExtensiblePagedAndSortedResultRequestDto extends PagedAndSortedResultReque
super.sorting,
this.extraProperties,
});
ExtraPropertyDictionary? extraProperties;
Map<String, dynamic>? extraProperties;
factory ExtensiblePagedAndSortedResultRequestDto.fromJson(Map<String, dynamic> json) => _$ExtensiblePagedAndSortedResultRequestDtoFromJson(json);
@override
Map<String, dynamic> toJson() => _$ExtensiblePagedAndSortedResultRequestDtoToJson(this);
}
@JsonSerializable()
class ExtensiblePagedResultRequestDto extends PagedResultRequestDto {
ExtensiblePagedResultRequestDto({
super.skipCount,
super.maxResultCount,
this.extraProperties,
});
ExtraPropertyDictionary? extraProperties;
Map<String, dynamic>? extraProperties;
factory ExtensiblePagedResultRequestDto.fromJson(Map<String, dynamic> json) => _$ExtensiblePagedResultRequestDtoFromJson(json);
@override
Map<String, dynamic> toJson() => _$ExtensiblePagedResultRequestDtoToJson(this);
}

627
apps/flutter/core/lib/models/abp.dto.g.dart

@ -0,0 +1,627 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'abp.dto.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
LocalizableStringInfo _$LocalizableStringInfoFromJson(
Map<String, dynamic> json) =>
LocalizableStringInfo(
resourceName: (json['resourceName'] ?? json['ResourceName']) as String,
name: (json['name'] ?? json['Name']) as String,
values: (json['values'] ?? json['Values']) as Map<String, dynamic>?,
);
Map<String, dynamic> _$LocalizableStringInfoToJson(
LocalizableStringInfo instance) =>
<String, dynamic>{
'resourceName': instance.resourceName,
'name': instance.name,
'values': instance.values,
};
ExtensibleObject _$ExtensibleObjectFromJson(Map<String, dynamic> json) =>
ExtensibleObject(
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensibleObjectToJson(ExtensibleObject instance) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
};
EntityDto<TPrimaryKey> _$EntityDtoFromJson<TPrimaryKey>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
) =>
EntityDto<TPrimaryKey>(
id: fromJsonTPrimaryKey(json['id']),
);
Map<String, dynamic> _$EntityDtoToJson<TPrimaryKey>(
EntityDto<TPrimaryKey> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
) =>
<String, dynamic>{
'id': toJsonTPrimaryKey(instance.id),
};
CreationAuditedEntityDto<TPrimaryKey>
_$CreationAuditedEntityDtoFromJson<TPrimaryKey>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
) =>
CreationAuditedEntityDto<TPrimaryKey>(
id: fromJsonTPrimaryKey(json['id']),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
);
Map<String, dynamic> _$CreationAuditedEntityDtoToJson<TPrimaryKey>(
CreationAuditedEntityDto<TPrimaryKey> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
) =>
<String, dynamic>{
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
};
CreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto>
_$CreationAuditedEntityWithUserDtoFromJson<TPrimaryKey, TUserDto>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
TUserDto Function(Object? json) fromJsonTUserDto,
) =>
CreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto>(
id: fromJsonTPrimaryKey(json['id']),
creator: fromJsonTUserDto(json['creator']),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
);
Map<String, dynamic>
_$CreationAuditedEntityWithUserDtoToJson<TPrimaryKey, TUserDto>(
CreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
Object? Function(TUserDto value) toJsonTUserDto,
) =>
<String, dynamic>{
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'creator': toJsonTUserDto(instance.creator),
};
AuditedEntityDto<TPrimaryKey> _$AuditedEntityDtoFromJson<TPrimaryKey>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
) =>
AuditedEntityDto<TPrimaryKey>(
id: fromJsonTPrimaryKey(json['id']),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
lastModificationTime: json['lastModificationTime'] == null
? null
: DateTime.parse(json['lastModificationTime'] as String),
lastModifierId: json['lastModifierId'] as String?,
);
Map<String, dynamic> _$AuditedEntityDtoToJson<TPrimaryKey>(
AuditedEntityDto<TPrimaryKey> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
) =>
<String, dynamic>{
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'lastModificationTime': instance.lastModificationTime?.toIso8601String(),
'lastModifierId': instance.lastModifierId,
};
AuditedEntityWithUserDto<TPrimaryKey, TUserDto>
_$AuditedEntityWithUserDtoFromJson<TPrimaryKey, TUserDto>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
TUserDto Function(Object? json) fromJsonTUserDto,
) =>
AuditedEntityWithUserDto<TPrimaryKey, TUserDto>(
id: fromJsonTPrimaryKey(json['id']),
creator: fromJsonTUserDto(json['creator']),
lastModifier: fromJsonTUserDto(json['lastModifier']),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
lastModificationTime: json['lastModificationTime'] == null
? null
: DateTime.parse(json['lastModificationTime'] as String),
lastModifierId: json['lastModifierId'] as String?,
);
Map<String, dynamic> _$AuditedEntityWithUserDtoToJson<TPrimaryKey, TUserDto>(
AuditedEntityWithUserDto<TPrimaryKey, TUserDto> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
Object? Function(TUserDto value) toJsonTUserDto,
) =>
<String, dynamic>{
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'lastModificationTime': instance.lastModificationTime?.toIso8601String(),
'lastModifierId': instance.lastModifierId,
'creator': toJsonTUserDto(instance.creator),
'lastModifier': toJsonTUserDto(instance.lastModifier),
};
FullAuditedEntityDto<TPrimaryKey> _$FullAuditedEntityDtoFromJson<TPrimaryKey>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
) =>
FullAuditedEntityDto<TPrimaryKey>(
id: fromJsonTPrimaryKey(json['id']),
isDeleted: json['isDeleted'] as bool,
deleterId: json['deleterId'] as String?,
deletionTime: json['deletionTime'] == null
? null
: DateTime.parse(json['deletionTime'] as String),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
lastModificationTime: json['lastModificationTime'] == null
? null
: DateTime.parse(json['lastModificationTime'] as String),
lastModifierId: json['lastModifierId'] as String?,
);
Map<String, dynamic> _$FullAuditedEntityDtoToJson<TPrimaryKey>(
FullAuditedEntityDto<TPrimaryKey> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
) =>
<String, dynamic>{
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'lastModificationTime': instance.lastModificationTime?.toIso8601String(),
'lastModifierId': instance.lastModifierId,
'isDeleted': instance.isDeleted,
'deleterId': instance.deleterId,
'deletionTime': instance.deletionTime?.toIso8601String(),
};
FullAuditedEntityWithUserDto<TPrimaryKey, TUserDto>
_$FullAuditedEntityWithUserDtoFromJson<TPrimaryKey, TUserDto>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
TUserDto Function(Object? json) fromJsonTUserDto,
) =>
FullAuditedEntityWithUserDto<TPrimaryKey, TUserDto>(
id: fromJsonTPrimaryKey(json['id']),
creator: fromJsonTUserDto(json['creator']),
lastModifier: fromJsonTUserDto(json['lastModifier']),
deleter: fromJsonTUserDto(json['deleter']),
isDeleted: json['isDeleted'] as bool,
deleterId: json['deleterId'] as String?,
deletionTime: json['deletionTime'] == null
? null
: DateTime.parse(json['deletionTime'] as String),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
lastModificationTime: json['lastModificationTime'] == null
? null
: DateTime.parse(json['lastModificationTime'] as String),
lastModifierId: json['lastModifierId'] as String?,
);
Map<String, dynamic>
_$FullAuditedEntityWithUserDtoToJson<TPrimaryKey, TUserDto>(
FullAuditedEntityWithUserDto<TPrimaryKey, TUserDto> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
Object? Function(TUserDto value) toJsonTUserDto,
) =>
<String, dynamic>{
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'lastModificationTime':
instance.lastModificationTime?.toIso8601String(),
'lastModifierId': instance.lastModifierId,
'isDeleted': instance.isDeleted,
'deleterId': instance.deleterId,
'deletionTime': instance.deletionTime?.toIso8601String(),
'creator': toJsonTUserDto(instance.creator),
'lastModifier': toJsonTUserDto(instance.lastModifier),
'deleter': toJsonTUserDto(instance.deleter),
};
ExtensibleEntityDto<TPrimaryKey> _$ExtensibleEntityDtoFromJson<TPrimaryKey>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
) =>
ExtensibleEntityDto<TPrimaryKey>(
id: fromJsonTPrimaryKey(json['id']),
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensibleEntityDtoToJson<TPrimaryKey>(
ExtensibleEntityDto<TPrimaryKey> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'id': toJsonTPrimaryKey(instance.id),
};
ExtensibleCreationAuditedEntityDto<TPrimaryKey>
_$ExtensibleCreationAuditedEntityDtoFromJson<TPrimaryKey>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
) =>
ExtensibleCreationAuditedEntityDto<TPrimaryKey>(
id: fromJsonTPrimaryKey(json['id']),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensibleCreationAuditedEntityDtoToJson<TPrimaryKey>(
ExtensibleCreationAuditedEntityDto<TPrimaryKey> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
};
ExtensibleCreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto>
_$ExtensibleCreationAuditedEntityWithUserDtoFromJson<TPrimaryKey, TUserDto>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
TUserDto Function(Object? json) fromJsonTUserDto,
) =>
ExtensibleCreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto>(
id: fromJsonTPrimaryKey(json['id']),
creator: fromJsonTUserDto(json['creator']),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic>
_$ExtensibleCreationAuditedEntityWithUserDtoToJson<TPrimaryKey, TUserDto>(
ExtensibleCreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
Object? Function(TUserDto value) toJsonTUserDto,
) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'creator': toJsonTUserDto(instance.creator),
};
ExtensibleAuditedEntityDto<TPrimaryKey>
_$ExtensibleAuditedEntityDtoFromJson<TPrimaryKey>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
) =>
ExtensibleAuditedEntityDto<TPrimaryKey>(
id: fromJsonTPrimaryKey(json['id']),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
lastModificationTime: json['lastModificationTime'] == null
? null
: DateTime.parse(json['lastModificationTime'] as String),
lastModifierId: json['lastModifierId'] as String?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensibleAuditedEntityDtoToJson<TPrimaryKey>(
ExtensibleAuditedEntityDto<TPrimaryKey> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'lastModificationTime': instance.lastModificationTime?.toIso8601String(),
'lastModifierId': instance.lastModifierId,
};
ExtensibleAuditedEntityWithUserDto<TPrimaryKey, TUserDto>
_$ExtensibleAuditedEntityWithUserDtoFromJson<TPrimaryKey, TUserDto>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
TUserDto Function(Object? json) fromJsonTUserDto,
) =>
ExtensibleAuditedEntityWithUserDto<TPrimaryKey, TUserDto>(
id: fromJsonTPrimaryKey(json['id']),
creator: fromJsonTUserDto(json['creator']),
lastModifier: fromJsonTUserDto(json['lastModifier']),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
lastModificationTime: json['lastModificationTime'] == null
? null
: DateTime.parse(json['lastModificationTime'] as String),
lastModifierId: json['lastModifierId'] as String?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic>
_$ExtensibleAuditedEntityWithUserDtoToJson<TPrimaryKey, TUserDto>(
ExtensibleAuditedEntityWithUserDto<TPrimaryKey, TUserDto> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
Object? Function(TUserDto value) toJsonTUserDto,
) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'lastModificationTime':
instance.lastModificationTime?.toIso8601String(),
'lastModifierId': instance.lastModifierId,
'creator': toJsonTUserDto(instance.creator),
'lastModifier': toJsonTUserDto(instance.lastModifier),
};
ExtensibleFullAuditedEntityDto<TPrimaryKey>
_$ExtensibleFullAuditedEntityDtoFromJson<TPrimaryKey>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
) =>
ExtensibleFullAuditedEntityDto<TPrimaryKey>(
id: fromJsonTPrimaryKey(json['id']),
isDeleted: json['isDeleted'] as bool,
deleterId: json['deleterId'] as String?,
deletionTime: json['deletionTime'] == null
? null
: DateTime.parse(json['deletionTime'] as String),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
lastModificationTime: json['lastModificationTime'] == null
? null
: DateTime.parse(json['lastModificationTime'] as String),
lastModifierId: json['lastModifierId'] as String?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensibleFullAuditedEntityDtoToJson<TPrimaryKey>(
ExtensibleFullAuditedEntityDto<TPrimaryKey> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'lastModificationTime': instance.lastModificationTime?.toIso8601String(),
'lastModifierId': instance.lastModifierId,
'isDeleted': instance.isDeleted,
'deleterId': instance.deleterId,
'deletionTime': instance.deletionTime?.toIso8601String(),
};
ExtensibleFullAuditedEntityWithUserDto<TPrimaryKey, TUserDto>
_$ExtensibleFullAuditedEntityWithUserDtoFromJson<TPrimaryKey, TUserDto>(
Map<String, dynamic> json,
TPrimaryKey Function(Object? json) fromJsonTPrimaryKey,
TUserDto Function(Object? json) fromJsonTUserDto,
) =>
ExtensibleFullAuditedEntityWithUserDto<TPrimaryKey, TUserDto>(
id: fromJsonTPrimaryKey(json['id']),
creator: fromJsonTUserDto(json['creator']),
lastModifier: fromJsonTUserDto(json['lastModifier']),
deleter: fromJsonTUserDto(json['deleter']),
isDeleted: json['isDeleted'] as bool,
deleterId: json['deleterId'] as String?,
deletionTime: json['deletionTime'] == null
? null
: DateTime.parse(json['deletionTime'] as String),
creationTime: DateTime.parse(json['creationTime'] as String),
creatorId: json['creatorId'] as String?,
lastModificationTime: json['lastModificationTime'] == null
? null
: DateTime.parse(json['lastModificationTime'] as String),
lastModifierId: json['lastModifierId'] as String?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic>
_$ExtensibleFullAuditedEntityWithUserDtoToJson<TPrimaryKey, TUserDto>(
ExtensibleFullAuditedEntityWithUserDto<TPrimaryKey, TUserDto> instance,
Object? Function(TPrimaryKey value) toJsonTPrimaryKey,
Object? Function(TUserDto value) toJsonTUserDto,
) =>
<String, dynamic>{
'extraProperties': instance.extraProperties,
'id': toJsonTPrimaryKey(instance.id),
'creationTime': instance.creationTime.toIso8601String(),
'creatorId': instance.creatorId,
'lastModificationTime':
instance.lastModificationTime?.toIso8601String(),
'lastModifierId': instance.lastModifierId,
'isDeleted': instance.isDeleted,
'deleterId': instance.deleterId,
'deletionTime': instance.deletionTime?.toIso8601String(),
'creator': toJsonTUserDto(instance.creator),
'lastModifier': toJsonTUserDto(instance.lastModifier),
'deleter': toJsonTUserDto(instance.deleter),
};
ListResultDto<T> _$ListResultDtoFromJson<T>(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
ListResultDto<T>(
items: (json['items'] as List<dynamic>).map(fromJsonT).toList(),
);
Map<String, dynamic> _$ListResultDtoToJson<T>(
ListResultDto<T> instance,
Object? Function(T value) toJsonT,
) =>
<String, dynamic>{
'items': instance.items.map(toJsonT).toList(),
};
LimitedResultRequestDto _$LimitedResultRequestDtoFromJson(
Map<String, dynamic> json) =>
LimitedResultRequestDto(
maxResultCount: json['maxResultCount'] as int?,
);
Map<String, dynamic> _$LimitedResultRequestDtoToJson(
LimitedResultRequestDto instance) =>
<String, dynamic>{
'maxResultCount': instance.maxResultCount,
};
ExtensibleLimitedResultRequestDto _$ExtensibleLimitedResultRequestDtoFromJson(
Map<String, dynamic> json) =>
ExtensibleLimitedResultRequestDto(
maxResultCount: json['maxResultCount'] as int?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensibleLimitedResultRequestDtoToJson(
ExtensibleLimitedResultRequestDto instance) =>
<String, dynamic>{
'maxResultCount': instance.maxResultCount,
'extraProperties': instance.extraProperties,
};
ExtensibleListResultDto<T> _$ExtensibleListResultDtoFromJson<T>(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
ExtensibleListResultDto<T>(
items: (json['items'] as List<dynamic>).map(fromJsonT).toList(),
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensibleListResultDtoToJson<T>(
ExtensibleListResultDto<T> instance,
Object? Function(T value) toJsonT,
) =>
<String, dynamic>{
'items': instance.items.map(toJsonT).toList(),
'extraProperties': instance.extraProperties,
};
PagedResultDto<T> _$PagedResultDtoFromJson<T>(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
PagedResultDto<T>(
totalCount: json['totalCount'] as int,
items: (json['items'] as List<dynamic>).map(fromJsonT).toList(),
);
Map<String, dynamic> _$PagedResultDtoToJson<T>(
PagedResultDto<T> instance,
Object? Function(T value) toJsonT,
) =>
<String, dynamic>{
'items': instance.items.map(toJsonT).toList(),
'totalCount': instance.totalCount,
};
ExtensiblePagedResultDto<T> _$ExtensiblePagedResultDtoFromJson<T>(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
ExtensiblePagedResultDto<T>(
totalCount: json['totalCount'] as int,
items: (json['items'] as List<dynamic>).map(fromJsonT).toList(),
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensiblePagedResultDtoToJson<T>(
ExtensiblePagedResultDto<T> instance,
Object? Function(T value) toJsonT,
) =>
<String, dynamic>{
'items': instance.items.map(toJsonT).toList(),
'totalCount': instance.totalCount,
'extraProperties': instance.extraProperties,
};
SortedResultRequest _$SortedResultRequestFromJson(Map<String, dynamic> json) =>
SortedResultRequest(
sorting: json['sorting'] as String?,
);
Map<String, dynamic> _$SortedResultRequestToJson(
SortedResultRequest instance) =>
<String, dynamic>{
'sorting': instance.sorting,
};
PagedResultRequestDto _$PagedResultRequestDtoFromJson(
Map<String, dynamic> json) =>
PagedResultRequestDto(
skipCount: json['skipCount'] as int?,
maxResultCount: json['maxResultCount'] as int?,
);
Map<String, dynamic> _$PagedResultRequestDtoToJson(
PagedResultRequestDto instance) =>
<String, dynamic>{
'maxResultCount': instance.maxResultCount,
'skipCount': instance.skipCount,
};
PagedAndSortedResultRequestDto _$PagedAndSortedResultRequestDtoFromJson(
Map<String, dynamic> json) =>
PagedAndSortedResultRequestDto(
skipCount: json['skipCount'] as int?,
maxResultCount: json['maxResultCount'] as int?,
sorting: json['sorting'] as String?,
);
Map<String, dynamic> _$PagedAndSortedResultRequestDtoToJson(
PagedAndSortedResultRequestDto instance) =>
<String, dynamic>{
'maxResultCount': instance.maxResultCount,
'skipCount': instance.skipCount,
'sorting': instance.sorting,
};
ExtensiblePagedAndSortedResultRequestDto
_$ExtensiblePagedAndSortedResultRequestDtoFromJson(
Map<String, dynamic> json) =>
ExtensiblePagedAndSortedResultRequestDto(
skipCount: json['skipCount'] as int?,
maxResultCount: json['maxResultCount'] as int?,
sorting: json['sorting'] as String?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensiblePagedAndSortedResultRequestDtoToJson(
ExtensiblePagedAndSortedResultRequestDto instance) =>
<String, dynamic>{
'maxResultCount': instance.maxResultCount,
'skipCount': instance.skipCount,
'sorting': instance.sorting,
'extraProperties': instance.extraProperties,
};
ExtensiblePagedResultRequestDto _$ExtensiblePagedResultRequestDtoFromJson(
Map<String, dynamic> json) =>
ExtensiblePagedResultRequestDto(
skipCount: json['skipCount'] as int?,
maxResultCount: json['maxResultCount'] as int?,
extraProperties: json['extraProperties'] as Map<String, dynamic>?,
);
Map<String, dynamic> _$ExtensiblePagedResultRequestDtoToJson(
ExtensiblePagedResultRequestDto instance) =>
<String, dynamic>{
'maxResultCount': instance.maxResultCount,
'skipCount': instance.skipCount,
'extraProperties': instance.extraProperties,
};

3
apps/flutter/core/lib/models/abp.entity.dart

@ -0,0 +1,3 @@
abstract class IHasConcurrencyStamp {
String? concurrencyStamp;
}

34
apps/flutter/core/lib/models/auth.dart

@ -221,6 +221,7 @@ class Token {
Token({
required this.accessToken,
this.expiresIn,
this.expiration,
this.tokenType,
this.refreshToken,
this.scope,
@ -231,6 +232,9 @@ class Token {
///
@JsonKey(name: 'expires_in')
int? expiresIn;
///
@JsonKey(name: 'expiration')
DateTime? expiration;
///
@JsonKey(name: 'token_type')
String? tokenType;
@ -283,3 +287,33 @@ class UserProfile {
factory UserProfile.fromJson(Map<String, dynamic> json) => _$UserProfileFromJson(json);
Map<String, dynamic> toJson() => _$UserProfileToJson(this);
}
class PortalLoginProvider {
PortalLoginProvider({
required this.id,
required this.name,
this.logo,
});
String id;
String name;
String? logo;
factory PortalLoginProvider.fromJson(Map<String, dynamic> json) =>
PortalLoginProvider(
id: json['Id'] as String,
name: json['Name'] as String,
logo: json['Logo'] as String?,
);
Map<String, dynamic> toJson() =>
<String, dynamic>{
'Id': id,
'Name': name,
'Logo': logo,
};
}
class PortalLoginException implements Exception {
PortalLoginException(this.providers);
List<PortalLoginProvider> providers;
}

4
apps/flutter/core/lib/models/auth.g.dart

@ -128,6 +128,9 @@ Map<String, dynamic> _$RefreshTokenRequestToJson(
Token _$TokenFromJson(Map<String, dynamic> json) => Token(
accessToken: json['access_token'] as String,
expiresIn: json['expires_in'] as int?,
expiration: json['expiration'] == null
? null
: DateTime.tryParse(json['expiration'] as String),
tokenType: json['token_type'] as String?,
refreshToken: json['refresh_token'] as String?,
scope: json['scope'] as String?,
@ -136,6 +139,7 @@ Token _$TokenFromJson(Map<String, dynamic> json) => Token(
Map<String, dynamic> _$TokenToJson(Token instance) => <String, dynamic>{
'access_token': instance.accessToken,
'expires_in': instance.expiresIn,
'expiration': instance.expiration?.toString(),
'token_type': instance.tokenType,
'refresh_token': instance.refreshToken,
'scope': instance.scope,

27
apps/flutter/core/lib/models/common.dart

@ -1,3 +1,21 @@
import 'environment.dart';
class Application {
Application({
required this.environment,
});
Environment environment;
factory Application.fromJson(Map<String, dynamic> json) => Application(
environment: Environment.fromJson(json),
);
Map<String, dynamic> toJson() =>
<String, dynamic>{
'environment': environment,
};
}
class Localization {
Localization(
this.culture,
@ -15,3 +33,12 @@ class LocalizationResource {
String resourceName;
Map<String, String> texts;
}
class SignalrMessage {
SignalrMessage(
this.method,
this.data,
);
String method;
List<Object?> data;
}

342
apps/flutter/core/lib/models/environment.dart

@ -0,0 +1,342 @@
import 'package:core/proxy/volo/abp/localization/models.dart';
import 'package:json_annotation/json_annotation.dart';
part 'environment.g.dart';
@JsonSerializable()
class Environment {
Environment({
required this.application,
required this.remoteServices,
required this.auth,
required this.tenant,
required this.localization,
required this.remoteEnvironment,
this.notifications,
});
ApplicationConfig application;
RemoteServiceConfig remoteServices;
AuthConfig auth;
TenantConfig tenant;
LocalizationConfig localization;
NotificationConfig? notifications;
RemoteEnvironmentConfig remoteEnvironment;
factory Environment.empty() {
return Environment(
application: ApplicationConfig(name: ''),
remoteServices: RemoteServiceConfig(services: {}),
auth: AuthConfig(authority: '', clientId: ''),
tenant: TenantConfig(tenantKey: ''),
localization: LocalizationConfig(defaultLanguage: ''),
remoteEnvironment: RemoteEnvironmentConfig(url: 'url'),
);
}
factory Environment.fromJson(Map<String, dynamic> json) => _$EnvironmentFromJson(json);
Map<String, dynamic> toJson() => _$EnvironmentToJson(this);
Environment copyWith({
ApplicationConfig? application,
RemoteServiceConfig? remoteServices,
AuthConfig? auth,
TenantConfig? tenant,
LocalizationConfig? localization,
NotificationConfig? notifications,
RemoteEnvironmentConfig? remoteEnvironment,
}) {
return Environment(
application: application ?? this.application,
remoteServices: remoteServices ?? this.remoteServices,
auth: auth ?? this.auth,
tenant: tenant ?? this.tenant,
localization: localization ?? this.localization,
notifications: notifications ?? this.notifications,
remoteEnvironment: remoteEnvironment ?? this.remoteEnvironment,
);
}
}
@JsonEnum()
enum MergeStrategy {
@JsonValue('deepmerge')
deepmerge,
@JsonValue('overwrite')
overwrite;
}
@JsonSerializable()
class RemoteEnvironmentConfig {
RemoteEnvironmentConfig({
required this.url,
this.strategy = MergeStrategy.deepmerge,
this.method = 'GET',
this.headers,
});
String url;
MergeStrategy? strategy;
String? method;
Map<String, String>? headers;
factory RemoteEnvironmentConfig.fromJson(Map<String, dynamic> json) => _$RemoteEnvironmentConfigFromJson(json);
Map<String, dynamic> toJson() => _$RemoteEnvironmentConfigToJson(this);
RemoteEnvironmentConfig copyWith({
String? url,
MergeStrategy? strategy,
String? method,
Map<String, String>? headers,
}) {
return RemoteEnvironmentConfig(
url: url ?? this.url,
strategy: strategy ?? this.strategy,
method: method ?? this.method,
headers: headers ?? this.headers,
);
}
}
@JsonSerializable()
class ApplicationConfig {
ApplicationConfig({
required this.name,
this.framework = 'flutter',
});
String name;
String? framework;
factory ApplicationConfig.fromJson(Map<String, dynamic> json) => _$ApplicationConfigFromJson(json);
Map<String, dynamic> toJson() => _$ApplicationConfigToJson(this);
ApplicationConfig copyWith({
String? name,
}) {
return ApplicationConfig(
name: name ?? this.name,
);
}
}
@JsonSerializable()
class AuthConfig {
AuthConfig({
required this.authority,
required this.clientId,
this.clientSecret,
});
String clientId;
String? clientSecret;
String authority;
factory AuthConfig.fromJson(Map<String, dynamic> json) => _$AuthConfigFromJson(json);
Map<String, dynamic> toJson() => _$AuthConfigToJson(this);
AuthConfig copyWith({
String? clientId,
String? clientSecret,
String? authority,
}) {
return AuthConfig(
authority: authority ?? this.authority,
clientId: clientId ?? this.clientId,
clientSecret: clientSecret ?? this.clientSecret,
);
}
String getAuthority() {
return _mapToAuthority(authority);
}
String _mapToAuthority(String authority) {
return authority.endsWith('/') ? authority : '$authority/';
}
}
@JsonSerializable()
class TenantConfig {
TenantConfig({
this.tenantKey,
});
String? tenantKey;
factory TenantConfig.fromJson(Map<String, dynamic> json) => _$TenantConfigFromJson(json);
Map<String, dynamic> toJson() => _$TenantConfigToJson(this);
TenantConfig copyWith({
String? tenantKey,
}) {
return TenantConfig(
tenantKey: tenantKey ?? this.tenantKey,
);
}
}
@JsonSerializable()
class LocalizationConfig {
LocalizationConfig({
this.defaultLanguage,
this.useLocalResources = true,
this.supportedLocales = const [],
});
String? defaultLanguage;
bool? useLocalResources;
List<LanguageInfo>? supportedLocales;
factory LocalizationConfig.fromJson(Map<String, dynamic> json) => _$LocalizationConfigFromJson(json);
Map<String, dynamic> toJson() => _$LocalizationConfigToJson(this);
LocalizationConfig copyWith({
String? defaultLanguage,
bool? useLocalResources,
}) {
return LocalizationConfig(
defaultLanguage: defaultLanguage ?? this.defaultLanguage,
useLocalResources: useLocalResources ?? this.useLocalResources,
);
}
}
class RemoteServiceConfig {
RemoteServiceConfig({
required Map<String, RemoteService> services,
}) {
_services = services;
}
late Map<String, RemoteService> _services;
RemoteService get def => this['default']!;
RemoteService? operator [](String key) => _services[key];
void operator []=(String key, RemoteService service) => _services[key] = service;
RemoteServiceConfig copyWith({
Map<String, RemoteService>? services,
}) {
return RemoteServiceConfig(
services: services ?? _services,
);
}
String getApiUrl(String? key) {
return _mapToApiUrl(key)(this);
}
String Function(RemoteServiceConfig) _mapToApiUrl([String? key]) {
return (RemoteServiceConfig services) {
if (key != null) {
return services[key]?.url ?? services.def.url;
}
return services.def.url;
};
}
}
@JsonSerializable()
class RemoteService {
RemoteService({
required this.url,
this.rootNamespace,
});
String url;
String? rootNamespace;
factory RemoteService.fromJson(Map<String, dynamic> json) => _$RemoteServiceFromJson(json);
Map<String, dynamic> toJson() => _$RemoteServiceToJson(this);
RemoteService copyWith({
String? url,
String? rootNamespace,
}) {
return RemoteService(
url: url ?? this.url,
rootNamespace: rootNamespace ?? this.rootNamespace,
);
}
}
@JsonSerializable()
class NotificationConfig {
NotificationConfig({
this.serverUrl,
this.android,
this.darwin,
this.linux,
});
String? serverUrl;
AndroidNotification? android;
DarwinNotification? darwin;
LinuxNotification? linux;
factory NotificationConfig.fromJson(Map<String, dynamic> json) => _$NotificationConfigFromJson(json);
Map<String, dynamic> toJson() => _$NotificationConfigToJson(this);
NotificationConfig copyWith({
AndroidNotification? android,
DarwinNotification? darwin,
LinuxNotification? linux,
}) {
return NotificationConfig(
android: android ?? this.android,
darwin: darwin ?? this.darwin,
linux: linux ?? this.linux,
);
}
}
@JsonSerializable()
class LinuxNotification {
LinuxNotification({
required this.defaultActionName,
});
String defaultActionName;
factory LinuxNotification.fromJson(Map<String, dynamic> json) => _$LinuxNotificationFromJson(json);
Map<String, dynamic> toJson() => _$LinuxNotificationToJson(this);
LinuxNotification copyWith({
String? defaultActionName,
}) {
return LinuxNotification(
defaultActionName: defaultActionName ?? this.defaultActionName,
);
}
}
@JsonSerializable()
class AndroidNotification {
AndroidNotification({
required this.channelId,
required this.channelName,
this.channelDescription,
});
String channelId;
String channelName;
String? channelDescription;
factory AndroidNotification.fromJson(Map<String, dynamic> json) => _$AndroidNotificationFromJson(json);
Map<String, dynamic> toJson() => _$AndroidNotificationToJson(this);
AndroidNotification copyWith({
String? channelId,
String? channelName,
String? channelDescription,
}) {
return AndroidNotification(
channelId: channelId ?? this.channelId,
channelName: channelName ?? this.channelName,
channelDescription: channelDescription ?? this.channelDescription,
);
}
}
@JsonSerializable()
class DarwinNotification {
DarwinNotification();
factory DarwinNotification.fromJson(Map<String, dynamic> json) => _$DarwinNotificationFromJson(json);
Map<String, dynamic> toJson() => _$DarwinNotificationToJson(this);
DarwinNotification copyWith() {
return DarwinNotification(
);
}
}

178
apps/flutter/core/lib/models/environment.g.dart

@ -0,0 +1,178 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'environment.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Environment _$EnvironmentFromJson(Map<String, dynamic> json) => Environment(
application: ApplicationConfig.fromJson(
json['application'] as Map<String, dynamic>),
remoteServices: RemoteServiceConfig(
services: (json['remoteServices'] as Map<String, dynamic>)
.map((key, value) => MapEntry(key, RemoteService.fromJson(value as Map<String, dynamic>)))),
auth: AuthConfig.fromJson(json['auth'] as Map<String, dynamic>),
tenant: TenantConfig.fromJson(json['tenant'] as Map<String, dynamic>),
localization: LocalizationConfig.fromJson(
json['localization'] as Map<String, dynamic>),
remoteEnvironment: RemoteEnvironmentConfig.fromJson(
json['remoteEnvironment'] as Map<String, dynamic>),
notifications: json['notifications'] == null
? null
: NotificationConfig.fromJson(
json['notifications'] as Map<String, dynamic>),
);
Map<String, dynamic> _$EnvironmentToJson(Environment instance) =>
<String, dynamic>{
'application': instance.application,
'remoteServices': instance.remoteServices,
'auth': instance.auth,
'tenant': instance.tenant,
'localization': instance.localization,
'notifications': instance.notifications,
'remoteEnvironment': instance.remoteEnvironment,
};
RemoteEnvironmentConfig _$RemoteEnvironmentConfigFromJson(
Map<String, dynamic> json) =>
RemoteEnvironmentConfig(
url: json['url'] as String,
strategy: $enumDecodeNullable(_$MergeStrategyEnumMap, json['strategy']) ??
MergeStrategy.deepmerge,
method: json['method'] as String? ?? 'GET',
headers: (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String),
),
);
Map<String, dynamic> _$RemoteEnvironmentConfigToJson(
RemoteEnvironmentConfig instance) =>
<String, dynamic>{
'url': instance.url,
'strategy': _$MergeStrategyEnumMap[instance.strategy],
'method': instance.method,
'headers': instance.headers,
};
const _$MergeStrategyEnumMap = {
MergeStrategy.deepmerge: 'deepmerge',
MergeStrategy.overwrite: 'overwrite',
};
ApplicationConfig _$ApplicationConfigFromJson(Map<String, dynamic> json) =>
ApplicationConfig(
name: json['name'] as String,
framework: json['framework'] as String?,
);
Map<String, dynamic> _$ApplicationConfigToJson(ApplicationConfig instance) =>
<String, dynamic>{
'name': instance.name,
'framework': instance.framework,
};
AuthConfig _$AuthConfigFromJson(Map<String, dynamic> json) => AuthConfig(
authority: json['authority'] as String,
clientId: json['clientId'] as String,
clientSecret: json['clientSecret'] as String?,
);
Map<String, dynamic> _$AuthConfigToJson(AuthConfig instance) =>
<String, dynamic>{
'clientId': instance.clientId,
'clientSecret': instance.clientSecret,
'authority': instance.authority,
};
TenantConfig _$TenantConfigFromJson(Map<String, dynamic> json) => TenantConfig(
tenantKey: json['tenantKey'] as String?,
);
Map<String, dynamic> _$TenantConfigToJson(TenantConfig instance) =>
<String, dynamic>{
'tenantKey': instance.tenantKey,
};
LocalizationConfig _$LocalizationConfigFromJson(Map<String, dynamic> json) =>
LocalizationConfig(
defaultLanguage: json['defaultLanguage'] as String?,
useLocalResources: json['useLocalResources'] as bool?,
supportedLocales: json['supportedLocales'] != null
? (json['supportedLocales'] as List<dynamic>).map((e) => LanguageInfo.fromJson(e)).toList()
: null,
);
Map<String, dynamic> _$LocalizationConfigToJson(LocalizationConfig instance) =>
<String, dynamic>{
'defaultLanguage': instance.defaultLanguage,
'useLocalResources': instance.useLocalResources,
'supportedLocales': instance.supportedLocales,
};
RemoteService _$RemoteServiceFromJson(Map<String, dynamic> json) =>
RemoteService(
url: json['url'] as String,
rootNamespace: json['rootNamespace'] as String?,
);
Map<String, dynamic> _$RemoteServiceToJson(RemoteService instance) =>
<String, dynamic>{
'url': instance.url,
'rootNamespace': instance.rootNamespace,
};
NotificationConfig _$NotificationConfigFromJson(Map<String, dynamic> json) =>
NotificationConfig(
serverUrl: json['serverUrl'] as String?,
android: json['android'] == null
? null
: AndroidNotification.fromJson(
json['android'] as Map<String, dynamic>),
darwin: json['darwin'] == null
? null
: DarwinNotification.fromJson(json['darwin'] as Map<String, dynamic>),
linux: json['linux'] == null
? null
: LinuxNotification.fromJson(json['linux'] as Map<String, dynamic>),
);
Map<String, dynamic> _$NotificationConfigToJson(NotificationConfig instance) =>
<String, dynamic>{
'serverUrl': instance.serverUrl,
'android': instance.android,
'darwin': instance.darwin,
'linux': instance.linux,
};
LinuxNotification _$LinuxNotificationFromJson(Map<String, dynamic> json) =>
LinuxNotification(
defaultActionName: json['defaultActionName'] as String,
);
Map<String, dynamic> _$LinuxNotificationToJson(LinuxNotification instance) =>
<String, dynamic>{
'defaultActionName': instance.defaultActionName,
};
AndroidNotification _$AndroidNotificationFromJson(Map<String, dynamic> json) =>
AndroidNotification(
channelId: json['channelId'] as String,
channelName: json['channelName'] as String,
channelDescription: json['channelDescription'] as String?,
);
Map<String, dynamic> _$AndroidNotificationToJson(
AndroidNotification instance) =>
<String, dynamic>{
'channelId': instance.channelId,
'channelName': instance.channelName,
'channelDescription': instance.channelDescription,
};
DarwinNotification _$DarwinNotificationFromJson(Map<String, dynamic> json) =>
DarwinNotification();
Map<String, dynamic> _$DarwinNotificationToJson(DarwinNotification instance) =>
<String, dynamic>{};

2
apps/flutter/core/lib/models/index.dart

@ -1,7 +1,9 @@
export 'abp.dto.dart';
export 'abp.entity.dart';
export 'abp.error.dart';
export 'auth.dart';
export 'common.dart';
export 'environment.dart';
export 'oauth.dart';
export 'session.dart';
export 'theme.dart';

20
apps/flutter/core/lib/models/request.dart

@ -0,0 +1,20 @@
import 'package:dio/dio.dart';
class RequestOptions {
RequestOptions({
CancelToken? cancelToken,
this.sendTimeout,
this.receiveTimeout,
this.headers,
}) {
this.cancelToken = cancelToken ?? CancelToken();
}
late CancelToken? cancelToken;
late Duration? sendTimeout;
late Duration? receiveTimeout;
late Map<String, dynamic>? headers;
void cancel() {
cancelToken?.cancel();
}
}

1
apps/flutter/core/lib/models/session.dart

@ -5,7 +5,6 @@ import 'package:json_annotation/json_annotation.dart';
part 'session.g.dart';
///
@JsonSerializable()
class Session extends CloneObject<Session> {
Session({

56
apps/flutter/core/lib/modularity/module.dart

@ -1,11 +1,13 @@
import 'package:get/get.dart';
import '../dependency/index.dart';
import 'module.key.dart';
abstract class Module {
static final Map<Module, bool> _initModuleMap = {};
List<Module> get dependencies => const [];
late bool isInitlized= false;
Injector get injector => Injector.instance;
List<Module> get dependencies => const [];
List<GetPage> get routes => const [];
Future<void> configureServicesAsync() {
@ -16,79 +18,73 @@ abstract class Module {
}
T get<T>({String? tag}) => injector.get<T>(tag: tag);
T inject<T>(
T dependency,
{
String? tag,
bool permanent = false,
InstanceBuilderCallback<T>? builder,
}) => Get.put(dependency, tag: tag, permanent: permanent, builder: builder);
InjectorBuilderFactory<T>? builder,
}) => injector.inject(dependency, tag: tag, permanent: permanent, builder: builder);
void create<T>(
InstanceBuilderCallback<T> builder,
InjectorBuilderFactory<T> builder,
{
String? tag,
bool permanent = true,
}
) => Get.create(builder, tag: tag, permanent: permanent);
) => injector.create(builder, tag: tag, permanent: permanent);
void lazyInject<T>(
InstanceBuilderCallback<T> builder,
InjectorBuilderFactory<T> builder,
{
String? tag,
bool fenix = false,
}) => Get.lazyPut(builder, tag: tag, fenix: fenix);
}) => injector.lazyInject(builder, tag: tag, fenix: fenix);
Future<T> injectAsync<T>(
AsyncInstanceBuilderCallback<T> builder,
AsyncInjectorBuilderFactory<T> builder,
{
String? tag,
bool permanent = false,
}) => Get.putAsync(builder, tag: tag, permanent: permanent);
}) => injector.injectAsync(builder, tag: tag, permanent: permanent);
bool isInjected({String? tag}) => Get.isRegistered(tag: tag);
bool isInjected({String? tag}) => injector.isInjected(tag: tag);
Future<Map<ModuleKey, List<GetPage>>> initAsync() async {
final routeMap = <ModuleKey, List<GetPage>>{};
var routeMap = <ModuleKey, List<GetPage>>{};
if (isInitlized) return routeMap;
for (var dependency in dependencies) {
if (_initModuleMap.containsKey(dependency)) {
continue;
}
await dependency.configureServicesAsync();
var childrenRoute = await dependency.initAsync();
routeMap.addAll(childrenRoute);
_initModuleMap[dependency] = true;
}
await configureServicesAsync();
routeMap.assign(ModuleKey(toString()), routes);
_initModuleMap[this] = true;
routeMap.putIfAbsent(ModuleKey(toString()), () => routes);
isInitlized = true;
return routeMap;
}
Map<ModuleKey, List<GetPage>> init() {
final routeMap = <ModuleKey, List<GetPage>>{};
var routeMap = <ModuleKey, List<GetPage>>{};
if (isInitlized) return routeMap;
for (var dependency in dependencies) {
if (_initModuleMap.containsKey(dependency)) {
continue;
}
dependency.configureServices();
var childrenRoute = dependency.init();
routeMap.addAll(childrenRoute);
_initModuleMap[dependency] = true;
}
configureServices();
routeMap.assign(ModuleKey(toString()), routes);
_initModuleMap[this] = true;
routeMap.putIfAbsent(ModuleKey(toString()), () => routes);
isInitlized = true;
return routeMap;
}
List<GetPage> getRoutes() {
List<GetPage> findRoutes = [];
findRoutes.addAll(routes);
for (var dependency in dependencies) {
findRoutes.addAll(dependency.routes);
}
findRoutes.addAll(dependency.getRoutes());
}
findRoutes.addAll(routes);
return findRoutes;
}
}

15
apps/flutter/core/lib/proxy/lingyun/abp/asp-net-core/mvc/localization/language.service.dart

@ -1,17 +1,22 @@
import 'package:core/dependency/injector.dart';
import 'package:core/models/abp.dto.dart';
import 'package:core/proxy/volo/abp/localization/models.dart';
import 'package:core/services/rest.service.dart';
import 'package:get/get.dart';
class LanguageService {
RestService get _restService => Get.find();
LanguageService(Injector injector):
_restService = injector.get<RestService>();
final RestService _restService;
Future<ListResultDto<LanguageInfo>> getList() {
return _restService.get('/api/abp/localization/languages')
.then((res) {
return _restService.request<ListResultDto<LanguageInfo>>(
method: HttpMethod.GET,
url: '/api/abp/localization/languages',
transformer: (res) {
return ListResultDto<LanguageInfo>(
items: (res.data['items'] as List<dynamic>).map((e) => LanguageInfo.fromJson(e)).toList(),
);
});
}
);
}
}

14
apps/flutter/core/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.dart

@ -1,15 +1,21 @@
import 'package:core/dependency/injector.dart';
import 'package:core/proxy/volo/abp/http/modeling/index.dart';
import 'package:core/services/rest.service.dart';
import 'package:get/get.dart';
class AbpApiDefinitionService {
final RestService _restService = Get.find();
AbpApiDefinitionService(Injector injector):
_restService = injector.get<RestService>();
final RestService _restService;
Future<ApplicationApiDescriptionModel> getByModel(ApplicationApiDescriptionModelRequestDto model) {
return _restService.get('/api/abp/api-definition',
return _restService.request(
method: HttpMethod.GET,
url: '/api/abp/api-definition',
queryParameters: {
'includeTypes': model.includeTypes
}).then((res) => ApplicationApiDescriptionModel.fromJson(res.data));
},
transformer: (res) => ApplicationApiDescriptionModel.fromJson(res.data),
);
}
}

16
apps/flutter/core/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.dart

@ -1,16 +1,20 @@
import 'package:core/dependency/injector.dart';
import 'package:core/proxy/volo/abp/asp-net-core/mvc/application-configurations/index.dart';
import 'package:core/services/rest.service.dart';
import 'package:get/get.dart';
class AbpApplicationConfigurationService {
RestService get _restService => Get.find();
AbpApplicationConfigurationService(Injector injector):
_restService = injector.get<RestService>();
final RestService _restService;
Future<ApplicationConfigurationDto> get(ApplicationConfigurationRequestOptions options) {
return _restService.get('/api/abp/application-configuration',
return _restService.request(
method: HttpMethod.GET,
url: '/api/abp/application-configuration',
queryParameters: {
'includeLocalizationResources': options.includeLocalizationResources
}).then((res) {
return ApplicationConfigurationDto.fromJson(res.data);
});
},
transformer: (res) => ApplicationConfigurationDto.fromJson(res.data),
);
}
}

14
apps/flutter/core/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service.dart

@ -1,16 +1,22 @@
import 'package:get/get.dart';
import 'package:core/dependency/injector.dart';
import 'models.dart';
import 'package:core/services/rest.service.dart';
class AbpApplicationLocalizationService {
RestService get _restService => Get.find();
AbpApplicationLocalizationService(Injector injector):
_restService = injector.get<RestService>();
final RestService _restService;
Future<ApplicationLocalizationDto> get(ApplicationLocalizationRequestDto input) {
return _restService.get('/api/abp/application-localization',
return _restService.request(
method: HttpMethod.GET,
url: '/api/abp/application-localization',
queryParameters: {
'cultureName': input.cultureName,
'onlyDynamics': input.onlyDynamics
}).then((res) => ApplicationLocalizationDto.fromJson(res.data));
},
transformer: (res) => ApplicationLocalizationDto.fromJson(res.data)
);
}
}

20
apps/flutter/core/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/abp-tenant.service.dart

@ -1,18 +1,26 @@
import 'package:core/dependency/injector.dart';
import 'package:core/services/rest.service.dart';
import 'package:get/get.dart';
import 'models.dart';
class AbpTenantService {
RestService get _restService => Get.find();
AbpTenantService(Injector injector):
_restService = injector.get<RestService>();
final RestService _restService;
Future<FindTenantResultDto> findTenantById(String id) {
return _restService.get('/api/abp/multi-tenancy/tenants/by-id/$id')
.then((res) => FindTenantResultDto.fromJson(res.data));
return _restService.request(
method: HttpMethod.GET,
url: '/api/abp/multi-tenancy/tenants/by-id/$id',
transformer: (res) => FindTenantResultDto.fromJson(res.data),
);
}
Future<FindTenantResultDto> findTenantByName(String name) {
return _restService.get('/api/abp/multi-tenancy/tenants/by-name/$name')
.then((res) => FindTenantResultDto.fromJson(res.data));
return _restService.request(
method: HttpMethod.GET,
url: '/api/abp/multi-tenancy/tenants/by-name/$name',
transformer: (res) => FindTenantResultDto.fromJson(res.data),
);
}
}

5
apps/flutter/core/lib/services/application.initial.dart

@ -0,0 +1,5 @@
import 'package:core/models/index.dart';
abstract class ApplicationInitialService {
Future<Application> initialApp();
}

14
apps/flutter/core/lib/services/auth.service.dart

@ -1,14 +1,14 @@
import 'package:core/dependency/injector.dart';
import 'package:core/models/auth.dart';
import 'package:core/models/oauth.dart';
import 'package:get/get.dart';
import '../utils/logging.dart';
import 'service.base.dart';
abstract class AuthService extends ServiceBase {
static AuthService get to => Get.find();
AuthService(super._injector);
static AuthService get to => Injector.instance.get<AuthService>();
Future<Token> password(LoginParams params) {
logger.debug('not implemented');
@ -30,8 +30,8 @@ abstract class AuthService extends ServiceBase {
return Future.error('not implemented');
}
Future<UserProfile> getProfile() {
logger.debug('not implemented');
return Future.error('not implemented');
}
// Future<UserProfile> getProfile() {
// logger.debug('not implemented');
// return Future.error('not implemented');
// }
}

27
apps/flutter/core/lib/services/config.state.service.dart

@ -1,15 +1,21 @@
import 'dart:async';
import 'package:core/proxy/volo/abp/localization/models.dart';
import 'package:core/utils/string.extensions.dart';
import 'package:rxdart/rxdart.dart';
import 'environment.service.dart';
import 'service.base.dart';
import 'package:core/utils/internal.store.dart';
import 'package:core/proxy/volo/abp/asp-net-core/mvc/application-configurations/index.dart';
class ConfigStateService extends ServiceBase {
AbpApplicationConfigurationService get abpConfigService => find();
AbpApplicationLocalizationService get abpApplicationLocalizationService => find();
ConfigStateService(super._injector);
EnvironmentService get _environmentService => resolve<EnvironmentService>();
AbpApplicationConfigurationService get _abpConfigService => resolve<AbpApplicationConfigurationService>();
AbpApplicationLocalizationService get _abpApplicationLocalizationService => resolve<AbpApplicationLocalizationService>();
final bool? includeLocalizationResources = false;
final InternalStore<ApplicationConfigurationDto> _store = InternalStore<ApplicationConfigurationDto>(state: ApplicationConfigurationDto());
@ -31,13 +37,16 @@ class ConfigStateService extends ServiceBase {
_updateSubject
.switchMap((_) => Stream.fromFuture(getAbpConfig()))
.switchMap((appState) => Stream.fromFuture(getLocalizationAndCombineWithAppState(appState)))
.listen((appState) => _store.set(appState));
.listen(_store.set);
}
Future<ApplicationConfigurationDto> getLocalizationAndCombineWithAppState(ApplicationConfigurationDto appState) {
if (appState.localization?.currentCulture?.cultureName?.isNullOrWhiteSpace() == true) {
throw Exception('culture name should defined');
}
var environment = _environmentService.getEnvironment();
if (environment.localization.useLocalResources == true) return Future.value(appState);
return getlocalizationResource(appState.localization!.currentCulture!.cultureName!)
.then((localization) {
var abpConfig = appState.cloneWith((state) {
@ -53,13 +62,13 @@ class ConfigStateService extends ServiceBase {
}
Future<ApplicationLocalizationDto> getlocalizationResource(String cultureName) {
return abpApplicationLocalizationService.get(ApplicationLocalizationRequestDto(
return _abpApplicationLocalizationService.get(ApplicationLocalizationRequestDto(
cultureName: cultureName,
onlyDynamics: false));
}
Future<ApplicationConfigurationDto> getAbpConfig() {
return abpConfigService.get(ApplicationConfigurationRequestOptions(
return _abpConfigService.get(ApplicationConfigurationRequestOptions(
includeLocalizationResources: includeLocalizationResources
));
}
@ -128,4 +137,12 @@ class ConfigStateService extends ServiceBase {
bool getGlobalFeatureIsEnabled(String key) {
return _isGlobalFeatureEnabled(key, _store.state.globalFeatures!);
}
List<LanguageInfo>? getSupportedLocales() {
var environment = _environmentService.getEnvironment();
if (environment.localization.useLocalResources == true) {
return _environmentService.getSupportedLocales();
}
return _store.state.localization?.languages;
}
}

49
apps/flutter/core/lib/services/environment.service.dart

@ -0,0 +1,49 @@
import 'package:core/dependency/injector.dart';
import 'package:core/models/environment.dart';
import 'package:core/proxy/volo/abp/localization/models.dart';
import 'package:core/utils/index.dart';
import 'service.base.dart';
class EnvironmentService extends ServiceBase {
EnvironmentService(super._injector);
static EnvironmentService get to => Injector.instance.get<EnvironmentService>();
final InternalStore<Environment> _store = InternalStore<Environment>(state: Environment.empty());
Stream<Environment> get createOnUpdateStream {
return _store.sliceUpdate((state) => state);
}
setState(Environment environment) {
_store.set(environment);
}
Stream<Environment> getEnvironment$() {
return _store.sliceState((state) => state);
}
Environment getEnvironment() {
return _store.state;
}
Stream<String> getApiUrl$(String? key) {
return _store.sliceState((state) => state.remoteServices).map((services) => services.getApiUrl(key));
}
String getApiUrl(String? key) {
return _store.state.remoteServices.getApiUrl(key);
}
Stream<String> getAuthority$() {
return _store.sliceState((state) => state.auth).map((auth) => auth.getAuthority());
}
String getAuthority() {
return _store.state.auth.getAuthority();
}
List<LanguageInfo> getSupportedLocales() {
return _store.state.localization.supportedLocales ?? [];
}
}

14
apps/flutter/core/lib/services/error.reporter.service.dart

@ -0,0 +1,14 @@
import 'package:rxdart/rxdart.dart';
class ErrorReporterService {
final Subject<Exception> _reporter$ = BehaviorSubject<Exception>();
final BehaviorSubject<List<Exception>> _errors$ = BehaviorSubject<List<Exception>>.seeded([]);
Stream<Exception> getReporter$() => _reporter$;
Stream<List<Exception>> getErrors$() => _errors$;
void reportError(Exception exception){
_reporter$.add(exception);
_errors$.add([..._errors$.value, exception]);
}
}

5
apps/flutter/core/lib/services/index.dart

@ -1,5 +1,8 @@
export 'application.initial.dart';
export 'auth.service.dart';
export 'config.state.service.dart';
export 'environment.service.dart';
export 'error.reporter.service.dart';
export 'localization.service.dart';
export 'notification.send.service.dart';
export 'rest.service.dart';
@ -7,4 +10,4 @@ export 'storage.service.dart';
export 'session.service.dart';
export 'subscription.service.dart';
export 'theme.service.dart';
export 'signalr.service.dart';
export 'translation.service.dart';

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save