From 0fd414ce64f30d443cb12a8c23e6fca129039d6f Mon Sep 17 00:00:00 2001 From: Adil Hanney Date: Tue, 14 May 2024 18:37:00 +0100 Subject: [PATCH] ref: lint fixes for new flutter --- lib/components/canvas/canvas_image.dart | 7 +++---- lib/components/canvas/canvas_image_dialog.dart | 2 +- .../canvas/hud/canvas_gesture_lock_btn.dart | 4 ++-- .../canvas/hud/canvas_zoom_indicator.dart | 4 ++-- lib/components/home/preview_card.dart | 2 +- lib/components/theming/dynamic_material_app.dart | 8 ++++---- lib/components/toolbar/size_picker.dart | 2 +- lib/components/toolbar/toolbar.dart | 13 +++++-------- lib/pages/home/browse.dart | 2 +- lib/pages/home/recent_notes.dart | 2 +- lib/pages/home/settings.dart | 2 +- 11 files changed, 22 insertions(+), 26 deletions(-) diff --git a/lib/components/canvas/canvas_image.dart b/lib/components/canvas/canvas_image.dart index 39fc2a90f4..d8667df622 100644 --- a/lib/components/canvas/canvas_image.dart +++ b/lib/components/canvas/canvas_image.dart @@ -184,8 +184,7 @@ class _CanvasImageState extends State { child: DecoratedBox( decoration: BoxDecoration( border: Border.all( - color: - active ? colorScheme.onBackground : Colors.transparent, + color: active ? colorScheme.onSurface : Colors.transparent, width: 2, ), ), @@ -429,10 +428,10 @@ class _CanvasImageResizeHandle extends StatelessWidget { width: 40, height: 40, decoration: BoxDecoration( - color: colorScheme.onBackground, + color: colorScheme.onSurface, shape: BoxShape.circle, border: Border.all( - color: colorScheme.background, + color: colorScheme.surface, width: 2, ), ), diff --git a/lib/components/canvas/canvas_image_dialog.dart b/lib/components/canvas/canvas_image_dialog.dart index fee57e2197..720881af63 100644 --- a/lib/components/canvas/canvas_image_dialog.dart +++ b/lib/components/canvas/canvas_image_dialog.dart @@ -54,7 +54,7 @@ class _CanvasImageDialogState extends State { child: Switch.adaptive( value: widget.image.invertible, onChanged: Prefs.editorAutoInvert.value ? setInvertible : null, - thumbIcon: MaterialStateProperty.all(widget.image.invertible + thumbIcon: WidgetStateProperty.all(widget.image.invertible ? const Icon(Icons.invert_colors) : const Icon(Icons.invert_colors_off)), ), diff --git a/lib/components/canvas/hud/canvas_gesture_lock_btn.dart b/lib/components/canvas/hud/canvas_gesture_lock_btn.dart index 6aa9130005..d3d2369244 100644 --- a/lib/components/canvas/hud/canvas_gesture_lock_btn.dart +++ b/lib/components/canvas/hud/canvas_gesture_lock_btn.dart @@ -26,7 +26,7 @@ class CanvasGestureLockBtn extends StatelessWidget { onTap: () => setLock(!lock), child: Container( decoration: BoxDecoration( - color: colorScheme.background.withOpacity(0.5), + color: colorScheme.surface.withOpacity(0.5), borderRadius: BorderRadius.circular(15), ), padding: const EdgeInsets.all(5), @@ -37,7 +37,7 @@ class CanvasGestureLockBtn extends StatelessWidget { duration: const Duration(milliseconds: 200), child: Icon( icon, - color: colorScheme.onBackground, + color: colorScheme.onSurface, ), ), ), diff --git a/lib/components/canvas/hud/canvas_zoom_indicator.dart b/lib/components/canvas/hud/canvas_zoom_indicator.dart index 8cefb2289f..1e6151035c 100644 --- a/lib/components/canvas/hud/canvas_zoom_indicator.dart +++ b/lib/components/canvas/hud/canvas_zoom_indicator.dart @@ -17,13 +17,13 @@ class CanvasZoomIndicator extends StatelessWidget { onTap: resetZoom, child: Container( decoration: BoxDecoration( - color: colorScheme.background.withOpacity(0.5), + color: colorScheme.surface.withOpacity(0.5), borderRadius: BorderRadius.circular(15), ), padding: const EdgeInsets.all(5), child: Text( '${scale.toStringAsFixed(1)}x', - style: TextStyle(color: colorScheme.onBackground), + style: TextStyle(color: colorScheme.onSurface), ), ), ); diff --git a/lib/components/home/preview_card.dart b/lib/components/home/preview_card.dart index f773ecf5d9..04efe0bb45 100644 --- a/lib/components/home/preview_card.dart +++ b/lib/components/home/preview_card.dart @@ -186,7 +186,7 @@ class _PreviewCardState extends State { RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), closedElevation: expanded ? 4 : 1, closedBuilder: (context, action) => card, - openColor: colorScheme.background, + openColor: colorScheme.surface, openBuilder: (context, action) => Editor(path: widget.filePath), transitionDuration: transitionDuration, routeSettings: RouteSettings( diff --git a/lib/components/theming/dynamic_material_app.dart b/lib/components/theming/dynamic_material_app.dart index f7931a7200..5a2fff0429 100644 --- a/lib/components/theming/dynamic_material_app.dart +++ b/lib/components/theming/dynamic_material_app.dart @@ -195,7 +195,7 @@ class _DynamicMaterialAppState extends State useMaterial3: true, colorScheme: lightColorScheme, textTheme: getTextTheme(Brightness.light), - scaffoldBackgroundColor: lightColorScheme.background, + scaffoldBackgroundColor: lightColorScheme.surface, platform: platform, ), darkTheme: yaruTheme?.darkTheme ?? @@ -203,7 +203,7 @@ class _DynamicMaterialAppState extends State useMaterial3: true, colorScheme: darkColorScheme, textTheme: getTextTheme(Brightness.dark), - scaffoldBackgroundColor: darkColorScheme.background, + scaffoldBackgroundColor: darkColorScheme.surface, platform: platform, ), highContrastTheme: yaruHighContrastTheme?.theme ?? @@ -212,7 +212,7 @@ class _DynamicMaterialAppState extends State colorScheme: highContrastLightColorScheme, textTheme: getTextTheme(Brightness.light), scaffoldBackgroundColor: - highContrastLightColorScheme.background, + highContrastLightColorScheme.surface, platform: platform, ), highContrastDarkTheme: yaruHighContrastTheme?.darkTheme ?? @@ -221,7 +221,7 @@ class _DynamicMaterialAppState extends State colorScheme: highContrastDarkColorScheme, textTheme: getTextTheme(Brightness.dark), scaffoldBackgroundColor: - highContrastDarkColorScheme.background, + highContrastDarkColorScheme.surface, platform: platform, ), debugShowCheckedModeBanner: false, diff --git a/lib/components/toolbar/size_picker.dart b/lib/components/toolbar/size_picker.dart index b14889397e..b294fea46a 100644 --- a/lib/components/toolbar/size_picker.dart +++ b/lib/components/toolbar/size_picker.dart @@ -121,7 +121,7 @@ class _SizeSlider extends StatelessWidget { minSize: pen.sizeMin, maxSize: pen.sizeMax, currentSize: pen.options.size, - trackColor: colorScheme.onBackground.withOpacity(0.2), + trackColor: colorScheme.onSurface.withOpacity(0.2), thumbColor: colorScheme.primary, ), ), diff --git a/lib/components/toolbar/toolbar.dart b/lib/components/toolbar/toolbar.dart index a2bed53e0d..132cd3aaac 100644 --- a/lib/components/toolbar/toolbar.dart +++ b/lib/components/toolbar/toolbar.dart @@ -268,18 +268,15 @@ class _ToolbarState extends State { final iconTheme = QuillIconTheme( iconButtonUnselectedData: IconButtonData( style: baseButtonStyle.copyWith( - backgroundColor: - MaterialStateProperty.all(Colors.transparent), - foregroundColor: - MaterialStateProperty.all(colorScheme.primary), + backgroundColor: WidgetStateProperty.all(Colors.transparent), + foregroundColor: WidgetStateProperty.all(colorScheme.primary), ), ), iconButtonSelectedData: IconButtonData( style: baseButtonStyle.copyWith( - backgroundColor: - MaterialStateProperty.all(colorScheme.primary), + backgroundColor: WidgetStateProperty.all(colorScheme.primary), foregroundColor: - MaterialStateProperty.all(colorScheme.onPrimary), + WidgetStateProperty.all(colorScheme.onPrimary), ), ), ); @@ -545,7 +542,7 @@ class _ToolbarState extends State { ]; return Material( - color: colorScheme.background, + color: colorScheme.surface, child: isToolbarVertical ? Row( textDirection: diff --git a/lib/pages/home/browse.dart b/lib/pages/home/browse.dart index 1626eefd9e..5507f4a804 100644 --- a/lib/pages/home/browse.dart +++ b/lib/pages/home/browse.dart @@ -129,7 +129,7 @@ class _BrowsePageState extends State { flexibleSpace: FlexibleSpaceBar( title: Text( title, - style: TextStyle(color: colorScheme.onBackground), + style: TextStyle(color: colorScheme.onSurface), ), centerTitle: cupertino, titlePadding: EdgeInsetsDirectional.only( diff --git a/lib/pages/home/recent_notes.dart b/lib/pages/home/recent_notes.dart index ca271a7891..479f224521 100644 --- a/lib/pages/home/recent_notes.dart +++ b/lib/pages/home/recent_notes.dart @@ -130,7 +130,7 @@ class _RecentPageState extends State { flexibleSpace: FlexibleSpaceBar( title: Text( t.home.titles.home, - style: TextStyle(color: colorScheme.onBackground), + style: TextStyle(color: colorScheme.onSurface), ), centerTitle: cupertino, titlePadding: EdgeInsetsDirectional.only( diff --git a/lib/pages/home/settings.dart b/lib/pages/home/settings.dart index 484127da8b..a8002a7491 100644 --- a/lib/pages/home/settings.dart +++ b/lib/pages/home/settings.dart @@ -162,7 +162,7 @@ class _SettingsPageState extends State { flexibleSpace: FlexibleSpaceBar( title: Text( t.home.titles.settings, - style: TextStyle(color: colorScheme.onBackground), + style: TextStyle(color: colorScheme.onSurface), ), centerTitle: cupertino, titlePadding: EdgeInsetsDirectional.only(