Remove Cupertino UI branches from shared primitives
Keep the existing Material rendering, semantics, and interaction paths while removing obsolete Cupertino imports, alternate widgets, and dynamic-color dependencies. Record focused verification and remaining fixture limitations for final integration.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'dart:ui' show SemanticsRole;
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -73,40 +72,24 @@ class FloatingTabButton extends StatelessWidget {
|
||||
role: SemanticsRole.tab,
|
||||
selected: selected,
|
||||
button: true,
|
||||
label: cupertino || kIsWeb ? label : '$label\n${_tabLabel(context)}',
|
||||
hint: cupertino ? _tabLabel(context) : null,
|
||||
label: kIsWeb ? label : '$label\n${_tabLabel(context)}',
|
||||
// Switching tabs does not unfocus a text field (the composer).
|
||||
child: TextFieldTapRegion(
|
||||
child: cupertino
|
||||
? button
|
||||
: Tooltip(
|
||||
message: label,
|
||||
excludeFromSemantics: true,
|
||||
child: button,
|
||||
),
|
||||
child: Tooltip(
|
||||
message: label,
|
||||
excludeFromSemantics: true,
|
||||
child: button,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String _tabLabel(BuildContext context) => cupertino
|
||||
? CupertinoLocalizations.of(
|
||||
context,
|
||||
).tabSemanticsLabel(tabIndex: index + 1, tabCount: count)
|
||||
: MaterialLocalizations.of(
|
||||
String _tabLabel(BuildContext context) => MaterialLocalizations.of(
|
||||
context,
|
||||
).tabLabel(tabIndex: index + 1, tabCount: count);
|
||||
|
||||
({Color tint, Color selectedIcon, Color icon}) _colors(BuildContext context) {
|
||||
if (cupertino) {
|
||||
final active = CupertinoTheme.of(context).primaryColor;
|
||||
return (
|
||||
tint: active.withValues(alpha: cupertinoTintOpacity),
|
||||
selectedIcon: active,
|
||||
// Secondary-label translucency over glass falls below contrast.
|
||||
icon: CupertinoColors.label.resolveFrom(context),
|
||||
);
|
||||
}
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return (
|
||||
tint: scheme.secondaryContainer,
|
||||
@@ -125,21 +108,7 @@ class FloatingTabButton extends StatelessWidget {
|
||||
color: colors.tint.withValues(alpha: colors.tint.a * t),
|
||||
shape: const CircleBorder(),
|
||||
);
|
||||
final Widget fill = cupertino
|
||||
? DecoratedBox(
|
||||
key: fillKey,
|
||||
decoration: decoration,
|
||||
child: MouseRegion(
|
||||
cursor: kIsWeb ? SystemMouseCursors.click : MouseCursor.defer,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: onTap,
|
||||
),
|
||||
),
|
||||
)
|
||||
// Painted on the glass's Material, under the ink, so the ripple
|
||||
// shows over the selected tint too.
|
||||
: Ink(
|
||||
final Widget fill = Ink(
|
||||
key: fillKey,
|
||||
decoration: decoration,
|
||||
child: InkResponse(
|
||||
|
||||
Reference in New Issue
Block a user