Skip to content

Commit 548614a

Browse files
committed
Fix lint warnings
1 parent 2ce713d commit 548614a

29 files changed

+63
-53
lines changed

lib/src/api.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ void _setupApiCompleter<T>(
108108
ApiOnError? onError,
109109
VoidCallback? onComplete,
110110
) {
111-
var f = completer.future;
111+
Future<void> f = completer.future;
112112

113113
if (onSuccess != null) {
114-
f = f.then(
114+
f = completer.future.then(
115115
(data) => (caller.canReceiveCallback) ? onSuccess(data) : data,
116116
);
117117
}

lib/src/screens/initial_path.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class _InitialPathState extends State<InitialPathScreen>
3232
defaultWidget: widget.defaultWidget,
3333
).catchError((error) async {
3434
await showApiErrorDialog(context, error);
35+
return const SizedBox.shrink();
3536
}).then((built) {
3637
if (built != null) return built;
3738

lib/src/widgets/app_bar.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ class AppBarDrawerHeader extends StatelessWidget {
6868

6969
TextSpan _compileUserRank(BuildContext context, User user) => TextSpan(
7070
text: " ${user.rank?.rankName ?? ''}",
71-
style: Theme.of(context).textTheme.subtitle1?.copyWith(
71+
style: Theme.of(context).textTheme.titleMedium?.copyWith(
7272
color: Theme.of(context).hintColor,
7373
fontWeight: FontWeight.bold,
7474
),
7575
);
7676

7777
TextSpan _compileUsername(BuildContext context, User user) => TextSpan(
7878
text: user.username ?? '',
79-
style: Theme.of(context).textTheme.headline6?.copyWith(
79+
style: Theme.of(context).textTheme.titleLarge?.copyWith(
8080
color: Theme.of(context).colorScheme.secondary,
8181
),
8282
);

lib/src/widgets/attachment_editor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class AttachmentEditorState extends State<AttachmentEditorWidget> {
107107
message: l(context).pickGallery,
108108
child: InkWell(
109109
child: Container(
110-
color: Theme.of(context).backgroundColor,
110+
color: Theme.of(context).colorScheme.background,
111111
padding: const EdgeInsets.symmetric(horizontal: 5.0),
112112
child: AspectRatio(
113113
aspectRatio: 1.0,

lib/src/widgets/font_control.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class _FontControlState extends State<FontControlWidget> with RouteAware {
137137

138138
void _menuOpen() {
139139
final overlayEntry = _overlayEntry = _buildOverlayEntry();
140-
Overlay.of(context)?.insert(overlayEntry);
140+
Overlay.of(context).insert(overlayEntry);
141141
_isMenuOpen = true;
142142
}
143143
}

lib/src/widgets/home/header.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class HeaderWidget extends StatelessWidget {
1010
padding: const EdgeInsets.all(10.0),
1111
child: Text(
1212
text,
13-
style: Theme.of(context).textTheme.headline6,
13+
style: Theme.of(context).textTheme.titleLarge,
1414
),
1515
);
1616
}

lib/src/widgets/home/thread.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class HomeThreadWidget extends StatelessWidget {
4141
_buildTitle(),
4242
const SizedBox(height: 5),
4343
isWide
44-
? _buildSnippet(theme.textTheme.caption)
44+
? _buildSnippet(theme.textTheme.bodySmall)
4545
: const SizedBox.shrink(),
4646
],
4747
),
@@ -89,7 +89,7 @@ class HomeThreadWidget extends StatelessWidget {
8989
overflow: TextOverflow.ellipsis,
9090
text: TextSpan(
9191
children: spans,
92-
style: theme.textTheme.caption,
92+
style: theme.textTheme.bodySmall,
9393
),
9494
);
9595
}

lib/src/widgets/home/top_5.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class _HomeTop5WidgetThread extends StatelessWidget {
147147
overflow: TextOverflow.ellipsis,
148148
text: TextSpan(
149149
children: spans,
150-
style: theme.textTheme.caption,
150+
style: theme.textTheme.bodySmall,
151151
),
152152
);
153153
}

lib/src/widgets/html/galleria.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class _GalleriaItem {
8181
style: p
8282
.getDependency<ThemeData>()
8383
.textTheme
84-
.caption
84+
.bodySmall
8585
?.copyWith(color: kCaptionColor)));
8686
_description = wf.buildColumnPlaceholder(meta, widgets);
8787
return [];

lib/src/widgets/html/lb_trigger.dart

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class _ScreenState extends State<_Screen> {
218218
l(context).navXOfY(index + 1, widget.sources.length),
219219
style: Theme.of(context)
220220
.textTheme
221-
.caption
221+
.bodySmall
222222
?.copyWith(color: kCaptionColor),
223223
),
224224
TextButton(
@@ -241,11 +241,14 @@ class _ScreenState extends State<_Screen> {
241241

242242
Widget child = const SizedBox.shrink();
243243
if (source is _LbTriggerVideo) {
244-
child = VideoPlayer(
245-
aspectRatio: source.aspectRatio,
246-
autoPlay: true,
247-
url: source.url,
248-
);
244+
final sourceUri = Uri.tryParse(source.url);
245+
if (sourceUri != null) {
246+
child = VideoPlayer(
247+
aspectRatio: source.aspectRatio,
248+
autoPlay: true,
249+
uri: sourceUri,
250+
);
251+
}
249252
}
250253

251254
return PhotoViewGalleryPageOptions.customChild(child: child);

0 commit comments

Comments
 (0)