Skip to content

Commit

Permalink
ref: lint fixes for new flutter
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed May 14, 2024
1 parent e867ae0 commit 0fd414c
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 26 deletions.
7 changes: 3 additions & 4 deletions lib/components/canvas/canvas_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ class _CanvasImageState extends State<CanvasImage> {
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(
color:
active ? colorScheme.onBackground : Colors.transparent,
color: active ? colorScheme.onSurface : Colors.transparent,
width: 2,
),
),
Expand Down Expand Up @@ -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,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/components/canvas/canvas_image_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _CanvasImageDialogState extends State<CanvasImageDialog> {
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)),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/components/canvas/hud/canvas_gesture_lock_btn.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -37,7 +37,7 @@ class CanvasGestureLockBtn extends StatelessWidget {
duration: const Duration(milliseconds: 200),
child: Icon(
icon,
color: colorScheme.onBackground,
color: colorScheme.onSurface,
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/components/canvas/hud/canvas_zoom_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/components/home/preview_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class _PreviewCardState extends State<PreviewCard> {
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(
Expand Down
8 changes: 4 additions & 4 deletions lib/components/theming/dynamic_material_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ class _DynamicMaterialAppState extends State<DynamicMaterialApp>
useMaterial3: true,
colorScheme: lightColorScheme,
textTheme: getTextTheme(Brightness.light),
scaffoldBackgroundColor: lightColorScheme.background,
scaffoldBackgroundColor: lightColorScheme.surface,
platform: platform,
),
darkTheme: yaruTheme?.darkTheme ??
ThemeData(
useMaterial3: true,
colorScheme: darkColorScheme,
textTheme: getTextTheme(Brightness.dark),
scaffoldBackgroundColor: darkColorScheme.background,
scaffoldBackgroundColor: darkColorScheme.surface,
platform: platform,
),
highContrastTheme: yaruHighContrastTheme?.theme ??
Expand All @@ -212,7 +212,7 @@ class _DynamicMaterialAppState extends State<DynamicMaterialApp>
colorScheme: highContrastLightColorScheme,
textTheme: getTextTheme(Brightness.light),
scaffoldBackgroundColor:
highContrastLightColorScheme.background,
highContrastLightColorScheme.surface,
platform: platform,
),
highContrastDarkTheme: yaruHighContrastTheme?.darkTheme ??
Expand All @@ -221,7 +221,7 @@ class _DynamicMaterialAppState extends State<DynamicMaterialApp>
colorScheme: highContrastDarkColorScheme,
textTheme: getTextTheme(Brightness.dark),
scaffoldBackgroundColor:
highContrastDarkColorScheme.background,
highContrastDarkColorScheme.surface,
platform: platform,
),
debugShowCheckedModeBanner: false,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/toolbar/size_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
Expand Down
13 changes: 5 additions & 8 deletions lib/components/toolbar/toolbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,15 @@ class _ToolbarState extends State<Toolbar> {
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),
),
),
);
Expand Down Expand Up @@ -545,7 +542,7 @@ class _ToolbarState extends State<Toolbar> {
];

return Material(
color: colorScheme.background,
color: colorScheme.surface,
child: isToolbarVertical
? Row(
textDirection:
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/home/browse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class _BrowsePageState extends State<BrowsePage> {
flexibleSpace: FlexibleSpaceBar(
title: Text(
title,
style: TextStyle(color: colorScheme.onBackground),
style: TextStyle(color: colorScheme.onSurface),
),
centerTitle: cupertino,
titlePadding: EdgeInsetsDirectional.only(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/home/recent_notes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class _RecentPageState extends State<RecentPage> {
flexibleSpace: FlexibleSpaceBar(
title: Text(
t.home.titles.home,
style: TextStyle(color: colorScheme.onBackground),
style: TextStyle(color: colorScheme.onSurface),
),
centerTitle: cupertino,
titlePadding: EdgeInsetsDirectional.only(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/home/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class _SettingsPageState extends State<SettingsPage> {
flexibleSpace: FlexibleSpaceBar(
title: Text(
t.home.titles.settings,
style: TextStyle(color: colorScheme.onBackground),
style: TextStyle(color: colorScheme.onSurface),
),
centerTitle: cupertino,
titlePadding: EdgeInsetsDirectional.only(
Expand Down

0 comments on commit 0fd414c

Please sign in to comment.