Skip to content

Commit

Permalink
Merge pull request #43 from alsterverse/fix/dart-ui
Browse files Browse the repository at this point in the history
Fix/dart UI
  • Loading branch information
PhiFry authored Sep 2, 2024
2 parents 36dfd05 + 69f1577 commit b205298
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions code_generator/lib/src/fields/option_field.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions code_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ dependencies:
dev_dependencies:
lints: ^4.0.0
test: ^1.25.0

dependency_overrides:
flutter_storyblok:
path: ../
2 changes: 1 addition & 1 deletion example/lib/bloks.generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
3 changes: 2 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/utils/blocks_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> on Link<T> {
void open(BuildContext context) async {
Expand Down
4 changes: 0 additions & 4 deletions example/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

#include "generated_plugin_registrant.h"

#include <url_launcher_linux/url_launcher_plugin.h>

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);
}
1 change: 0 additions & 1 deletion example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_linux
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
19 changes: 10 additions & 9 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions example/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

#include "generated_plugin_registrant.h"

#include <share_plus/share_plus_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
2 changes: 0 additions & 2 deletions example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
share_plus
url_launcher_windows
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
3 changes: 3 additions & 0 deletions lib/client.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
library;

export 'src/storyblok_client.dart';
2 changes: 0 additions & 2 deletions lib/flutter_storyblok.dart → lib/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 1 addition & 1 deletion lib/src/fields/link.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/src/storyblok_client.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit b205298

Please sign in to comment.