diff --git a/CHANGELOG.md b/CHANGELOG.md index d227a26..53c37bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [0.3.0] - May 2023 + + - Update Dart 3.10.1 [#1](https://github.com/GUIKAR741/NewGradientAppBar/pull/1) + - Update using dart fix + - ## [0.2.0] - April 2021 - Update Dart 2.12.0 [#1](https://github.com/GUIKAR741/NewGradientAppBar/pull/1) diff --git a/example/pubspec.lock b/example/pubspec.lock deleted file mode 100644 index 2a949b8..0000000 --- a/example/pubspec.lock +++ /dev/null @@ -1,160 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - 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" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - new_gradient_app_bar: - dependency: "direct main" - description: - path: ".." - relative: true - source: path - version: "0.2.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.19" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" -sdks: - dart: ">=2.12.0 <3.0.0" diff --git a/lib/new_gradient_app_bar.dart b/lib/new_gradient_app_bar.dart index c6b3e4c..26f324a 100644 --- a/lib/new_gradient_app_bar.dart +++ b/lib/new_gradient_app_bar.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; const double _kLeadingWidth = kToolbarHeight; // So the leading button is square. @@ -418,12 +417,12 @@ class _NewGradientAppBarState extends State { IconThemeData actionsIconTheme = widget.actionsIconTheme ?? appBarTheme.actionsIconTheme ?? overallIconTheme; - TextStyle centerStyle = (widget.textTheme?.headline6 ?? - appBarTheme.textTheme?.headline6 ?? - themeData.primaryTextTheme.headline6)!; - TextStyle? sideStyle = widget.textTheme?.bodyText2 ?? - appBarTheme.textTheme?.bodyText2 ?? - themeData.primaryTextTheme.bodyText2; + TextStyle centerStyle = (widget.textTheme?.titleLarge ?? + appBarTheme.titleTextStyle ?? + themeData.primaryTextTheme.titleLarge)!; + TextStyle? sideStyle = widget.textTheme?.bodyMedium ?? + appBarTheme.toolbarTextStyle ?? + themeData.primaryTextTheme.bodyMedium; if (widget.toolbarOpacity != 1.0) { final double opacity = @@ -577,8 +576,8 @@ class _NewGradientAppBarState extends State { ); } final Brightness brightness = widget.brightness ?? - appBarTheme.brightness ?? - themeData.primaryColorBrightness; + appBarTheme.systemOverlayStyle?.statusBarBrightness ?? + themeData.brightness; final SystemUiOverlayStyle overlayStyle = brightness == Brightness.dark ? SystemUiOverlayStyle.light : SystemUiOverlayStyle.dark; @@ -588,7 +587,7 @@ class _NewGradientAppBarState extends State { child: AnnotatedRegion( value: overlayStyle, child: Material( - color: appBarTheme.color ?? themeData.primaryColor, + color: appBarTheme.backgroundColor ?? themeData.primaryColor, elevation: widget.elevation ?? appBarTheme.elevation ?? _defaultElevation, shape: widget.shape, @@ -623,7 +622,7 @@ class _FloatingGradientAppBarState extends State<_FloatingGradientAppBar> { super.didChangeDependencies(); if (_position != null) _position!.isScrollingNotifier.removeListener(_isScrollingListener); - _position = Scrollable.of(context)?.position; + _position = Scrollable.of(context).position; if (_position != null) _position!.isScrollingNotifier.addListener(_isScrollingListener); } @@ -679,7 +678,7 @@ class _SliverGradientAppBarDelegate extends SliverPersistentHeaderDelegate { required this.pinned, required this.snapConfiguration, required this.shape, - }) : assert(primary || topPadding == 0.0), + }) : assert(primary || topPadding == 0.0), _bottomHeight = bottom.preferredSize.height; final Widget leading; diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 49a0ce6..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,146 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.19" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" -sdks: - dart: ">=2.12.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 108cbda..2244c0c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: new_gradient_app_bar description: The official AppBar, with a more colorful twist. Add gradients to spice up your application and make it beautiful. -version: 0.2.0 +version: 0.3.0 homepage: https://github.com/GUIKAR741/NewGradientAppBar dependencies: