Skip to content

Commit 6e27e1a

Browse files
committed
Fix lints
1 parent cbdcc35 commit 6e27e1a

File tree

3 files changed

+49
-79
lines changed

3 files changed

+49
-79
lines changed

lib/widgets/grid.dart

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@ class _FilesGridState extends State<FilesGrid> {
6666

6767
return Draggable<FileSystemEntity>(
6868
data: entityInfo.entity,
69-
dragAnchorStrategy: (_, __, ___) => const Offset(32, 32),
69+
dragAnchorStrategy: (_, _, _) => const Offset(32, 32),
7070
feedback: Material(
7171
shape: RoundedRectangleBorder(
7272
borderRadius: BorderRadius.circular(6),
7373
),
74-
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
74+
color: Theme.of(
75+
context,
76+
).colorScheme.onSurface.withValues(alpha: 0.2),
7577
child: Icon(
7678
entityInfo.isDirectory
7779
? Utils.iconForFolder(entityInfo.path)
@@ -129,13 +131,11 @@ class FileCell extends StatelessWidget {
129131
return true;
130132
},
131133
onAcceptWithDetails: (_) => onDropAccept?.call(entity.path),
132-
builder: (context, _, __) => Material(
134+
builder: (context, _, _) => Material(
133135
clipBehavior: Clip.antiAlias,
134-
shape: RoundedRectangleBorder(
135-
borderRadius: BorderRadius.circular(6),
136-
),
136+
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
137137
color: selected
138-
? Theme.of(context).colorScheme.primary.withOpacity(0.2)
138+
? Theme.of(context).colorScheme.primary.withValues(alpha: 0.2)
139139
: Colors.transparent,
140140
child: TimedInkwell(
141141
onTap: () => onTap?.call(entity),
@@ -185,12 +185,7 @@ class Cell extends StatelessWidget {
185185
children: [
186186
const SizedBox(height: 8),
187187
Expanded(
188-
child: _ConstrainedIcon(
189-
child: Icon(
190-
icon,
191-
color: iconColor,
192-
),
193-
),
188+
child: _ConstrainedIcon(child: Icon(icon, color: iconColor)),
194189
),
195190
const SizedBox(height: 8),
196191
DefaultTextStyle(
@@ -215,9 +210,9 @@ class _ConstrainedIcon extends StatelessWidget {
215210
return LayoutBuilder(
216211
builder: (context, constraints) {
217212
return IconTheme(
218-
data: Theme.of(context)
219-
.iconTheme
220-
.copyWith(size: constraints.biggest.shortestSide),
213+
data: Theme.of(
214+
context,
215+
).iconTheme.copyWith(size: constraints.biggest.shortestSide),
221216
child: child,
222217
);
223218
},

lib/widgets/table.dart

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ import 'package:super_clipboard/src/format_conversions.dart';
1818
import 'package:super_clipboard/super_clipboard.dart';
1919
import 'package:yaru/yaru.dart';
2020

21-
typedef HeaderTapCallback = void Function(
22-
bool newAscending,
23-
int newColumnIndex,
24-
);
21+
typedef HeaderTapCallback =
22+
void Function(bool newAscending, int newColumnIndex);
2523

26-
typedef HeaderResizeCallback = void Function(
27-
int newColumnIndex,
28-
DragUpdateDetails details,
29-
);
24+
typedef HeaderResizeCallback =
25+
void Function(int newColumnIndex, DragUpdateDetails details);
3026

3127
class FilesTable extends StatelessWidget {
3228
const FilesTable({
@@ -109,10 +105,7 @@ class FilesTable extends StatelessWidget {
109105
mainAxisSize: MainAxisSize.min,
110106
children: [
111107
...columns.mapIndexed(
112-
(index, column) => _buildHeaderCell(
113-
column,
114-
index,
115-
),
108+
(index, column) => _buildHeaderCell(column, index),
116109
),
117110
Container(
118111
width: rowHorizontalPadding,
@@ -132,36 +125,30 @@ class FilesTable extends StatelessWidget {
132125
row: row,
133126
columns: columns,
134127
horizontalPadding: rowHorizontalPadding,
135-
size: Size(
136-
layoutWidth + (rowHorizontalPadding * 2),
137-
rowHeight,
138-
),
128+
size: Size(layoutWidth + (rowHorizontalPadding * 2), rowHeight),
139129
),
140130
data: row.entity.entity,
141131
dragAnchorStrategy: (draggable, context, position) {
142132
return const Offset(32, 32);
143133
},
144134
feedback: Material(
145135
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
146-
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
136+
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.2),
147137
child: Icon(
148138
row.entity.isDirectory
149139
? Utils.iconForFolder(row.entity.path)
150140
: Utils.iconForPath(row.entity.path),
151141
color: row.entity.isDirectory
152142
? Theme.of(context).colorScheme.primary
153-
: Theme.of(context).colorScheme.onSurface.withOpacity(0.8),
143+
: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.8),
154144
size: 64,
155145
),
156146
),
157147
child: _FilesRow(
158148
row: row,
159149
columns: columns,
160150
horizontalPadding: rowHorizontalPadding,
161-
size: Size(
162-
layoutWidth + (rowHorizontalPadding * 2),
163-
rowHeight,
164-
),
151+
size: Size(layoutWidth + (rowHorizontalPadding * 2), rowHeight),
165152
),
166153
);
167154
}
@@ -183,9 +170,7 @@ class FilesTable extends StatelessWidget {
183170
child: Container(
184171
width: column.normalizedWidth + startPadding,
185172
constraints: BoxConstraints(minWidth: startPadding + 80),
186-
padding: EdgeInsetsDirectional.only(
187-
start: startPadding.toDouble(),
188-
),
173+
padding: EdgeInsetsDirectional.only(start: startPadding.toDouble()),
189174
child: Stack(
190175
clipBehavior: Clip.none,
191176
fit: StackFit.expand,
@@ -321,15 +306,20 @@ class _FilesRowState extends State<_FilesRow> {
321306
return LayoutBuilder(
322307
builder: (context, constraints) {
323308
return Container(
324-
constraints:
325-
BoxConstraints.tightForFinite(height: widget.size.height),
309+
constraints: BoxConstraints.tightForFinite(
310+
height: widget.size.height,
311+
),
326312
padding: EdgeInsetsDirectional.only(
327-
end: (constraints.maxWidth - widget.size.width)
328-
.clamp(0, double.infinity),
313+
end: (constraints.maxWidth - widget.size.width).clamp(
314+
0,
315+
double.infinity,
316+
),
329317
),
330318
child: Material(
331319
color: widget.row.selected
332-
? Theme.of(context).colorScheme.primary.withOpacity(0.2)
320+
? Theme.of(
321+
context,
322+
).colorScheme.primary.withValues(alpha: 0.2)
333323
: Colors.transparent,
334324
clipBehavior: Clip.antiAlias,
335325
child: TimedInkwell(
@@ -407,10 +397,13 @@ class _FilesRowState extends State<_FilesRow> {
407397
overflow: TextOverflow.ellipsis,
408398
);
409399
case FilesColumnType.type:
410-
final fileExtension =
411-
p.extension(entity.path).replaceAll('.', '').toUpperCase();
412-
final fileLabel =
413-
fileExtension.isNotEmpty ? 'File ($fileExtension)' : 'File';
400+
final fileExtension = p
401+
.extension(entity.path)
402+
.replaceAll('.', '')
403+
.toUpperCase();
404+
final fileLabel = fileExtension.isNotEmpty
405+
? 'File ($fileExtension)'
406+
: 'File';
414407
child = Text(
415408
entity.isDirectory ? 'Directory' : fileLabel,
416409
overflow: TextOverflow.ellipsis,

lib/widgets/workspace.dart

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ import 'package:url_launcher/url_launcher_string.dart';
2020
import 'package:yaru/yaru.dart';
2121

2222
class FilesWorkspace extends StatefulWidget {
23-
const FilesWorkspace({
24-
required this.controller,
25-
super.key,
26-
});
23+
const FilesWorkspace({required this.controller, super.key});
2724
final WorkspaceController controller;
2825

2926
@override
@@ -139,12 +136,9 @@ class _FilesWorkspaceState extends State<FilesWorkspace> {
139136
// TODO: remove ignore
140137
// ignore: deprecated_member_use
141138
RawKeyboard.instance.keysPressed;
142-
final multiSelect = keysPressed.contains(
143-
LogicalKeyboardKey.controlLeft,
144-
) ||
145-
keysPressed.contains(
146-
LogicalKeyboardKey.controlRight,
147-
);
139+
final multiSelect =
140+
keysPressed.contains(LogicalKeyboardKey.controlLeft) ||
141+
keysPressed.contains(LogicalKeyboardKey.controlRight);
148142

149143
if (!multiSelect) controller.clearSelectedItems();
150144

@@ -283,24 +277,16 @@ class _FilesWorkspaceState extends State<FilesWorkspace> {
283277

284278
Widget getBody(BuildContext context) {
285279
if (controller.currentInfo == null) {
286-
return const Center(
287-
child: CircularProgressIndicator(),
288-
);
280+
return const Center(child: CircularProgressIndicator());
289281
}
290282

291283
if (controller.currentInfo!.isEmpty) {
292284
return const Center(
293285
child: Column(
294286
mainAxisAlignment: MainAxisAlignment.center,
295287
children: [
296-
Icon(
297-
YaruIcons.folder,
298-
size: 80,
299-
),
300-
Text(
301-
'This Folder is Empty',
302-
style: TextStyle(fontSize: 17),
303-
),
288+
Icon(YaruIcons.folder, size: 80),
289+
Text('This Folder is Empty', style: TextStyle(fontSize: 17)),
304290
],
305291
),
306292
);
@@ -442,9 +428,9 @@ class _WorkspaceTopbar extends StatelessWidget {
442428
if (popupBuilder != null) const SizedBox(width: 8),
443429
if (popupBuilder != null)
444430
MenuAnchor(
445-
menuChildren: popupBuilder!(context)
446-
.map((e) => e.buildWrapper(context))
447-
.toList(),
431+
menuChildren: popupBuilder!(
432+
context,
433+
).map((e) => e.buildWrapper(context)).toList(),
448434
alignmentOffset: const Offset(-8, 8),
449435
builder: (context, controller, child) {
450436
return YaruOptionButton(
@@ -466,7 +452,6 @@ class _WorkspaceTopbar extends StatelessWidget {
466452
case WorkspaceView.grid:
467453
return YaruIcons.app_grid;
468454
case WorkspaceView.table:
469-
default:
470455
return YaruIcons.unordered_list;
471456
}
472457
}
@@ -534,10 +519,7 @@ class _HistoryModifierIconButton extends StatelessWidget {
534519
}
535520

536521
class _WorkspaceErrorWidget extends StatelessWidget {
537-
const _WorkspaceErrorWidget({
538-
required this.error,
539-
required this.path,
540-
});
522+
const _WorkspaceErrorWidget({required this.error, required this.path});
541523
final OSError error;
542524
final String path;
543525

0 commit comments

Comments
 (0)