From eccb3222230a935a5211ba472fcc776546851f0b Mon Sep 17 00:00:00 2001 From: Saifallak Date: Tue, 10 Nov 2020 00:32:12 +0200 Subject: [PATCH 1/3] fix nullOk deprecated --- lib/gradient_app_bar.dart | 2 +- pubspec.lock | 68 ++++++++++++++++++++++----------------- pubspec.yaml | 5 +-- 3 files changed, 42 insertions(+), 33 deletions(-) diff --git a/lib/gradient_app_bar.dart b/lib/gradient_app_bar.dart index bab5f08..d449585 100644 --- a/lib/gradient_app_bar.dart +++ b/lib/gradient_app_bar.dart @@ -404,7 +404,7 @@ class _GradientAppBarState extends State { assert(debugCheckHasMaterialLocalizations(context)); final ThemeData themeData = Theme.of(context); final AppBarTheme appBarTheme = AppBarTheme.of(context); - final ScaffoldState scaffold = Scaffold.of(context, nullOk: true); + final ScaffoldState scaffold = Scaffold.maybeOf(context); final ModalRoute parentRoute = ModalRoute.of(context); final bool hasDrawer = scaffold?.hasDrawer ?? false; diff --git a/pubspec.lock b/pubspec.lock index 7642229..2a6d844 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,28 +7,49 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.5.0-nullsafety.2" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.1.0-nullsafety.2" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.4" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.2.0-nullsafety.2" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.2" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.15.0-nullsafety.4" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.2" flutter: dependency: "direct main" description: flutter @@ -45,35 +66,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.5" + version: "0.12.10-nullsafety.2" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0-nullsafety.5" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" + version: "1.8.0-nullsafety.2" sky_engine: dependency: transitive description: flutter @@ -85,55 +92,56 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.8.0-nullsafety.3" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0-nullsafety.5" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0-nullsafety.2" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.1.0-nullsafety.2" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0-nullsafety.2" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.5" + version: "0.2.19-nullsafety.4" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0-nullsafety.4" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.1.0-nullsafety.4" sdks: - dart: ">=2.2.2 <3.0.0" + dart: ">=2.11.0-0.0 <2.12.0" + flutter: ">=1.23.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index c72c405..2be7b0e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: gradient_app_bar description: The official AppBar, with a more colorful twist. Add gradients to spice up your application and make it beautiful. This easy to use library makes it easy, and most of all, it is compatible with everything the normal AppBar is compatible with! -version: 0.1.3 +version: 0.1.4 author: Joost Lekkerkerker homepage: https://github.com/joostlek/GradientAppBar @@ -13,7 +13,8 @@ dev_dependencies: sdk: flutter environment: - sdk: '>=1.19.0 <3.0.0' + flutter: ">=1.23.0 <2.0.0" + sdk: ">=2.10.0 <3.0.0" # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec From 1fafc17bad94041e17ae2ab81d6257b4d9333d79 Mon Sep 17 00:00:00 2001 From: Saifallak Date: Tue, 10 Nov 2020 00:33:21 +0200 Subject: [PATCH 2/3] change log --- CHANGELOG.md | 4 +++ example/pubspec.lock | 67 ++++++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ef2fa0..a4f3405 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.1.4] - 10 Nov 2020 + + - Update nullOk Parameter for flutter 1.23 + ## [0.1.3] - 15 Juli 2019 - Remove obsolete import diff --git a/example/pubspec.lock b/example/pubspec.lock index 3ecb8d0..efceb5e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,28 +7,42 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.5.0-nullsafety.2" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.1.0-nullsafety.2" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.4" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.2.0-nullsafety.2" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.2" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.15.0-nullsafety.4" cupertino_icons: dependency: "direct main" description: @@ -36,6 +50,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.2" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.2" flutter: dependency: "direct main" description: flutter @@ -59,35 +80,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.5" + version: "0.12.10-nullsafety.2" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0-nullsafety.5" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" + version: "1.8.0-nullsafety.2" sky_engine: dependency: transitive description: flutter @@ -99,55 +106,55 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.8.0-nullsafety.3" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0-nullsafety.5" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0-nullsafety.2" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.1.0-nullsafety.2" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0-nullsafety.2" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.5" + version: "0.2.19-nullsafety.4" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0-nullsafety.4" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.1.0-nullsafety.4" sdks: - dart: ">=2.2.2 <3.0.0" + dart: ">=2.11.0-0.0 <2.12.0" From 37c4b1bea68eebaf29627cc696fcf8ed4701592e Mon Sep 17 00:00:00 2001 From: Saifallak Date: Thu, 4 Feb 2021 13:31:10 +0000 Subject: [PATCH 3/3] fix --- lib/gradient_app_bar.dart | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/gradient_app_bar.dart b/lib/gradient_app_bar.dart index d449585..c635b9b 100644 --- a/lib/gradient_app_bar.dart +++ b/lib/gradient_app_bar.dart @@ -427,8 +427,8 @@ class _GradientAppBarState extends State { if (widget.toolbarOpacity != 1.0) { final double opacity = - const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn) - .transform(widget.toolbarOpacity); + const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn) + .transform(widget.toolbarOpacity); if (centerStyle?.color != null) centerStyle = centerStyle.copyWith(color: centerStyle.color.withOpacity(opacity)); @@ -542,11 +542,11 @@ class _GradientAppBarState extends State { widget.bottomOpacity == 1.0 ? widget.bottom : Opacity( - opacity: - const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn) - .transform(widget.bottomOpacity), - child: widget.bottom, - ), + opacity: + const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn) + .transform(widget.bottomOpacity), + child: widget.bottom, + ), ], ); } @@ -587,7 +587,7 @@ class _GradientAppBarState extends State { child: Material( color: appBarTheme.color ?? themeData.primaryColor, elevation: - widget.elevation ?? appBarTheme.elevation ?? _defaultElevation, + widget.elevation ?? appBarTheme.elevation ?? _defaultElevation, shape: widget.shape, child: Container( decoration: BoxDecoration(gradient: widget.gradient), @@ -633,8 +633,8 @@ class _FloatingGradientAppBarState extends State<_FloatingGradientAppBar> { } RenderSliverFloatingPersistentHeader _headerRenderer() { - return context.ancestorRenderObjectOfType( - const TypeMatcher()); + return context + .findAncestorRenderObjectOfType(); } void _isScrollingListener() {