Fix trips on entry page, correct order of trips on dashboard and trip page, move to prod api
Some checks failed
Release / meta (push) Successful in 17s
Release / linux-build (push) Successful in 1m33s
Release / android-build (push) Successful in 15m28s
Release / release-dev (push) Failing after 4s
Release / release-master (push) Successful in 29s

This commit is contained in:
2025-12-12 09:17:18 +00:00
parent 53eaf0b4af
commit 292163bda6
6 changed files with 180 additions and 110 deletions

View File

@@ -38,6 +38,8 @@ class _TractionPageState extends State<TractionPage> {
final _domainController = TextEditingController();
final _typeController = TextEditingController();
int offset = 0;
@override
void initState() {
super.initState();
@@ -239,40 +241,39 @@ class _TractionPageState extends State<TractionPage> {
onSubmitted: (_) => _refreshTraction(),
);
},
optionsViewBuilder:
(context, onSelected, options) {
final optionList = options.toList();
if (optionList.isEmpty) {
return const SizedBox.shrink();
}
final maxWidth = isMobile
? MediaQuery.of(context).size.width - 64
: 240.0;
return Align(
alignment: Alignment.topLeft,
child: Material(
elevation: 4,
child: ConstrainedBox(
constraints: BoxConstraints(
maxWidth: maxWidth,
maxHeight: 240,
),
child: ListView.builder(
padding: EdgeInsets.zero,
shrinkWrap: true,
itemCount: optionList.length,
itemBuilder: (context, index) {
final option = optionList[index];
return ListTile(
title: Text(option),
onTap: () => onSelected(option),
);
},
),
),
optionsViewBuilder: (context, onSelected, options) {
final optionList = options.toList();
if (optionList.isEmpty) {
return const SizedBox.shrink();
}
final maxWidth = isMobile
? MediaQuery.of(context).size.width - 64
: 240.0;
return Align(
alignment: Alignment.topLeft,
child: Material(
elevation: 4,
child: ConstrainedBox(
constraints: BoxConstraints(
maxWidth: maxWidth,
maxHeight: 240,
),
);
},
child: ListView.builder(
padding: EdgeInsets.zero,
shrinkWrap: true,
itemCount: optionList.length,
itemBuilder: (context, index) {
final option = optionList[index];
return ListTile(
title: Text(option),
onTap: () => onSelected(option),
);
},
),
),
),
);
},
onSelected: (String selection) {
setState(() {
_selectedClass = selection;
@@ -306,7 +307,7 @@ class _TractionPageState extends State<TractionPage> {
),
FilterChip(
label: Text(
_mileageFirst ? 'Mileage first' : 'Had first',
_mileageFirst ? 'Mileage first' : 'Number order',
),
selected: _mileageFirst,
onSelected: (v) {