opt.: upgrade linter & fix lint issues

This commit is contained in:
lollipopkit
2023-12-06 11:09:05 +08:00
parent 143cb1e7c1
commit 8a3fd342c6
38 changed files with 92 additions and 94 deletions

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
class CardX extends StatelessWidget {
const CardX(this.child, {Key? key, this.color}) : super(key: key);
const CardX(this.child, {super.key, this.color});
final Widget child;
final Color? color;

View File

@@ -3,11 +3,11 @@ import 'package:flutter/material.dart';
class ChoiceChipX<T> extends StatelessWidget {
const ChoiceChipX({
Key? key,
super.key,
required this.label,
required this.state,
required this.value,
}) : super(key: key);
});
final String label;
final ChoiceController<T> state;

View File

@@ -6,10 +6,10 @@ class FadeIn extends StatefulWidget {
final Duration duration;
const FadeIn({
Key? key,
super.key,
required this.child,
this.duration = const Duration(milliseconds: 477),
}) : super(key: key);
});
@override
_MyFadeInState createState() => _MyFadeInState();

View File

@@ -8,11 +8,11 @@ class OmitStartText extends StatelessWidget {
const OmitStartText(
this.text, {
Key? key,
super.key,
this.maxLines,
this.style,
this.overflow,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View File

@@ -184,13 +184,13 @@ class TagSwitcher extends StatelessWidget {
final String all;
const TagSwitcher({
Key? key,
super.key,
required this.tags,
required this.width,
required this.onTagChanged,
required this.all,
this.initTag,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View File

@@ -2,8 +2,7 @@ import 'package:flutter/material.dart';
import 'package:toolbox/data/res/ui.dart';
class TwoLineText extends StatelessWidget {
const TwoLineText({Key? key, required this.up, required this.down})
: super(key: key);
const TwoLineText({super.key, required this.up, required this.down});
final String up;
final String down;

View File

@@ -14,12 +14,12 @@ class UrlText extends StatelessWidget {
final TextStyle style;
const UrlText({
Key? key,
super.key,
required this.text,
this.replace,
this.textAlign,
this.style = const TextStyle(),
}) : super(key: key);
});
List<InlineSpan> _buildTextSpans(Color c) {
final widgets = <InlineSpan>[];
@@ -69,9 +69,8 @@ class UrlText extends StatelessWidget {
}
class _LinkTextSpan extends TextSpan {
_LinkTextSpan({TextStyle? style, required String text, String? replace})
_LinkTextSpan({super.style, required String text, String? replace})
: super(
style: style,
text: replace ?? text,
recognizer: TapGestureRecognizer()
..onTap = () {