diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bb6864..f62c929 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 1.2.0-dev +## 1.2.0 ### BREAKING @@ -70,6 +70,8 @@ * Init Translations ### CHANGED +* Remove null checks from WidgetsBinding (Flutter 3.0.0) +* Changed launch to launchUrl for url_launcher package * Changed default value of `horizontalTitleGap` to 8 * Switch to `titlebar_buttons` package as `window_decorations` is deprecated * Link to external examples in example.md diff --git a/example/lib/home_page.dart b/example/lib/home_page.dart index 1394922..e1e5344 100644 --- a/example/lib/home_page.dart +++ b/example/lib/home_page.dart @@ -132,8 +132,9 @@ class _MyHomePageState extends State { .map( (e) => AdwActionRow( title: e.key, - onActivated: () => - launch('https://github.com/${e.value}'), + onActivated: () => launchUrl( + Uri.parse('https://github.com/${e.value}'), + ), ), ) .toList(), diff --git a/example/pubspec.lock b/example/pubspec.lock index 1b2e4b2..b36accb 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -14,7 +14,7 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.1" async: dependency: transitive description: @@ -90,35 +90,35 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" dbus: dependency: transitive description: name: dbus url: "https://pub.dartlang.org" source: hosted - version: "0.7.1" + version: "0.7.3" desktop_multi_window: dependency: "direct main" description: name: desktop_multi_window url: "https://pub.dartlang.org" source: hosted - version: "0.0.1" + version: "0.0.2" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.2.1" file: dependency: transitive description: @@ -182,7 +182,7 @@ packages: path: ".." relative: true source: path - version: "1.2.0-dev" + version: "1.2.0" libadwaita_bitsdojo: dependency: "direct main" description: @@ -210,7 +210,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -224,14 +224,14 @@ packages: name: package_info_plus url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.4.2" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.5" package_info_plus_macos: dependency: transitive description: @@ -252,14 +252,14 @@ packages: name: package_info_plus_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" path: dependency: transitive description: @@ -287,7 +287,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "5.0.0" platform: dependency: transitive description: @@ -301,7 +301,7 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.2" popover_gtk: dependency: transitive description: @@ -327,7 +327,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -369,70 +369,70 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" url_launcher: dependency: transitive description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.18" + version: "6.1.2" url_launcher_android: dependency: transitive description: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.14" + version: "6.0.17" url_launcher_ios: dependency: transitive description: name: url_launcher_ios url: "https://pub.dartlang.org" source: hosted - version: "6.0.14" + version: "6.0.16" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "3.0.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "3.0.1" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.11" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.1" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" very_good_analysis: dependency: "direct dev" description: @@ -446,21 +446,21 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.3" + version: "2.5.2" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.2.0+1" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "5.4.1" sdks: - dart: ">=2.16.0-100.0.dev <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.17.0-0 <3.0.0" + flutter: ">=2.10.0" diff --git a/lib/src/internal/window_resize_listener.dart b/lib/src/internal/window_resize_listener.dart index 8cc6ab4..aec5a3c 100644 --- a/lib/src/internal/window_resize_listener.dart +++ b/lib/src/internal/window_resize_listener.dart @@ -20,8 +20,8 @@ class _WindowResizeListenerState extends State @override void initState() { - _lastSize = WidgetsBinding.instance!.window.physicalSize; - WidgetsBinding.instance!.addObserver(this); + _lastSize = WidgetsBinding.instance.window.physicalSize; + WidgetsBinding.instance.addObserver(this); widget.onResize(_lastSize); @@ -30,13 +30,13 @@ class _WindowResizeListenerState extends State @override void dispose() { - WidgetsBinding.instance!.removeObserver(this); + WidgetsBinding.instance.removeObserver(this); super.dispose(); } @override void didChangeMetrics() { - final winSize = WidgetsBinding.instance!.window.physicalSize; + final winSize = WidgetsBinding.instance.window.physicalSize; if (winSize != _lastSize) { widget.onResize(winSize); diff --git a/lib/src/widgets/adw/about_window.dart b/lib/src/widgets/adw/about_window.dart index 32e5918..28721c6 100644 --- a/lib/src/widgets/adw/about_window.dart +++ b/lib/src/widgets/adw/about_window.dart @@ -156,8 +156,8 @@ class _AdwAboutWindowState extends State { if (widget.issueTrackerLink != null) AdwActionRow( title: 'Report an issue', - onActivated: () => launch( - widget.issueTrackerLink!, + onActivated: () => launchUrl( + Uri.parse(widget.issueTrackerLink!), ), end: widget.launchEndIcon ?? const Icon( diff --git a/lib/src/widgets/adw/flap.dart b/lib/src/widgets/adw/flap.dart index 2fce6d4..635ffd8 100644 --- a/lib/src/widgets/adw/flap.dart +++ b/lib/src/widgets/adw/flap.dart @@ -5,6 +5,7 @@ import 'package:libadwaita/src/internal/window_resize_listener.dart'; import 'package:libadwaita/src/utils/colors.dart'; enum FoldPolicy { never, always, auto } + enum FlapPosition { start, end } class FlapOptions { @@ -153,7 +154,7 @@ class _AdwFlapState extends State { return WindowResizeListener( onResize: (Size size) => - WidgetsBinding.instance!.addPostFrameCallback((_) { + WidgetsBinding.instance.addPostFrameCallback((_) { // The stuff that happens when the window is resized // We check for the mobile state and update it on every resize // Do nothin if FoldPolicy is never / always, because they are not diff --git a/lib/src/widgets/adw/header_bar.dart b/lib/src/widgets/adw/header_bar.dart index 36b84f9..1fdc543 100644 --- a/lib/src/widgets/adw/header_bar.dart +++ b/lib/src/widgets/adw/header_bar.dart @@ -134,7 +134,7 @@ class _AdwHeaderBarState extends State { final schema = GSettings('org.gnome.desktop.wm.preferences'); - WidgetsBinding.instance?.addPostFrameCallback((_) async { + WidgetsBinding.instance.addPostFrameCallback((_) async { final buttonLayout = await schema.get('button-layout') as DBusString?; if (buttonLayout != null) { updateSep(buttonLayout.value); diff --git a/lib/src/widgets/gtk/stack_sidebar.dart b/lib/src/widgets/gtk/stack_sidebar.dart index 7ba5487..21e2208 100644 --- a/lib/src/widgets/gtk/stack_sidebar.dart +++ b/lib/src/widgets/gtk/stack_sidebar.dart @@ -56,7 +56,7 @@ class _GtkStackSidebarState extends State { Future loadContentPage(BuildContext context) async { if (_popupNotOpen) { _popupNotOpen = false; - SchedulerBinding.instance!.addPostFrameCallback((_) async { + SchedulerBinding.instance.addPostFrameCallback((_) async { final child = Scaffold( body: widget.fullContentBuilder != null ? widget.fullContentBuilder!( @@ -87,7 +87,7 @@ class _GtkStackSidebarState extends State { /// closes popup wind void _closePopup() { if (!_popupNotOpen) { - SchedulerBinding.instance! + SchedulerBinding.instance .addPostFrameCallback((_) => Navigator.pop(context)); } } diff --git a/lib/src/widgets/gtk/toggle_button.dart b/lib/src/widgets/gtk/toggle_button.dart index 1b35ce6..d5519e4 100644 --- a/lib/src/widgets/gtk/toggle_button.dart +++ b/lib/src/widgets/gtk/toggle_button.dart @@ -12,8 +12,11 @@ class GtkToggleButton extends StatelessWidget { required this.isSelected, }) : super(key: key); + /// The List of all the children widgets of this toggle button final List children; + final void Function(int index) onPressed; + final List isSelected; @override diff --git a/pubspec.yaml b/pubspec.yaml index 6ecec8d..c785be3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: libadwaita description: Libadwaita's widgets for Flutter. Following Gnome HIG and available on all platforms. -version: 1.2.0-dev +version: 1.2.0 homepage: https://github.com/gtk-flutter/libadwaita environment: @@ -16,15 +16,15 @@ platforms: windows: dependencies: - dbus: ">=0.7.1 <1.0.0" + dbus: ">=0.7.3 <1.0.0" flutter: sdk: flutter flutter_svg: ">=1.0.3 < 2.0.0" gsettings: ">=0.2.5 <1.0.0" libadwaita_core: ">=0.5.1 < 2.0.0" - package_info_plus: ">=1.3.0 < 2.0.0" + package_info_plus: ">=1.4.2 < 2.0.0" popover_gtk: ">=0.2.6+3 < 1.0.0" - url_launcher: ">=6.0.18 < 7.0.0" + url_launcher: ">=6.1.2 < 7.0.0" dev_dependencies: very_good_analysis: ^2.4.0