Files
pipelines/app/lib/ui/adaptive/floating_destination_labels.dart
T
alan 5c80f75211 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.
2026-11-11 20:05:58 +00:00

68 lines
2.2 KiB
Dart

import 'dart:ui' show SemanticsRole;
import 'package:flutter/material.dart';
/// Content-driven main navigation captions keep names visible without scaling
/// down touch targets. Narrow lists and large text wrap into another row.
class FloatingDestinationLabels extends StatelessWidget {
const FloatingDestinationLabels({
super.key,
required this.cupertino,
required this.labels,
required this.selected,
required this.buttonBuilder,
required this.onTap,
});
final bool cupertino;
final List<String> labels;
final int selected;
final Widget Function(int) buttonBuilder;
final ValueChanged<int> onTap;
@override
Widget build(BuildContext context) {
final color = Theme.of(context).colorScheme.onSurface;
final style = Theme.of(context).textTheme.labelSmall!;
return Semantics(
role: SemanticsRole.tabBar,
container: true,
explicitChildNodes: true,
child: Padding(
padding: const EdgeInsets.all(8),
child: Wrap(
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 8,
runSpacing: 8,
children: [
for (var index = 0; index < labels.length; index++)
GestureDetector(
key: ValueKey('destination-label-${labels[index]}'),
excludeFromSemantics: true,
onTap: () => onTap(index),
child: TextFieldTapRegion(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
buttonBuilder(index),
ExcludeSemantics(
child: Text(
labels[index],
style: style.copyWith(
color: color,
fontWeight: index == selected
? FontWeight.w600
: style.fontWeight,
),
),
),
],
),
),
),
],
),
),
);
}
}