From 7d03ca15defc788c6057e97148f97efdf4a817d4 Mon Sep 17 00:00:00 2001 From: Jeff Peiffer Date: Tue, 20 Feb 2024 19:54:50 -0500 Subject: [PATCH] Flutter 3.19 --- json_dynamic_widget/CHANGELOG.md | 35 ++----------------- json_dynamic_widget/bin/migrate_7.dart | 2 +- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- json_dynamic_widget/example/ios/Podfile | 2 +- json_dynamic_widget/example/ios/Podfile.lock | 16 +++++++++ .../ios/Runner.xcodeproj/project.pbxproj | 9 ++--- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../example/lib/src/launcher.dart | 6 ++-- .../lib/json_dynamic_widget.dart | 1 + .../json_animated_container_builder.dart | 28 +++++++++++++++ .../src/builders/json_container_builder.dart | 11 ++++++ .../src/builders/json_rich_text_builder.dart | 2 -- .../src/builders/json_semantics_builder.dart | 2 -- .../lib/src/widgets/json_widget_exporter.dart | 2 +- json_dynamic_widget/pubspec.yaml | 26 +++++++------- 15 files changed, 86 insertions(+), 60 deletions(-) create mode 100644 json_dynamic_widget/example/ios/Podfile.lock diff --git a/json_dynamic_widget/CHANGELOG.md b/json_dynamic_widget/CHANGELOG.md index 7aa4b8e4..6abb0a75 100644 --- a/json_dynamic_widget/CHANGELOG.md +++ b/json_dynamic_widget/CHANGELOG.md @@ -1,6 +1,7 @@ -## [7.0.6+6] - February 20, 2024 +## [7.1.0] - February 20, 2024 -* Automated dependency updates +* Updated for Flutter 3.19 +* Fixed `decoration` and `foregroundDecoration` on `animated_container` and `container`. ## [7.0.6+5] - January 16, 2024 @@ -739,33 +740,3 @@ This is a huge release with several breaking changes. It brings in the ability ## [0.9.9] - July 18th, 2020 * Initial release - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/json_dynamic_widget/bin/migrate_7.dart b/json_dynamic_widget/bin/migrate_7.dart index e6468a94..74c25a73 100644 --- a/json_dynamic_widget/bin/migrate_7.dart +++ b/json_dynamic_widget/bin/migrate_7.dart @@ -60,7 +60,7 @@ Attempting to migrate the files found in: output.writeAsStringSync(content); if (isYaml) { file.writeAsStringSync( - YAMLWriter( + YamlWriter( allowUnquotedStrings: true, indentSize: 2, ).convert(data), diff --git a/json_dynamic_widget/example/ios/Flutter/AppFrameworkInfo.plist b/json_dynamic_widget/example/ios/Flutter/AppFrameworkInfo.plist index 4f8d4d24..8c6e5614 100644 --- a/json_dynamic_widget/example/ios/Flutter/AppFrameworkInfo.plist +++ b/json_dynamic_widget/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/json_dynamic_widget/example/ios/Podfile b/json_dynamic_widget/example/ios/Podfile index 88359b22..279576f3 100644 --- a/json_dynamic_widget/example/ios/Podfile +++ b/json_dynamic_widget/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '11.0' +# platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/json_dynamic_widget/example/ios/Podfile.lock b/json_dynamic_widget/example/ios/Podfile.lock new file mode 100644 index 00000000..bf124bde --- /dev/null +++ b/json_dynamic_widget/example/ios/Podfile.lock @@ -0,0 +1,16 @@ +PODS: + - Flutter (1.0.0) + +DEPENDENCIES: + - Flutter (from `Flutter`) + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + +SPEC CHECKSUMS: + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + +PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011 + +COCOAPODS: 1.15.0 diff --git a/json_dynamic_widget/example/ios/Runner.xcodeproj/project.pbxproj b/json_dynamic_widget/example/ios/Runner.xcodeproj/project.pbxproj index 30505167..b483b9f4 100644 --- a/json_dynamic_widget/example/ios/Runner.xcodeproj/project.pbxproj +++ b/json_dynamic_widget/example/ios/Runner.xcodeproj/project.pbxproj @@ -163,7 +163,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -212,6 +212,7 @@ files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -332,7 +333,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -417,7 +418,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -466,7 +467,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/json_dynamic_widget/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/json_dynamic_widget/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 3db53b6e..e67b2808 100644 --- a/json_dynamic_widget/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/json_dynamic_widget/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ { String pageId, String extension, ) async { + final nav = Navigator.of(context); final registry = JsonWidgetRegistry.instance.copyWith(); final pageStr = await rootBundle.loadString( 'assets/pages/$pageId$extension', @@ -344,7 +345,7 @@ class _RootPageState extends State { ); if (mounted) { - await Navigator.of(context).push( + await nav.push( MaterialPageRoute( builder: (BuildContext context) => FullWidgetPage( data: data, @@ -365,6 +366,7 @@ class _RootPageState extends State { String themeId, ) async { final registry = JsonWidgetRegistry.instance.copyWith(); + final nav = Navigator.of(context); final pageStr = await rootBundle.loadString('assets/pages/$themeId.json'); final dataJson = json.decode(pageStr); @@ -379,7 +381,7 @@ class _RootPageState extends State { ); if (mounted) { - await Navigator.of(context).push( + await nav.push( MaterialPageRoute( builder: (BuildContext context) => UntestableFullWidgetPage( data: data, diff --git a/json_dynamic_widget/lib/json_dynamic_widget.dart b/json_dynamic_widget/lib/json_dynamic_widget.dart index 47e11b89..e064a55f 100644 --- a/json_dynamic_widget/lib/json_dynamic_widget.dart +++ b/json_dynamic_widget/lib/json_dynamic_widget.dart @@ -1,6 +1,7 @@ export 'package:child_builder/child_builder.dart'; export 'package:dynamic_widget_annotation/dynamic_widget_annotation.dart'; export 'package:flutter/material.dart'; +export 'package:flutter/rendering.dart'; export 'package:flutter/services.dart'; export 'package:json_class/json_class.dart'; export 'package:json_theme/json_theme.dart'; diff --git a/json_dynamic_widget/lib/src/builders/json_animated_container_builder.dart b/json_dynamic_widget/lib/src/builders/json_animated_container_builder.dart index da0b7567..ff79c015 100644 --- a/json_dynamic_widget/lib/src/builders/json_animated_container_builder.dart +++ b/json_dynamic_widget/lib/src/builders/json_animated_container_builder.dart @@ -9,6 +9,34 @@ abstract class _JsonAnimatedContainerBuilder extends JsonWidgetBuilder { const _JsonAnimatedContainerBuilder({ required super.args, }); + @JsonArgSchema('decoration') + static Map _decorationSchema() => BoxDecorationSchema.schema; + + @JsonArgSchema('foregroundDecoration') + static Map _foregroundDecorationSchema() => + BoxDecorationSchema.schema; + + @JsonArgEncoder('decoration') + static Map? _encodeDecoration(dynamic value) => + value is BoxDecoration ? ThemeEncoder.encodeBoxDecoration(value) : null; + + @JsonArgEncoder('foregroundDecoration') + static Map? _encodeForegroundDecoration(dynamic value) => + value is BoxDecoration ? ThemeEncoder.encodeBoxDecoration(value) : null; + + @JsonArgDecoder('decoration') + Decoration? _decodeDecoration({required dynamic value}) => + ThemeDecoder.decodeBoxDecoration( + value, + validate: false, + ); + + @JsonArgDecoder('foregroundDecoration') + Decoration? _decodeForegroundDecoration({required dynamic value}) => + ThemeDecoder.decodeBoxDecoration( + value, + validate: false, + ); @override AnimatedContainer buildCustom({ diff --git a/json_dynamic_widget/lib/src/builders/json_container_builder.dart b/json_dynamic_widget/lib/src/builders/json_container_builder.dart index 94b4219f..a32c8580 100644 --- a/json_dynamic_widget/lib/src/builders/json_container_builder.dart +++ b/json_dynamic_widget/lib/src/builders/json_container_builder.dart @@ -9,10 +9,21 @@ abstract class _JsonContainerBuilder extends JsonWidgetBuilder { required super.args, }); + @JsonArgSchema('decoration') + static Map _decorationSchema() => BoxDecorationSchema.schema; + + @JsonArgSchema('foregroundDecoration') + static Map _foregroundDecorationSchema() => + BoxDecorationSchema.schema; + @JsonArgEncoder('decoration') static Map? _encodeDecoration(dynamic value) => value is BoxDecoration ? ThemeEncoder.encodeBoxDecoration(value) : null; + @JsonArgEncoder('foregroundDecoration') + static Map? _encodeForegroundDecoration(dynamic value) => + value is BoxDecoration ? ThemeEncoder.encodeBoxDecoration(value) : null; + @JsonArgDecoder('decoration') Decoration? _decodeDecoration({required dynamic value}) => ThemeDecoder.decodeBoxDecoration( diff --git a/json_dynamic_widget/lib/src/builders/json_rich_text_builder.dart b/json_dynamic_widget/lib/src/builders/json_rich_text_builder.dart index 723e006b..5c8cc867 100644 --- a/json_dynamic_widget/lib/src/builders/json_rich_text_builder.dart +++ b/json_dynamic_widget/lib/src/builders/json_rich_text_builder.dart @@ -1,5 +1,3 @@ -// ignore: unused_import -import 'package:flutter/rendering.dart'; import 'package:json_dynamic_widget/json_dynamic_widget.dart'; part 'json_rich_text_builder.g.dart'; diff --git a/json_dynamic_widget/lib/src/builders/json_semantics_builder.dart b/json_dynamic_widget/lib/src/builders/json_semantics_builder.dart index c56aff42..9b16a577 100644 --- a/json_dynamic_widget/lib/src/builders/json_semantics_builder.dart +++ b/json_dynamic_widget/lib/src/builders/json_semantics_builder.dart @@ -1,5 +1,3 @@ -// ignore: unused_import -import 'package:flutter/rendering.dart'; import 'package:json_dynamic_widget/json_dynamic_widget.dart'; part 'json_semantics_builder.g.dart'; diff --git a/json_dynamic_widget/lib/src/widgets/json_widget_exporter.dart b/json_dynamic_widget/lib/src/widgets/json_widget_exporter.dart index 46707595..13821831 100644 --- a/json_dynamic_widget/lib/src/widgets/json_widget_exporter.dart +++ b/json_dynamic_widget/lib/src/widgets/json_widget_exporter.dart @@ -97,7 +97,7 @@ class JsonWidgetExporterData extends State { break; case ReverseEncodingMode.yaml: - final lines = YAMLWriter( + final lines = YamlWriter( allowUnquotedStrings: true, indentSize: max(indent.length, 2), ) diff --git a/json_dynamic_widget/pubspec.yaml b/json_dynamic_widget/pubspec.yaml index 7a1ac667..0028d594 100644 --- a/json_dynamic_widget/pubspec.yaml +++ b/json_dynamic_widget/pubspec.yaml @@ -1,47 +1,47 @@ name: 'json_dynamic_widget' description: 'A library to dynamically generate widgets within Flutter from JSON or other Map-like structures.' repository: 'https://github.com/peiffer-innovations/json_dynamic_widget/tree/main/json_dynamic_widget' -version: '7.0.6+6' +version: '7.1.0' -environment: +environment: sdk: '>=3.0.0 <4.0.0' -analyzer: - exclude: +analyzer: + exclude: - 'lib/generated/**' -dependencies: +dependencies: child_builder: '^2.0.2' collection: '^1.17.1' dynamic_widget_annotation: '^1.1.2+2' execution_timer: '^1.1.0+5' - flutter: + flutter: sdk: 'flutter' form_validation: '^3.1.1+4' interpolation: '^2.1.2' json_class: '^3.0.0+12' json_conditional: '^3.0.1+6' json_schema: '^5.1.3' - json_theme: '^6.4.0' + json_theme: '^6.4.1' logging: '^1.2.0' meta: '^1.9.1' - template_expressions: '^3.1.5+5' + template_expressions: '^3.1.6' uuid: '^4.1.0' yaml_writer: '^2.0.0' yaon: '^1.1.4+4' -dev_dependencies: +dev_dependencies: build_runner: '^2.4.8' flutter_lints: '^3.0.1' - flutter_test: + flutter_test: sdk: 'flutter' json_dynamic_widget_codegen: '^1.0.5+2' -dependency_overrides: - json_dynamic_widget_codegen: +dependency_overrides: + json_dynamic_widget_codegen: path: '../codegen' -ignore_updates: +ignore_updates: - 'archive' - 'async' - 'boolean_selector'