Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions lib/data/repository/source_repository_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,33 @@ class SourceRepositoryImpl implements SourceRepository {
}

for (final response in responses) {
final schema = response.value.containsKey('content')
? response.value['content']['schema'] ??
response.value['content'].containsKey('application/json')
? response.value['content']['application/json']['schema']
: response.value['content']['*/*']['schema']
: response.value['schema'];
Map<String, dynamic>? schema;

if (response.value.containsKey('content')) {
final content = response.value['content'];
if (content.containsKey('schema')) {
schema = content['schema'];
} else {
if (content.keys
.any((e) => e.toString().contains('application/json'))) {
schema = content[content.keys.firstWhere(
(e) => e.toString().contains('application/json'))]['schema'];
} else if (content.keys.any((e) => e.toString().contains('json'))) {
schema = content[content.keys
.firstWhere((e) => e.toString().contains('json'))]['schema'];
} else if (content.keys.any((e) => e.toString().contains('*/*'))) {
schema = content[content.keys
.firstWhere((e) => e.toString().contains('*/*'))]['schema'];
} else if (content.keys
.any((e) => e.toString().contains('text/plain'))) {
schema = content[content.keys
.firstWhere((e) => e.toString().contains('text/plain'))]
['schema'];
}
}
} else {
schema = response.value['schema'];
}

if (schema == null) {
return;
Expand All @@ -310,9 +331,8 @@ class SourceRepositoryImpl implements SourceRepository {
'List<${TypeMatcher.getDartType(schema['items']['type'])}>');
}
} else {
if (schema is Map &&
(schema.containsKey('additionalProperties') ||
schema.containsKey('properties'))) {
if (schema.containsKey('additionalProperties') ||
schema.containsKey('properties')) {
method.setResponseRuntimeType('Map<String, dynamic>');
} else {
method.setResponseRuntimeType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class GenerationScreenBloc extends BaseBloc<GenerationScreenEvent,
workingDirectory: state.config.projectPath);

gitGetBrickProcess.stdin.writeln(
'curl -L https://github.com/Onix-Systems/onix-flutter-project-generator/archive/refs/heads/main.zip --output brick.zip && unzip -qq -f brick.zip "onix-flutter-project-generator-main/bricks/*" -d bricks && rm brick.zip');
'curl -L https://github.com/Onix-Systems/onix-flutter-project-generator/archive/refs/heads/main.zip --output brick.zip && unzip -qq brick.zip -d bricks && rm brick.zip');

gitGetBrickProcess.stdin.writeln('echo "Complete with exit code: 0"');
await gitGetBrickProcess.exitCode;
Expand Down
2 changes: 1 addition & 1 deletion macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
Expand Down
2 changes: 1 addition & 1 deletion macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 33dc0a74a37eaaaa9a4d991374cc1fb2ce00b9ca

COCOAPODS: 1.12.1
COCOAPODS: 1.13.0
36 changes: 18 additions & 18 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ packages:
dependency: "direct main"
description:
name: connectivity_plus
sha256: "94d51c6f1299133a2baa4c5c3d2c11ec7d7fb4768dee5c52a56f7d7522fcf70e"
sha256: b502a681ba415272ecc41400bd04fe543ed1a62632137dc84d25a91e7746f55f
url: "https://pub.dev"
source: hosted
version: "5.0.0"
version: "5.0.1"
connectivity_plus_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -402,10 +402,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
sha256: ad76540d21c066228ee3f9d1dad64a9f7e46530e8bb7c85011a88bc1fd874bc5
url: "https://pub.dev"
source: hosted
version: "2.0.3"
version: "3.0.0"
flutter_localizations:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -489,10 +489,10 @@ packages:
dependency: "direct dev"
description:
name: freezed
sha256: "2df89855fe181baae3b6d714dc3c4317acf4fccd495a6f36e5e00f24144c6c3b"
sha256: "21bf2825311de65501d22e563e3d7605dff57fb5e6da982db785ae5372ff018a"
url: "https://pub.dev"
source: hosted
version: "2.4.1"
version: "2.4.5"
freezed_annotation:
dependency: "direct main"
description:
Expand Down Expand Up @@ -529,10 +529,10 @@ packages:
dependency: "direct main"
description:
name: go_router
sha256: "2ccd74480706e0a70a0e0dfa9543dede41bc11d0fe3b146a6ad7b7686f6b4407"
sha256: a206cc4621a644531a2e05e7774616ab4d9d85eab1f3b0e255f3102937fccab1
url: "https://pub.dev"
source: hosted
version: "11.1.4"
version: "12.0.0"
graphs:
dependency: transitive
description:
Expand Down Expand Up @@ -601,10 +601,10 @@ packages:
dependency: "direct main"
description:
name: intl_utils
sha256: "0d38f605f292321c0729f8c0632b845be77aa12d272b7bc5e3022bb670a7309e"
sha256: "5cad11e11ff7662c3cd0ef04729248591d71ed023d4ef0903a137528b4568adf"
url: "https://pub.dev"
source: hosted
version: "2.8.4"
version: "2.8.5"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -641,10 +641,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "3.0.0"
loader_overlay:
dependency: "direct main"
description:
Expand Down Expand Up @@ -737,10 +737,10 @@ packages:
dependency: "direct main"
description:
name: package_info_plus
sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a"
sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017"
url: "https://pub.dev"
source: hosted
version: "4.1.0"
version: "4.2.0"
package_info_plus_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -865,10 +865,10 @@ packages:
dependency: "direct main"
description:
name: process_run
sha256: ceacfac6d566a36c895d64edc7e429efb2d6b6303b5e28d5c13bc59fe6e8974e
sha256: "1cb96f835ec02ba1a35af4e6f99f937618023b6d2ffba88f0c0f1041af2e9f12"
url: "https://pub.dev"
source: hosted
version: "0.13.1"
version: "0.13.2"
provider:
dependency: transitive
description:
Expand Down Expand Up @@ -921,10 +921,10 @@ packages:
dependency: "direct main"
description:
name: searchfield
sha256: "0ec59811b013868bd2044c770e6ec19ecffc2455796ef4023bb948cd54b93a3a"
sha256: f087957e607a13add3c15e23ac7f9f63110c4e7a2964df81b1448e353e83b9b2
url: "https://pub.dev"
source: hosted
version: "0.8.5"
version: "0.8.6"
shared_preferences:
dependency: "direct main"
description:
Expand Down
18 changes: 9 additions & 9 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Onix Flutter Clean Architecture

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.12+12
version: 1.0.13+13

environment:
sdk: '>=3.0.0 <4.0.0'
Expand All @@ -19,7 +19,7 @@ dependencies:
flutter_svg: ^2.0.7
window_manager: ^0.3.7
recase: ^4.1.0
process_run: ^0.13.1
process_run: ^0.13.2
logger: ^2.0.2+1
get_it: ^7.6.4
file_selector: ^1.0.1
Expand All @@ -29,7 +29,7 @@ dependencies:
json_annotation: ^4.8.1
http: ^1.1.0
collection: ^1.17.0
package_info_plus: ^4.1.0
package_info_plus: ^4.2.0
yaml: ^3.1.2
url_launcher: ^6.1.14
encrypt: ^5.0.3
Expand All @@ -38,27 +38,27 @@ dependencies:
loader_overlay: ^2.3.2
dio: ^5.3.3
retry: ^3.1.2
connectivity_plus: ^5.0.0
connectivity_plus: ^5.0.1
internet_connection_checker: ^1.0.0+1
shared_preferences: ^2.2.2
dio_cache_interceptor: ^3.4.4
dio_cache_interceptor_hive_store: ^3.2.1
hive_flutter: ^1.1.0
pretty_dio_logger: ^1.3.1
fluttertoast: ^8.2.2
go_router: ^11.1.4
go_router: ^12.0.0
intl: ^0.18.1
intl_utils: ^2.8.4
intl_utils: ^2.8.5
dropdown_button2: ^2.3.9
searchfield: ^0.8.5
searchfield: ^0.8.6

dev_dependencies:
flutter_test:
sdk: flutter

flutter_lints: ^2.0.3
flutter_lints: ^3.0.0
build_runner: ^2.4.6
freezed: ^2.4.1
freezed: ^2.4.5
json_serializable: ^6.7.1

flutter:
Expand Down