App mobile em Flutter (Dart) para mobiletech: estimativa de corridas com tarifa dinamica (surge), categorias de veiculo e historico de corridas. A logica de negocio fica isolada da UI, o que a torna testavel com unit tests e a interface com widget tests.
- Selecao de categoria (Economy / Comfort / Premium) com politicas de preco distintas.
- Estimativa de tarifa por base + distancia + tempo, com surge e tarifa minima.
- Historico em memoria com total gasto e ticket medio.
lib/
domain/
fare_calculator.dart # politicas de preco + calculo de tarifa (puro Dart)
ride_history.dart # historico + agregados (total, media)
main.dart # UI (Material 3, widgets com Keys para testes)
test/
fare_calculator_test.dart # unit tests da tarifa
ride_history_test.dart # unit tests do historico
widget_test.dart # widget test do fluxo de confirmacao
A camada domain nao importa Flutter, apenas dart:math, permitindo reuso e testes
rapidos sem subir a UI.
raw = base + (perKm * distancia) + (perMinute * duracao)
total = max(raw * surge, tarifaMinima)
flutter pub get
flutter run # emulador ou dispositivo
flutter test # testes unit + widget
flutter analyze # lintsFlutter 3.19 | Dart 3 | Material 3 | flutter_test | flutter_lints | GitHub Actions