Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

chore: use M3 outlined text fields

Predidit9f8f6a525025
diff --git a/lib/pages/info/rating_review_dialog.dart b/lib/pages/info/rating_review_dialog.dart
index 559eff29..c1a188ff 100644
--- a/lib/pages/info/rating_review_dialog.dart
+++ b/lib/pages/info/rating_review_dialog.dart
@@ -651,11 +651,10 @@ class _RatingReviewDialogState extends State<RatingReviewDialog> {
? '最多 $_maxSelectedTags 个标签'
: null,
errorText: _tagErrorText,
- filled: true,
- fillColor: colorScheme.surfaceContainerLow,
+ // Outlined, not filled: this field floats a label, and
+ // only the outline can notch around it.
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
- borderSide: BorderSide.none,
),
),
),
diff --git a/lib/pages/player/syncplay_sheet.dart b/lib/pages/player/syncplay_sheet.dart
index 5370b1bd..0ad62be0 100644
--- a/lib/pages/player/syncplay_sheet.dart
+++ b/lib/pages/player/syncplay_sheet.dart
@@ -56,36 +56,28 @@ Future<T?> _showStep<T>(BuildContext context, WidgetBuilder builder) {
String _readEndPoint() =>
GStorage.getSetting<String>(SettingsKeys.syncPlayEndPoint);
-/// Filled and borderless on the same tonal surface as the sheet's cards; a
-/// default outlined field reads as a cut-out against them.
-InputDecoration _sheetInputDecoration(
- BuildContext context, {
+/// M3 outlined field on the sheet's tonal cards, carrying the cards' radius
+/// instead of the 4dp baseline.
+///
+/// Outlined rather than filled: these fields float a label, and only the
+/// outline can notch around it. A fill would slice the label along the
+/// container's top edge.
+InputDecoration _sheetInputDecoration({
required String labelText,
required IconData icon,
String? hintText,
String? helperText,
String? errorText,
}) {
- final ColorScheme colorScheme = Theme.of(context).colorScheme;
- OutlineInputBorder border(BorderSide side) => OutlineInputBorder(
- borderRadius: BorderRadius.circular(20),
- borderSide: side,
- );
-
return InputDecoration(
labelText: labelText,
hintText: hintText,
helperText: helperText,
errorText: errorText,
prefixIcon: Icon(icon),
- filled: true,
- fillColor: colorScheme.surfaceContainerLow,
- hoverColor: colorScheme.surfaceContainer,
- border: border(BorderSide.none),
- enabledBorder: border(BorderSide.none),
- focusedBorder: border(BorderSide(color: colorScheme.primary, width: 2)),
- errorBorder: border(BorderSide(color: colorScheme.error)),
- focusedErrorBorder: border(BorderSide(color: colorScheme.error, width: 2)),
+ // Radius only: InputDecorator recolors this border per state from the M3
+ // defaults, covering hover and disabled as well.
+ border: OutlineInputBorder(borderRadius: BorderRadius.circular(20)),
);
}
@@ -670,7 +662,6 @@ class _SyncPlayRoomSheetState extends State<_SyncPlayRoomSheet> {
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
autovalidateMode: AutovalidateMode.onUserInteraction,
decoration: _sheetInputDecoration(
- context,
labelText: '房间号',
hintText: '6-10 位数字',
icon: Icons.meeting_room_outlined,
@@ -694,7 +685,6 @@ class _SyncPlayRoomSheetState extends State<_SyncPlayRoomSheet> {
textInputAction: TextInputAction.done,
autovalidateMode: AutovalidateMode.onUserInteraction,
decoration: _sheetInputDecoration(
- context,
labelText: '昵称',
icon: Icons.person_outline_rounded,
helperText: compact ? null : '4-12 位英文字母,房间内可见',
@@ -812,7 +802,6 @@ class _SyncPlayServerSheetState extends State<_SyncPlayServerSheet> {
keyboardType: TextInputType.url,
autocorrect: false,
decoration: _sheetInputDecoration(
- context,
labelText: '服务器地址',
hintText: 'example.com:8996',
errorText: _customEndPointError,
diff --git a/lib/pages/plugin_editor/editor_form_widgets.dart b/lib/pages/plugin_editor/editor_form_widgets.dart
index 1b4a21af..124c332a 100644
--- a/lib/pages/plugin_editor/editor_form_widgets.dart
+++ b/lib/pages/plugin_editor/editor_form_widgets.dart
@@ -135,8 +135,12 @@ class EditorExpandableSectionCard extends StatelessWidget {
}
}
-/// Filled text field used inside [EditorSectionCard]: tonal fill, rounded
-/// corners without an outline, and a primary stroke when focused.
+/// M3 outlined text field used inside [EditorSectionCard], carrying the card's
+/// radius instead of the 4dp baseline.
+///
+/// Outlined rather than filled: these fields float a label, and only the
+/// outline can notch around it. A fill would slice the label along the
+/// container's top edge.
class EditorTextField extends StatelessWidget {
const EditorTextField({
super.key,
@@ -155,7 +159,6 @@ class EditorTextField extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final colorScheme = Theme.of(context).colorScheme;
return TextField(
controller: controller,
maxLines: maxLines,
@@ -165,16 +168,9 @@ class EditorTextField extends StatelessWidget {
helperText: helper,
helperMaxLines: 3,
alignLabelWithHint: maxLines > 1,
- filled: true,
- fillColor: colorScheme.surfaceContainerHighest,
- border: OutlineInputBorder(
- borderRadius: BorderRadius.circular(12),
- borderSide: BorderSide.none,
- ),
- focusedBorder: OutlineInputBorder(
- borderRadius: BorderRadius.circular(12),
- borderSide: BorderSide(color: colorScheme.primary, width: 2),
- ),
+ // Radius only: InputDecorator recolors this border per state from the
+ // M3 defaults, covering hover and disabled as well.
+ border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
),
);
}