diff --git a/CHANGELOG.md b/CHANGELOG.md index 02f609c..bafc9fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.1.0 + +Separated StoryblokClient to its own client.dart export file and all the model +exports into models.dart to fix dart:ui being imported when using the code +generator. + # 1.0.4 Added remaining properties on Story. diff --git a/code_generator/lib/src/fields/option_field.dart b/code_generator/lib/src/fields/option_field.dart index 5f54dcb..6a2649e 100644 --- a/code_generator/lib/src/fields/option_field.dart +++ b/code_generator/lib/src/fields/option_field.dart @@ -1,5 +1,5 @@ import 'package:code_builder/code_builder.dart'; -import 'package:flutter_storyblok/flutter_storyblok.dart'; +import 'package:flutter_storyblok/models.dart'; import 'base_field.dart'; import '../utils/code_builder_extensions.dart'; @@ -34,7 +34,7 @@ base class OptionField extends BaseField { OptionSource.self => referType(enumName), OptionSource.internal_stories => referType( "$StoryIdentifierUUID", - importUrl: 'package:flutter_storyblok/flutter_storyblok.dart', + importUrl: 'package:flutter_storyblok/models.dart', nullable: !isRequired, ), OptionSource.internal_languages => referType("$String", nullable: !isRequired), // TODO Language enum diff --git a/code_generator/pubspec.yaml b/code_generator/pubspec.yaml index a51e208..fdcb701 100644 --- a/code_generator/pubspec.yaml +++ b/code_generator/pubspec.yaml @@ -37,3 +37,7 @@ dependencies: dev_dependencies: lints: ^4.0.0 test: ^1.25.0 + +dependency_overrides: + flutter_storyblok: + path: ../ diff --git a/example/lib/bloks.generated.dart b/example/lib/bloks.generated.dart index 57e2190..33a7464 100644 --- a/example/lib/bloks.generated.dart +++ b/example/lib/bloks.generated.dart @@ -5,7 +5,7 @@ library bloks; // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:flutter_storyblok/fields.dart' as _i1; -import 'package:flutter_storyblok/flutter_storyblok.dart' as _i2; +import 'package:flutter_storyblok/models.dart' as _i2; enum ButtonStyleOption { default$('default'), diff --git a/example/lib/main.dart b/example/lib/main.dart index 0575ac5..e298a78 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -5,7 +5,8 @@ import 'package:example/bloks.generated.dart' as bloks; import 'package:example/colors.dart'; import 'package:example/splash_screen.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_storyblok/flutter_storyblok.dart' as sb; +import 'package:flutter_storyblok/models.dart' as sb; +import 'package:flutter_storyblok/client.dart' as sb; import 'package:go_router/go_router.dart'; import 'package:flutter_web_plugins/url_strategy.dart'; diff --git a/example/lib/utils/blocks_extensions.dart b/example/lib/utils/blocks_extensions.dart index 7163ea3..da6c082 100644 --- a/example/lib/utils/blocks_extensions.dart +++ b/example/lib/utils/blocks_extensions.dart @@ -5,7 +5,7 @@ import 'package:example/main.dart'; import 'package:example/snackbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_storyblok/fields.dart'; -import 'package:flutter_storyblok/flutter_storyblok.dart'; +import 'package:flutter_storyblok/models.dart'; extension LinkOpen on Link { void open(BuildContext context) async { diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc index f6f23bf..e71a16d 100644 --- a/example/linux/flutter/generated_plugin_registrant.cc +++ b/example/linux/flutter/generated_plugin_registrant.cc @@ -6,10 +6,6 @@ #include "generated_plugin_registrant.h" -#include void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); - url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index f16b4c3..2e1de87 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 516426f..c2fe62a 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -10,23 +10,24 @@ environment: dependencies: flutter: sdk: flutter - go_router: ^13.1.0 - camera: ^0.10.5+4 - sensors_plus: ^4.0.2 - share_plus: ^7.1.0 + flutter_storyblok: + path: ../ + go_router: ^14.2.7 video_player: ^2.7.2 wave: ^0.2.2 - multiselect: ^0.1.0 - google_fonts: ^6.1.0 - flutter_svg: ^2.0.10+1 - cached_network_image: ^3.3.1 + flutter_svg: ^2.0.10 + cached_network_image: ^3.4.1 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.0 flutter_storyblok_code_generator: path: ../code_generator + flutter_lints: ^2.0.0 + +dependency_overrides: + flutter_storyblok: + path: ../ flutter: uses-material-design: true diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index c3384ec..8b6d468 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -6,12 +6,6 @@ #include "generated_plugin_registrant.h" -#include -#include void RegisterPlugins(flutter::PluginRegistry* registry) { - SharePlusWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 01d3836..b93c4c3 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -3,8 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - share_plus - url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/lib/client.dart b/lib/client.dart new file mode 100644 index 0000000..a1a3a41 --- /dev/null +++ b/lib/client.dart @@ -0,0 +1,3 @@ +library; + +export 'src/storyblok_client.dart'; diff --git a/lib/flutter_storyblok.dart b/lib/models.dart similarity index 88% rename from lib/flutter_storyblok.dart rename to lib/models.dart index 02e5be1..5c82c97 100644 --- a/lib/flutter_storyblok.dart +++ b/lib/models.dart @@ -7,5 +7,3 @@ export 'src/models/pagination.dart'; export 'src/models/resolve_links.dart'; export 'src/models/story_identifier.dart'; export 'src/models/story.dart'; - -export 'src/storyblok_client.dart'; diff --git a/lib/src/fields/link.dart b/lib/src/fields/link.dart index 78eb617..956c166 100644 --- a/lib/src/fields/link.dart +++ b/lib/src/fields/link.dart @@ -10,7 +10,7 @@ /// If both are specified Link is used. library; -import 'package:flutter_storyblok/flutter_storyblok.dart'; +import 'package:flutter_storyblok/models.dart'; import 'package:flutter_storyblok/src/utils.dart'; /// StoryContent is used to pass the Content type to LinkStory diff --git a/lib/src/storyblok_client.dart b/lib/src/storyblok_client.dart index 4dbf39e..42b85fc 100644 --- a/lib/src/storyblok_client.dart +++ b/lib/src/storyblok_client.dart @@ -1,5 +1,5 @@ import 'dart:convert'; -import 'package:flutter_storyblok/flutter_storyblok.dart'; +import 'package:flutter_storyblok/models.dart'; import 'package:flutter_storyblok/src/fields/tag.dart'; import 'package:flutter_storyblok/src/utils.dart'; import 'package:http/http.dart' as http; diff --git a/pubspec.yaml b/pubspec.yaml index c53b450..b2ba111 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_storyblok description: Integrate Storyblok with your Flutter app using this SDK and code generator. -version: 1.0.4 +version: 1.1.0 homepage: https://www.alster.se/ repository: https://github.com/alsterverse/flutter_storyblok issue_tracker: https://github.com/alsterverse/flutter_storyblok/issues @@ -14,9 +14,9 @@ environment: dependencies: flutter: sdk: flutter - http: ^1.2.1 + http: ^1.2.2 collection: ^1.18.0 dev_dependencies: lints: ^4.0.0 - build_runner: ^2.4.9 + build_runner: ^2.4.12