9551eceaed
Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
66 lines
2.1 KiB
Dart
66 lines
2.1 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.labels,
|
|
required this.selected,
|
|
required this.buttonBuilder,
|
|
required this.onTap,
|
|
});
|
|
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,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|