mod: lint

mod: tweaks

opt: publish page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-04 11:37:13 +08:00
parent 2cfad80214
commit caa58e9d7d
313 changed files with 2751 additions and 2789 deletions

View File

@@ -121,7 +121,7 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
? theme.colorScheme.outline.withOpacity(0.8)
: theme.colorScheme.secondary,
),
strutStyle: StrutStyle(leading: 0, height: 1),
strutStyle: const StrutStyle(leading: 0, height: 1),
),
Icon(
size: 20,
@@ -138,11 +138,11 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
leading: Container(
width: 40,
alignment: Alignment.center,
child: Icon(Icons.palette_outlined),
child: const Icon(Icons.palette_outlined),
),
subtitle: Text(
_dynamicSchemeVariant.description,
style: TextStyle(fontSize: 12),
style: const TextStyle(fontSize: 12),
),
),
),
@@ -202,7 +202,8 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
height: 46,
decoration: BoxDecoration(
color: e['color'].withOpacity(0.8),
borderRadius: BorderRadius.circular(50),
borderRadius: const BorderRadius.all(
Radius.circular(50)),
border: Border.all(
width: 2,
color: ctr.currentColor.value == index

View File

@@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
@@ -39,8 +38,9 @@ class _SetDisplayModeState extends State<SetDisplayMode> {
@override
void dispose() {
controller.removeListener(listener);
controller.dispose();
controller
..removeListener(listener)
..dispose();
super.dispose();
}

View File

@@ -27,10 +27,11 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
setting.get(SettingBoxKey.defaultTextScale, defaultValue: 1.0);
}
setFontSize() {
void setFontSize() {
setting.put(SettingBoxKey.defaultTextScale, currentSize);
Get.back(result: currentSize);
Get.forceAppUpdate();
Get
..back(result: currentSize)
..forceAppUpdate();
}
@override
@@ -62,7 +63,7 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
),
Container(
width: double.infinity,
padding: EdgeInsets.all(20),
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
border: Border(
top: BorderSide(

View File

@@ -27,14 +27,14 @@ class _LogsPageState extends State<LogsPage> {
@override
void dispose() {
if (latestLog != null) {
if (DateTime.now().difference(latestLog!) >= Duration(days: 14)) {
if (DateTime.now().difference(latestLog!) >= const Duration(days: 14)) {
clearLogs();
}
}
super.dispose();
}
void getPath() async {
Future<void> getPath() async {
logsPath = await getLogsPath();
fileContent = await logsPath.readAsString();
logsContent = await parseLogs(fileContent);
@@ -82,7 +82,7 @@ class _LogsPageState extends State<LogsPage> {
return result.reversed.toList();
}
void copyLogs() async {
Future<void> copyLogs() async {
await Utils.copyText('```\n$fileContent\n```', needToast: false);
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
@@ -91,7 +91,7 @@ class _LogsPageState extends State<LogsPage> {
}
}
void clearLogsHandle() async {
Future<void> clearLogsHandle() async {
if (await clearLogs()) {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
@@ -174,8 +174,7 @@ class _LogsPageState extends State<LogsPage> {
TextButton.icon(
style: TextButton.styleFrom(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
visualDensity:
VisualDensity(horizontal: -2, vertical: -2),
visualDensity: VisualDensity.compact,
),
onPressed: () async {
await Utils.copyText('```\n${log['body']}\n```',

View File

@@ -85,11 +85,12 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
const SizedBox(height: 12),
TextField(
autofocus: true,
keyboardType: TextInputType.numberWithOptions(decimal: true),
decoration: InputDecoration(
keyboardType:
const TextInputType.numberWithOptions(decimal: true),
decoration: const InputDecoration(
labelText: '自定义倍速',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(6.0),
borderRadius: BorderRadius.all(Radius.circular(6)),
),
),
onChanged: (value) {
@@ -114,8 +115,9 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
SmartDialog.showToast('该倍速已存在');
} else {
Get.back();
speedList.add(customSpeed!);
speedList.sort();
speedList
..add(customSpeed!)
..sort();
await video.put(VideoBoxKey.speedsList, speedList);
setState(() {});
}
@@ -166,7 +168,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
}
//
void menuAction(index, id) async {
Future<void> menuAction(index, id) async {
double speed = speedList[index];
// 设置
if (id == 1) {
@@ -205,7 +207,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
speedList = GStorage.speedList;
setState(() {});
},
child: Text('重置'),
child: const Text('重置'),
),
const SizedBox(width: 16),
],