A whole lot of stuff

This commit is contained in:
Courtney Arnold 2026-08-18 11:04:58 -05:00
parent faf319322a
commit ad850d2be6
50 changed files with 3013 additions and 213 deletions

View file

@ -5,11 +5,13 @@ import 'package:provider/provider.dart';
import '../models/fuel_entry.dart';
import '../models/vehicle.dart';
import '../services/app_state.dart';
import '../services/estimated_refund.dart';
import '../services/onboarding_keys.dart';
import '../theme/app_theme.dart';
import '../widgets/hero_banner.dart';
import '../widgets/receipt_capture.dart';
import 'add_edit_vehicle_screen.dart';
import 'faq_screen.dart';
import 'receipt_detail_screen.dart';
/// The three summary periods selectable below the hero totals — the
@ -142,6 +144,7 @@ class _ReceiptsScreenState extends State<ReceiptsScreen> with AutomaticKeepAlive
tooltip: 'Log Fuel Receipt',
onPressed: () => _addReceipt(context),
),
const FaqActionButton(),
],
),
body: ListView(
@ -154,6 +157,9 @@ class _ReceiptsScreenState extends State<ReceiptsScreen> with AutomaticKeepAlive
gallonsFormat: heroGallonsFormat,
selectedRange: _range,
onRangeSelected: (range) => setState(() => _range = range),
estimatedRefundValue: appState.showEstimatedFuelRefund
? currencyFormat.format(estimatedFuelRefund(totalGallons))
: null,
),
Padding(
padding: const EdgeInsets.fromLTRB(2, 14, 2, 8),
@ -176,6 +182,7 @@ class _ReceiptsScreenState extends State<ReceiptsScreen> with AutomaticKeepAlive
dateFormat: dateFormat,
currencyFormat: currencyFormat,
gallonsFormat: gallonsFormat,
showEstimatedRefund: appState.showEstimatedFuelRefund,
onTap: () => _openReceipt(context, entries[i]),
),
],
@ -229,6 +236,7 @@ class _HeroTotal extends StatelessWidget {
final NumberFormat gallonsFormat;
final _DateRange selectedRange;
final ValueChanged<_DateRange> onRangeSelected;
final String? estimatedRefundValue;
const _HeroTotal({
required this.totalCost,
@ -237,6 +245,7 @@ class _HeroTotal extends StatelessWidget {
required this.gallonsFormat,
required this.selectedRange,
required this.onRangeSelected,
this.estimatedRefundValue,
});
@override
@ -248,6 +257,7 @@ class _HeroTotal extends StatelessWidget {
HeroStatsRow(
gallonsValue: gallonsFormat.format(totalGallons),
costValue: currencyFormat.format(totalCost),
estimatedRefundValue: estimatedRefundValue,
),
const SizedBox(height: 7),
_DateRangeSelector(selected: selectedRange, onSelected: onRangeSelected),
@ -263,6 +273,7 @@ class _ReceiptRow extends StatelessWidget {
final DateFormat dateFormat;
final NumberFormat currencyFormat;
final NumberFormat gallonsFormat;
final bool showEstimatedRefund;
final VoidCallback onTap;
const _ReceiptRow({
@ -271,6 +282,7 @@ class _ReceiptRow extends StatelessWidget {
required this.dateFormat,
required this.currencyFormat,
required this.gallonsFormat,
required this.showEstimatedRefund,
required this.onTap,
});
@ -295,7 +307,10 @@ class _ReceiptRow extends StatelessWidget {
),
const SizedBox(height: 3),
Text(
'${gallonsFormat.format(entry.gallons)} gal',
showEstimatedRefund
? '${gallonsFormat.format(entry.gallons)} gal · Est. '
'${currencyFormat.format(estimatedFuelRefund(entry.gallons))}'
: '${gallonsFormat.format(entry.gallons)} gal',
style: TextStyle(color: colorScheme.onSurfaceVariant, fontSize: 12.5),
),
],