From 227a7990c67bdef5aaa9d6b5509e7c1f34c43130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=81=A5=E8=8E=B9?= Date: Sun, 5 Feb 2023 21:02:06 +0800 Subject: [PATCH] Bump flutter to 3.7.1 --- analysis_options.yaml | 4 + dart_dependency_validator.yaml | 2 + .../integration_test/window_manager_test.dart | 6 +- example/lib/main.dart | 10 +- example/lib/pages/home.dart | 242 +++++++++--------- example/lib/themes/dark_theme.dart | 6 +- example/lib/themes/light_theme.dart | 4 +- example/lib/themes/themes.dart | 2 +- example/lib/utilities/config.dart | 2 +- example/macos/Podfile | 2 +- example/macos/Podfile.lock | 4 +- .../macos/Runner.xcodeproj/project.pbxproj | 11 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- example/pubspec.lock | 157 ++++++++---- example/pubspec.yaml | 7 + example/test/widget_test.dart | 6 +- lib/src/utils/calc_window_position.dart | 4 +- lib/src/widgets/drag_to_resize_area.dart | 5 +- lib/src/widgets/virtual_window_frame.dart | 6 +- lib/src/widgets/window_caption.dart | 6 +- lib/src/widgets/window_caption_button.dart | 18 +- lib/src/window_manager.dart | 49 ++-- pubspec.lock | 208 ++++++++++++--- pubspec.yaml | 5 +- 24 files changed, 500 insertions(+), 268 deletions(-) create mode 100644 analysis_options.yaml create mode 100644 dart_dependency_validator.yaml diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/dart_dependency_validator.yaml b/dart_dependency_validator.yaml new file mode 100644 index 0000000..c69bdf1 --- /dev/null +++ b/dart_dependency_validator.yaml @@ -0,0 +1,2 @@ +exclude: + - "example/**" diff --git a/example/integration_test/window_manager_test.dart b/example/integration_test/window_manager_test.dart index 764fc5f..8277cd6 100644 --- a/example/integration_test/window_manager_test.dart +++ b/example/integration_test/window_manager_test.dart @@ -9,7 +9,7 @@ Future main() async { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); await windowManager.ensureInitialized(); await windowManager.waitUntilReadyToShow( - WindowOptions( + const WindowOptions( size: Size(640, 480), title: 'window_manager_test', ), @@ -21,7 +21,7 @@ Future main() async { testWidgets('getBounds', (tester) async { expect(await windowManager.getBounds(), - isA().having((r) => r.size, 'size', Size(640, 480))); + isA().having((r) => r.size, 'size', const Size(640, 480))); }); testWidgets('isAlwaysOnBottom', (tester) async { @@ -85,7 +85,7 @@ Future main() async { }); testWidgets('getSize', (tester) async { - expect(await windowManager.getSize(), Size(640, 480)); + expect(await windowManager.getSize(), const Size(640, 480)); }); testWidgets('isSkipTaskbar', (tester) async { diff --git a/example/lib/main.dart b/example/lib/main.dart index 0256ba5..23d677c 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -10,7 +10,7 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); await windowManager.ensureInitialized(); - WindowOptions windowOptions = WindowOptions( + WindowOptions windowOptions = const WindowOptions( size: Size(800, 600), center: true, backgroundColor: Colors.transparent, @@ -22,12 +22,14 @@ void main() async { await windowManager.focus(); }); - runApp(MyApp()); + runApp(const MyApp()); } class MyApp extends StatefulWidget { + const MyApp({Key? key}) : super(key: key); + @override - _MyAppState createState() => _MyAppState(); + State createState() => _MyAppState(); } class _MyAppState extends State { @@ -66,7 +68,7 @@ class _MyAppState extends State { return child; }, navigatorObservers: [BotToastNavigatorObserver()], - home: HomePage(), + home: const HomePage(), ); } } diff --git a/example/lib/pages/home.dart b/example/lib/pages/home.dart index 46da8a0..ca1bd97 100644 --- a/example/lib/pages/home.dart +++ b/example/lib/pages/home.dart @@ -1,8 +1,10 @@ +// ignore_for_file: avoid_print + import 'dart:io'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart' hide MenuItem; -import 'package:flutter/material.dart' hide MenuItem; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:preference_list/preference_list.dart'; import 'package:tray_manager/tray_manager.dart'; import 'package:window_manager/window_manager.dart'; @@ -26,8 +28,10 @@ const _kMaxSizes = [ ]; class HomePage extends StatefulWidget { + const HomePage({Key? key}) : super(key: key); + @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } const _kIconTypeDefault = 'default'; @@ -115,7 +119,7 @@ class _HomePageState extends State with TrayListener, WindowListener { PreferenceListSection( children: [ PreferenceListItem( - title: Text('ThemeMode'), + title: const Text('ThemeMode'), detailText: Text('${sharedConfig.themeMode}'), onTap: () async { ThemeMode newThemeMode = @@ -134,24 +138,24 @@ class _HomePageState extends State with TrayListener, WindowListener { ], ), PreferenceListSection( - title: Text('METHODS'), + title: const Text('METHODS'), children: [ PreferenceListItem( - title: Text('setAsFrameless'), + title: const Text('setAsFrameless'), onTap: () async { await windowManager.setAsFrameless(); }, ), PreferenceListItem( - title: Text('close'), + title: const Text('close'), onTap: () async { await windowManager.close(); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); await windowManager.show(); }, ), PreferenceListSwitchItem( - title: Text('isPreventClose / setPreventClose'), + title: const Text('isPreventClose / setPreventClose'), onTap: () async { _isPreventClose = await windowManager.isPreventClose(); BotToast.showText(text: 'isPreventClose: $_isPreventClose'); @@ -164,44 +168,44 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('focus / blur'), + title: const Text('focus / blur'), onTap: () async { await windowManager.blur(); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); print('isFocused: ${await windowManager.isFocused()}'); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); await windowManager.focus(); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); print('isFocused: ${await windowManager.isFocused()}'); }, ), PreferenceListItem( - title: Text('show / hide'), + title: const Text('show / hide'), onTap: () async { await windowManager.hide(); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); await windowManager.show(); await windowManager.focus(); }, ), PreferenceListItem( - title: Text('isVisible'), + title: const Text('isVisible'), onTap: () async { bool isVisible = await windowManager.isVisible(); BotToast.showText( text: 'isVisible: $isVisible', ); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); windowManager.hide(); isVisible = await windowManager.isVisible(); print('isVisible: $isVisible'); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); windowManager.show(); }, ), PreferenceListItem( - title: Text('isMaximized'), + title: const Text('isMaximized'), onTap: () async { bool isMaximized = await windowManager.isMaximized(); BotToast.showText( @@ -210,39 +214,39 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('maximize / unmaximize'), + title: const Text('maximize / unmaximize'), onTap: () async { windowManager.maximize(); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); windowManager.unmaximize(); }, ), PreferenceListItem( - title: Text('isMinimized'), + title: const Text('isMinimized'), onTap: () async { bool isMinimized = await windowManager.isMinimized(); BotToast.showText( text: 'isMinimized: $isMinimized', ); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); windowManager.minimize(); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); isMinimized = await windowManager.isMinimized(); print('isMinimized: $isMinimized'); windowManager.restore(); }, ), PreferenceListItem( - title: Text('minimize / restore'), + title: const Text('minimize / restore'), onTap: () async { windowManager.minimize(); - await Future.delayed(Duration(seconds: 2)); + await Future.delayed(const Duration(seconds: 2)); windowManager.restore(); }, ), PreferenceListSwitchItem( - title: Text('isFullScreen / setFullScreen'), + title: const Text('isFullScreen / setFullScreen'), onTap: () async { bool isFullScreen = await windowManager.isFullScreen(); BotToast.showText(text: 'isFullScreen: $isFullScreen'); @@ -255,29 +259,29 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('setAspectRatio'), + title: const Text('setAspectRatio'), accessoryView: Row( children: [ CupertinoButton( - child: Text('reset'), + child: const Text('reset'), onPressed: () async { windowManager.setAspectRatio(0); }, ), CupertinoButton( - child: Text('1:1'), + child: const Text('1:1'), onPressed: () async { windowManager.setAspectRatio(1); }, ), CupertinoButton( - child: Text('16:9'), + child: const Text('16:9'), onPressed: () async { windowManager.setAspectRatio(16 / 9); }, ), CupertinoButton( - child: Text('4:3'), + child: const Text('4:3'), onPressed: () async { windowManager.setAspectRatio(4 / 3); }, @@ -286,29 +290,29 @@ class _HomePageState extends State with TrayListener, WindowListener { ), ), PreferenceListItem( - title: Text('setBackgroundColor'), + title: const Text('setBackgroundColor'), accessoryView: Row( children: [ CupertinoButton( - child: Text('transparent'), + child: const Text('transparent'), onPressed: () async { windowManager.setBackgroundColor(Colors.transparent); }, ), CupertinoButton( - child: Text('red'), + child: const Text('red'), onPressed: () async { windowManager.setBackgroundColor(Colors.red); }, ), CupertinoButton( - child: Text('green'), + child: const Text('green'), onPressed: () async { windowManager.setBackgroundColor(Colors.green); }, ), CupertinoButton( - child: Text('blue'), + child: const Text('blue'), onPressed: () async { windowManager.setBackgroundColor(Colors.blue); }, @@ -317,12 +321,8 @@ class _HomePageState extends State with TrayListener, WindowListener { ), ), PreferenceListItem( - title: Text('setBounds / setBounds'), + title: const Text('setBounds / setBounds'), accessoryView: ToggleButtons( - children: [ - for (var size in _kSizes) - Text(' ${size.width.toInt()}x${size.height.toInt()} '), - ], onPressed: (int index) async { _size = _kSizes[index]; Offset newPosition = await calcWindowPosition( @@ -344,6 +344,10 @@ class _HomePageState extends State with TrayListener, WindowListener { setState(() {}); }, isSelected: _kSizes.map((e) => e == _size).toList(), + children: [ + for (var size in _kSizes) + Text(' ${size.width.toInt()}x${size.height.toInt()} '), + ], ), onTap: () async { Rect bounds = await windowManager.getBounds(); @@ -355,13 +359,13 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('setAlignment'), - accessoryView: Container( + title: const Text('setAlignment'), + accessoryView: SizedBox( width: 300, child: Wrap( children: [ CupertinoButton( - child: Text('topLeft'), + child: const Text('topLeft'), onPressed: () async { await windowManager.setAlignment( Alignment.topLeft, @@ -370,7 +374,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('topCenter'), + child: const Text('topCenter'), onPressed: () async { await windowManager.setAlignment( Alignment.topCenter, @@ -379,7 +383,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('topRight'), + child: const Text('topRight'), onPressed: () async { await windowManager.setAlignment( Alignment.topRight, @@ -388,7 +392,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('centerLeft'), + child: const Text('centerLeft'), onPressed: () async { await windowManager.setAlignment( Alignment.centerLeft, @@ -397,7 +401,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('center'), + child: const Text('center'), onPressed: () async { await windowManager.setAlignment( Alignment.center, @@ -406,7 +410,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('centerRight'), + child: const Text('centerRight'), onPressed: () async { await windowManager.setAlignment( Alignment.centerRight, @@ -415,7 +419,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('bottomLeft'), + child: const Text('bottomLeft'), onPressed: () async { await windowManager.setAlignment( Alignment.bottomLeft, @@ -424,7 +428,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('bottomCenter'), + child: const Text('bottomCenter'), onPressed: () async { await windowManager.setAlignment( Alignment.bottomCenter, @@ -433,7 +437,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('bottomRight'), + child: const Text('bottomRight'), onPressed: () async { await windowManager.setAlignment( Alignment.bottomRight, @@ -447,24 +451,24 @@ class _HomePageState extends State with TrayListener, WindowListener { onTap: () async {}, ), PreferenceListItem( - title: Text('center'), + title: const Text('center'), onTap: () async { await windowManager.center(); }, ), PreferenceListItem( - title: Text('getPosition / setPosition'), + title: const Text('getPosition / setPosition'), accessoryView: Row( children: [ CupertinoButton( - child: Text('xy>zero'), + child: const Text('xy>zero'), onPressed: () async { - windowManager.setPosition(Offset(0, 0)); + windowManager.setPosition(const Offset(0, 0)); setState(() {}); }, ), CupertinoButton( - child: Text('x+20'), + child: const Text('x+20'), onPressed: () async { Offset p = await windowManager.getPosition(); windowManager.setPosition(Offset(p.dx + 20, p.dy)); @@ -472,7 +476,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('x-20'), + child: const Text('x-20'), onPressed: () async { Offset p = await windowManager.getPosition(); windowManager.setPosition(Offset(p.dx - 20, p.dy)); @@ -480,7 +484,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('y+20'), + child: const Text('y+20'), onPressed: () async { Offset p = await windowManager.getPosition(); windowManager.setPosition(Offset(p.dx, p.dy + 20)); @@ -488,7 +492,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('y-20'), + child: const Text('y-20'), onPressed: () async { Offset p = await windowManager.getPosition(); windowManager.setPosition(Offset(p.dx, p.dy - 20)); @@ -500,14 +504,14 @@ class _HomePageState extends State with TrayListener, WindowListener { onTap: () async { Offset position = await windowManager.getPosition(); BotToast.showText( - text: '${position.toString()}', + text: position.toString(), ); }, ), PreferenceListItem( - title: Text('getSize / setSize'), + title: const Text('getSize / setSize'), accessoryView: CupertinoButton( - child: Text('Set'), + child: const Text('Set'), onPressed: () async { Size size = await windowManager.getSize(); windowManager.setSize( @@ -519,42 +523,42 @@ class _HomePageState extends State with TrayListener, WindowListener { onTap: () async { Size size = await windowManager.getSize(); BotToast.showText( - text: '${size.toString()}', + text: size.toString(), ); }, ), PreferenceListItem( - title: Text('getMinimumSize / setMinimumSize'), + title: const Text('getMinimumSize / setMinimumSize'), accessoryView: ToggleButtons( - children: [ - for (var size in _kMinSizes) - Text(' ${size.width.toInt()}x${size.height.toInt()} '), - ], onPressed: (int index) { _minSize = _kMinSizes[index]; windowManager.setMinimumSize(_minSize!); setState(() {}); }, isSelected: _kMinSizes.map((e) => e == _minSize).toList(), + children: [ + for (var size in _kMinSizes) + Text(' ${size.width.toInt()}x${size.height.toInt()} '), + ], ), ), PreferenceListItem( - title: Text('getMaximumSize / setMaximumSize'), + title: const Text('getMaximumSize / setMaximumSize'), accessoryView: ToggleButtons( - children: [ - for (var size in _kMaxSizes) - Text(' ${size.width.toInt()}x${size.height.toInt()} '), - ], onPressed: (int index) { _maxSize = _kMaxSizes[index]; windowManager.setMaximumSize(_maxSize!); setState(() {}); }, isSelected: _kMaxSizes.map((e) => e == _maxSize).toList(), + children: [ + for (var size in _kMaxSizes) + Text(' ${size.width.toInt()}x${size.height.toInt()} '), + ], ), ), PreferenceListSwitchItem( - title: Text('isResizable / setResizable'), + title: const Text('isResizable / setResizable'), onTap: () async { bool isResizable = await windowManager.isResizable(); BotToast.showText(text: 'isResizable: $isResizable'); @@ -567,7 +571,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListSwitchItem( - title: Text('isMovable / setMovable'), + title: const Text('isMovable / setMovable'), onTap: () async { bool isMovable = await windowManager.isMovable(); BotToast.showText(text: 'isMovable: $isMovable'); @@ -580,7 +584,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListSwitchItem( - title: Text('isMinimizable / setMinimizable'), + title: const Text('isMinimizable / setMinimizable'), onTap: () async { _isMinimizable = await windowManager.isMinimizable(); setState(() {}); @@ -595,7 +599,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListSwitchItem( - title: Text('isMaximizable / setMaximizable'), + title: const Text('isMaximizable / setMaximizable'), onTap: () async { _isMaximizable = await windowManager.isMaximizable(); setState(() {}); @@ -610,7 +614,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListSwitchItem( - title: Text('isClosable / setClosable'), + title: const Text('isClosable / setClosable'), onTap: () async { _isClosable = await windowManager.isClosable(); setState(() {}); @@ -625,7 +629,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListSwitchItem( - title: Text('isAlwaysOnTop / setAlwaysOnTop'), + title: const Text('isAlwaysOnTop / setAlwaysOnTop'), onTap: () async { bool isAlwaysOnTop = await windowManager.isAlwaysOnTop(); BotToast.showText(text: 'isAlwaysOnTop: $isAlwaysOnTop'); @@ -638,7 +642,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListSwitchItem( - title: Text('isAlwaysOnBottom / setAlwaysOnBottom'), + title: const Text('isAlwaysOnBottom / setAlwaysOnBottom'), onTap: () async { bool isAlwaysOnBottom = await windowManager.isAlwaysOnBottom(); BotToast.showText(text: 'isAlwaysOnBottom: $isAlwaysOnBottom'); @@ -651,11 +655,11 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('getTitle / setTitle'), + title: const Text('getTitle / setTitle'), onTap: () async { String title = await windowManager.getTitle(); BotToast.showText( - text: '${title.toString()}', + text: title.toString(), ); title = 'window_manager_example - ${DateTime.now().millisecondsSinceEpoch}'; @@ -663,11 +667,11 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('setTitleBarStyle'), + title: const Text('setTitleBarStyle'), accessoryView: Row( children: [ CupertinoButton( - child: Text('normal'), + child: const Text('normal'), onPressed: () async { windowManager.setTitleBarStyle( TitleBarStyle.normal, @@ -677,7 +681,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('hidden'), + child: const Text('hidden'), onPressed: () async { windowManager.setTitleBarStyle( TitleBarStyle.hidden, @@ -691,7 +695,7 @@ class _HomePageState extends State with TrayListener, WindowListener { onTap: () {}, ), PreferenceListItem( - title: Text('getTitleBarHeight'), + title: const Text('getTitleBarHeight'), onTap: () async { int titleBarHeight = await windowManager.getTitleBarHeight(); BotToast.showText( @@ -700,7 +704,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('isSkipTaskbar'), + title: const Text('isSkipTaskbar'), onTap: () async { bool isSkipping = await windowManager.isSkipTaskbar(); BotToast.showText( @@ -709,18 +713,18 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('setSkipTaskbar'), + title: const Text('setSkipTaskbar'), onTap: () async { setState(() { _isSkipTaskbar = !_isSkipTaskbar; }); await windowManager.setSkipTaskbar(_isSkipTaskbar); - await Future.delayed(Duration(seconds: 3)); + await Future.delayed(const Duration(seconds: 3)); windowManager.show(); }, ), PreferenceListItem( - title: Text('setProgressBar'), + title: const Text('setProgressBar'), onTap: () async { for (var i = 0; i <= 100; i++) { setState(() { @@ -728,22 +732,22 @@ class _HomePageState extends State with TrayListener, WindowListener { }); print(_progress); await windowManager.setProgressBar(_progress); - await Future.delayed(Duration(milliseconds: 100)); + await Future.delayed(const Duration(milliseconds: 100)); } - await Future.delayed(Duration(milliseconds: 1000)); + await Future.delayed(const Duration(milliseconds: 1000)); await windowManager.setProgressBar(-1); }, ), PreferenceListItem( - title: Text('setIcon'), + title: const Text('setIcon'), accessoryView: Row( children: [ CupertinoButton( - child: Text('Default'), + child: const Text('Default'), onPressed: () => _handleSetIcon(_kIconTypeDefault), ), CupertinoButton( - child: Text('Original'), + child: const Text('Original'), onPressed: () => _handleSetIcon(_kIconTypeOriginal), ), ], @@ -751,7 +755,7 @@ class _HomePageState extends State with TrayListener, WindowListener { onTap: () => _handleSetIcon(_kIconTypeDefault), ), PreferenceListSwitchItem( - title: Text('hasShadow / setHasShadow'), + title: const Text('hasShadow / setHasShadow'), onTap: () async { bool hasShadow = await windowManager.hasShadow(); BotToast.showText( @@ -766,7 +770,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('getOpacity / setOpacity'), + title: const Text('getOpacity / setOpacity'), onTap: () async { double opacity = await windowManager.getOpacity(); BotToast.showText( @@ -776,7 +780,7 @@ class _HomePageState extends State with TrayListener, WindowListener { accessoryView: Row( children: [ CupertinoButton( - child: Text('1'), + child: const Text('1'), onPressed: () async { _opacity = 1; windowManager.setOpacity(_opacity); @@ -784,7 +788,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('0.8'), + child: const Text('0.8'), onPressed: () async { _opacity = 0.8; windowManager.setOpacity(_opacity); @@ -792,7 +796,7 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), CupertinoButton( - child: Text('0.6'), + child: const Text('0.6'), onPressed: () async { _opacity = 0.5; windowManager.setOpacity(_opacity); @@ -803,7 +807,7 @@ class _HomePageState extends State with TrayListener, WindowListener { ), ), PreferenceListSwitchItem( - title: Text('setIgnoreMouseEvents'), + title: const Text('setIgnoreMouseEvents'), value: _isIgnoreMouseEvents, onChanged: (newValue) async { _isIgnoreMouseEvents = newValue; @@ -815,19 +819,19 @@ class _HomePageState extends State with TrayListener, WindowListener { }, ), PreferenceListItem( - title: Text('popUpWindowMenu'), + title: const Text('popUpWindowMenu'), onTap: () async { await windowManager.popUpWindowMenu(); }, ), PreferenceListItem( - title: Text('grabKeyboard'), + title: const Text('grabKeyboard'), onTap: () async { await windowManager.grabKeyboard(); }, ), PreferenceListItem( - title: Text('ungrabKeyboard'), + title: const Text('ungrabKeyboard'), onTap: () async { await windowManager.ungrabKeyboard(); }, @@ -842,8 +846,8 @@ class _HomePageState extends State with TrayListener, WindowListener { return Stack( children: [ Container( - margin: EdgeInsets.all(0), - decoration: BoxDecoration( + margin: const EdgeInsets.all(0), + decoration: const BoxDecoration( color: Colors.white, // border: Border.all(color: Colors.grey.withOpacity(0.4), width: 1), // boxShadow: [ @@ -856,11 +860,11 @@ class _HomePageState extends State with TrayListener, WindowListener { ), child: Scaffold( appBar: PreferredSize( + preferredSize: const Size.fromHeight(kWindowCaptionHeight), child: WindowCaption( brightness: Theme.of(context).brightness, - title: Text('window_manager_example'), + title: const Text('window_manager_example'), ), - preferredSize: const Size.fromHeight(kWindowCaptionHeight), ), body: Column( children: [ @@ -878,11 +882,11 @@ class _HomePageState extends State with TrayListener, WindowListener { } }, child: Container( - margin: EdgeInsets.all(0), + margin: const EdgeInsets.all(0), width: double.infinity, height: 54, color: Colors.grey.withOpacity(0.3), - child: Center( + child: const Center( child: Text('DragToMoveArea'), ), ), @@ -890,15 +894,17 @@ class _HomePageState extends State with TrayListener, WindowListener { if (Platform.isLinux || Platform.isWindows) Container( height: 100, - margin: EdgeInsets.all(20), + margin: const EdgeInsets.all(20), child: DragToResizeArea( + resizeEdgeSize: 6, + resizeEdgeColor: Colors.red.withOpacity(0.2), child: Container( width: double.infinity, height: double.infinity, color: Colors.grey.withOpacity(0.3), child: Center( child: GestureDetector( - child: Text('DragToResizeArea'), + child: const Text('DragToResizeArea'), onTap: () { BotToast.showText( text: 'DragToResizeArea example'); @@ -906,8 +912,6 @@ class _HomePageState extends State with TrayListener, WindowListener { ), ), ), - resizeEdgeSize: 6, - resizeEdgeColor: Colors.red.withOpacity(0.2), ), ), Expanded( @@ -974,16 +978,16 @@ class _HomePageState extends State with TrayListener, WindowListener { context: context, builder: (_) { return AlertDialog( - title: Text('Are you sure you want to close this window?'), + title: const Text('Are you sure you want to close this window?'), actions: [ TextButton( - child: Text('No'), + child: const Text('No'), onPressed: () { Navigator.of(context).pop(); }, ), TextButton( - child: Text('Yes'), + child: const Text('Yes'), onPressed: () { Navigator.of(context).pop(); windowManager.destroy(); diff --git a/example/lib/themes/dark_theme.dart b/example/lib/themes/dark_theme.dart index 27f8f12..aea58e3 100644 --- a/example/lib/themes/dark_theme.dart +++ b/example/lib/themes/dark_theme.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; var darkThemeData = ThemeData( brightness: Brightness.dark, - primaryColor: Color(0xff416ff4), - canvasColor: Color(0xff282828), - scaffoldBackgroundColor: Color(0xff1d1d1d), + primaryColor: const Color(0xff416ff4), + canvasColor: const Color(0xff282828), + scaffoldBackgroundColor: const Color(0xff1d1d1d), ); diff --git a/example/lib/themes/light_theme.dart b/example/lib/themes/light_theme.dart index 6c9a9bf..151668a 100644 --- a/example/lib/themes/light_theme.dart +++ b/example/lib/themes/light_theme.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; var lightThemeData = ThemeData( brightness: Brightness.light, - primaryColor: Color(0xff416ff4), + primaryColor: const Color(0xff416ff4), canvasColor: Colors.white, - scaffoldBackgroundColor: Color(0xffF7F9FB), + scaffoldBackgroundColor: const Color(0xffF7F9FB), dividerColor: Colors.grey.withOpacity(0.3), ); diff --git a/example/lib/themes/themes.dart b/example/lib/themes/themes.dart index a6b5115..76dea94 100644 --- a/example/lib/themes/themes.dart +++ b/example/lib/themes/themes.dart @@ -1,3 +1,3 @@ // 请按文件名排序放置 export 'dark_theme.dart'; -export 'light_theme.dart'; \ No newline at end of file +export 'light_theme.dart'; diff --git a/example/lib/utilities/config.dart b/example/lib/utilities/config.dart index a29d03b..b701421 100644 --- a/example/lib/utilities/config.dart +++ b/example/lib/utilities/config.dart @@ -8,7 +8,7 @@ class _ListenerEntry extends LinkedListEntry<_ListenerEntry> { } class _ConfigChangeNotifier implements Listenable { - LinkedList<_ListenerEntry> _listeners = LinkedList<_ListenerEntry>(); + final LinkedList<_ListenerEntry> _listeners = LinkedList<_ListenerEntry>(); @protected bool get hasListeners { diff --git a/example/macos/Podfile b/example/macos/Podfile index dade8df..049abe2 100644 --- a/example/macos/Podfile +++ b/example/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index 55701d8..853b7ed 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -24,11 +24,11 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos SPEC CHECKSUMS: - FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811 + FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38 tray_manager: 9064e219c56d75c476e46b9a21182087930baf90 window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8 -PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c +PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 COCOAPODS: 1.11.3 diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj index 45ac3a6..59ed555 100644 --- a/example/macos/Runner.xcodeproj/project.pbxproj +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -203,7 +203,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -256,6 +256,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -404,7 +405,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -483,7 +484,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -530,7 +531,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 56f0be8..3bf4d1d 100644 --- a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ =2.17.0-0 <3.0.0" - flutter: ">=1.20.0" + dart: ">=2.18.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index b294e9c..fa40d0a 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -34,6 +34,13 @@ dev_dependencies: integration_test: sdk: flutter + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index c6a768e..f9494cc 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -13,13 +13,13 @@ import 'package:window_manager_example/main.dart'; void main() { testWidgets('Verify Platform version', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); + await tester.pumpWidget(const MyApp()); // Verify that platform version is retrieved. expect( find.byWidgetPredicate( - (Widget widget) => widget is Text && - widget.data!.startsWith('Running on:'), + (Widget widget) => + widget is Text && widget.data!.startsWith('Running on:'), ), findsOneWidget, ); diff --git a/lib/src/utils/calc_window_position.dart b/lib/src/utils/calc_window_position.dart index 2b62db1..4773956 100644 --- a/lib/src/utils/calc_window_position.dart +++ b/lib/src/utils/calc_window_position.dart @@ -20,10 +20,10 @@ Future calcWindowPosition( visibleStartX = primaryDisplay.visiblePosition!.dx; visibleStartY = primaryDisplay.visiblePosition!.dy; } - Offset position = Offset(0, 0); + Offset position = const Offset(0, 0); if (alignment == Alignment.topLeft) { - position = Offset(0, 0); + position = const Offset(0, 0); } else if (alignment == Alignment.topCenter) { position = Offset( visibleStartX + (visibleWidth / 2) - (windowSize.width / 2), diff --git a/lib/src/widgets/drag_to_resize_area.dart b/lib/src/widgets/drag_to_resize_area.dart index 73a8e59..066f202 100644 --- a/lib/src/widgets/drag_to_resize_area.dart +++ b/lib/src/widgets/drag_to_resize_area.dart @@ -47,12 +47,13 @@ class DragToResizeArea extends StatelessWidget { double? width, double? height, }) { - if (enableResizeEdges != null && !enableResizeEdges!.contains(resizeEdge)) + if (enableResizeEdges != null && !enableResizeEdges!.contains(resizeEdge)) { return Container(); + } return Container( width: width, height: height, - color: this.resizeEdgeColor, + color: resizeEdgeColor, child: MouseRegion( cursor: cursor, child: GestureDetector( diff --git a/lib/src/widgets/virtual_window_frame.dart b/lib/src/widgets/virtual_window_frame.dart index fde2bae..eef3d9c 100644 --- a/lib/src/widgets/virtual_window_frame.dart +++ b/lib/src/widgets/virtual_window_frame.dart @@ -80,15 +80,14 @@ class _VirtualWindowFrameState extends State Widget build(BuildContext context) { if (_kIsLinux) { return DragToResizeArea( - child: _buildVirtualWindowFrame(context), resizeEdgeMargin: (_isMaximized || _isFullScreen) ? EdgeInsets.zero : EdgeInsets.all(kVirtualWindowFrameMargin * 0.6), enableResizeEdges: (_isMaximized || _isFullScreen) ? [] : null, + child: _buildVirtualWindowFrame(context), ); } else if (_kIsWindows) { return DragToResizeArea( - child: widget.child, enableResizeEdges: (_isMaximized || _isFullScreen) ? [] : [ @@ -96,6 +95,7 @@ class _VirtualWindowFrameState extends State ResizeEdge.top, ResizeEdge.topRight, ], + child: widget.child, ); } @@ -130,12 +130,14 @@ class _VirtualWindowFrameState extends State }); } + @override void onWindowEnterFullScreen() { setState(() { _isFullScreen = true; }); } + @override void onWindowLeaveFullScreen() { setState(() { _isFullScreen = false; diff --git a/lib/src/widgets/window_caption.dart b/lib/src/widgets/window_caption.dart index 9b80c55..cfedb97 100644 --- a/lib/src/widgets/window_caption.dart +++ b/lib/src/widgets/window_caption.dart @@ -58,19 +58,19 @@ class _WindowCaptionState extends State with WindowListener { decoration: BoxDecoration( color: widget.backgroundColor ?? (widget.brightness == Brightness.dark - ? Color(0xff1C1C1C) + ? const Color(0xff1C1C1C) : Colors.transparent), ), child: Row( children: [ Expanded( child: DragToMoveArea( - child: Container( + child: SizedBox( height: double.infinity, child: Row( children: [ Container( - padding: EdgeInsets.only(left: 16), + padding: const EdgeInsets.only(left: 16), child: DefaultTextStyle( style: TextStyle( color: widget.brightness == Brightness.light diff --git a/lib/src/widgets/window_caption_button.dart b/lib/src/widgets/window_caption_button.dart index da7ee00..28ca76b 100644 --- a/lib/src/widgets/window_caption_button.dart +++ b/lib/src/widgets/window_caption_button.dart @@ -1,3 +1,5 @@ +// ignore_for_file: library_private_types_in_public_api + import 'package:flutter/material.dart'; class WindowCaptionButtonIcon extends StatelessWidget { @@ -67,7 +69,7 @@ class WindowCaptionButton extends StatefulWidget { this.brightness, this.icon, this.onPressed, - }) : this.iconName = 'images/ic_chrome_minimize.png', + }) : iconName = 'images/ic_chrome_minimize.png', super(key: key); WindowCaptionButton.maximize({ @@ -75,7 +77,7 @@ class WindowCaptionButton extends StatefulWidget { this.brightness, this.icon, this.onPressed, - }) : this.iconName = 'images/ic_chrome_maximize.png', + }) : iconName = 'images/ic_chrome_maximize.png', super(key: key); WindowCaptionButton.unmaximize({ @@ -83,7 +85,7 @@ class WindowCaptionButton extends StatefulWidget { this.brightness, this.icon, this.onPressed, - }) : this.iconName = 'images/ic_chrome_unmaximize.png', + }) : iconName = 'images/ic_chrome_unmaximize.png', super(key: key); WindowCaptionButton.close({ @@ -91,11 +93,11 @@ class WindowCaptionButton extends StatefulWidget { this.brightness, this.icon, this.onPressed, - }) : this.iconName = 'images/ic_chrome_close.png', + }) : iconName = 'images/ic_chrome_close.png', _lightButtonBgColorScheme = _ButtonBgColorScheme( normal: Colors.transparent, - hovered: Color(0xffC42B1C), - pressed: Color(0xffC42B1C).withOpacity(0.9), + hovered: const Color(0xffC42B1C), + pressed: const Color(0xffC42B1C).withOpacity(0.9), ), _lightButtonIconColorScheme = _ButtonIconColorScheme( normal: Colors.black.withOpacity(0.8956), @@ -105,8 +107,8 @@ class WindowCaptionButton extends StatefulWidget { ), _darkButtonBgColorScheme = _ButtonBgColorScheme( normal: Colors.transparent, - hovered: Color(0xffC42B1C), - pressed: Color(0xffC42B1C).withOpacity(0.9), + hovered: const Color(0xffC42B1C), + pressed: const Color(0xffC42B1C).withOpacity(0.9), ), _darkButtonIconColorScheme = _ButtonIconColorScheme( normal: Colors.white, diff --git a/lib/src/window_manager.dart b/lib/src/window_manager.dart index d20349b..71dc042 100644 --- a/lib/src/window_manager.dart +++ b/lib/src/window_manager.dart @@ -38,13 +38,12 @@ class WindowManager { final MethodChannel _channel = const MethodChannel('window_manager'); - ObserverList? _listeners = ObserverList(); + final ObserverList _listeners = + ObserverList(); Future _methodCallHandler(MethodCall call) async { - if (_listeners == null) return; - for (final WindowListener listener in listeners) { - if (!_listeners!.contains(listener)) { + if (!_listeners.contains(listener)) { return; } @@ -73,20 +72,20 @@ class WindowManager { List get listeners { final List localListeners = - List.from(_listeners!); + List.from(_listeners); return localListeners; } bool get hasListeners { - return _listeners!.isNotEmpty; + return _listeners.isNotEmpty; } void addListener(WindowListener listener) { - _listeners!.add(listener); + _listeners.add(listener); } void removeListener(WindowListener listener) { - _listeners!.remove(listener); + _listeners.remove(listener); } Future ensureInitialized() async { @@ -104,30 +103,32 @@ class WindowManager { ]) async { await _channel.invokeMethod('waitUntilReadyToShow'); - bool _isFullScreen = await isFullScreen(); - bool _isMaximized = await isMaximized(); - bool _isMinimized = await isMinimized(); - - if (_isFullScreen) await setFullScreen(false); - if (_isMaximized) await unmaximize(); - if (_isMinimized) await restore(); + if (await isFullScreen()) await setFullScreen(false); + if (await isMaximized()) await unmaximize(); + if (await isMinimized()) await restore(); if (options?.size != null) await setSize(options!.size!); if (options?.center == true) await setAlignment(Alignment.center); - if (options?.minimumSize != null) + if (options?.minimumSize != null) { await setMinimumSize(options!.minimumSize!); - if (options?.maximumSize != null) + } + if (options?.maximumSize != null) { await setMaximumSize(options!.maximumSize!); - if (options?.alwaysOnTop != null) + } + if (options?.alwaysOnTop != null) { await setAlwaysOnTop(options!.alwaysOnTop!); + } if (options?.fullScreen != null) await setFullScreen(options!.fullScreen!); - if (options?.backgroundColor != null) + if (options?.backgroundColor != null) { await setBackgroundColor(options!.backgroundColor!); - if (options?.skipTaskbar != null) + } + if (options?.skipTaskbar != null) { await setSkipTaskbar(options!.skipTaskbar!); + } if (options?.title != null) await setTitle(options!.title!); - if (options?.titleBarStyle != null) + if (options?.titleBarStyle != null) { await setTitleBarStyle(options!.titleBarStyle!); + } if (callback != null) { callback(); @@ -181,7 +182,7 @@ class WindowManager { Future show({bool inactive = false}) async { bool isMinimized = await this.isMinimized(); if (isMinimized) { - await this.restore(); + await restore(); } final Map arguments = { 'inactive': inactive, @@ -271,7 +272,7 @@ class WindowManager { }) async { Size windowSize = await getSize(); Offset position = await calcWindowPosition(windowSize, alignment); - await this.setPosition(position, animate: animate); + await setPosition(position, animate: animate); } /// Moves window to the center of the screen. @@ -280,7 +281,7 @@ class WindowManager { }) async { Size windowSize = await getSize(); Offset position = await calcWindowPosition(windowSize, Alignment.center); - await this.setPosition(position, animate: animate); + await setPosition(position, animate: animate); } /// Returns `Rect` - The bounds of the window as Object. diff --git a/pubspec.lock b/pubspec.lock index ce3f24b..abbfd7e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,91 +1,222 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + args: + dependency: transitive + description: + name: args + sha256: "139d809800a412ebb26a3892da228b2d0ba36f0ef5d9a82166e5e52ec8d61611" + url: "https://pub.dev" + source: hosted + version: "2.3.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.10.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted version: "1.2.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" + url: "https://pub.dev" + source: hosted + version: "2.0.2" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" + source: hosted + version: "1.17.0" + dependency_validator: + dependency: "direct dev" + description: + name: dependency_validator + sha256: "08349175533ed0bd06eb9b6043cde66c45b2bfc7ebc222a7542cdb1324f1bf03" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "3.2.2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" + source: hosted + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + lints: + dependency: transitive + description: + name: lints + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + logging: + dependency: transitive + description: + name: logging + sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + url: "https://pub.dev" + source: hosted + version: "1.1.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted version: "1.8.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" path: dependency: "direct main" description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted version: "1.8.2" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" + url: "https://pub.dev" + source: hosted + version: "1.2.1" screen_retriever: dependency: "direct main" description: name: screen_retriever - url: "https://pub.dartlang.org" + sha256: "9c3839c4eb80807cd8210afa3c84a177ba00aef9f9b7b74ad92d3a0ab1d7e7ed" + url: "https://pub.dev" source: hosted version: "0.1.5" sky_engine: @@ -97,51 +228,66 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.4.16" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + yaml: + dependency: transitive + description: + name: yaml + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.1.1" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=1.20.0" + dart: ">=2.18.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index c662459..f4b66b6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ platforms: environment: sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" + flutter: ">=2.5.0" dependencies: flutter: @@ -22,6 +22,9 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^2.0.0 + + dependency_validator: ^3.0.0 flutter: plugin: