flutter_map with the same OSM tiles and no-API-key reasoning that chose osmdroid. All four load-bearing behaviours ported and, unlike the native app's map, tested: one polyline per segment so a pause is a real gap, render-only decimation, the zoom clamp at OSM's max tile zoom with a short-ride fallback, and a real user agent. Speed colouring is bucketed per run rather than per-vertex, since neither osmdroid nor flutter_map makes per-vertex paint reasonable. Export via share_plus, which also handles the iPad popover anchor a naive port forgets. It passes the raw stored points, never the map's decimated path. 164 tests passing, analyze clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
40 lines
1.0 KiB
Dart
40 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'src/app/providers.dart';
|
|
import 'src/ui/router.dart';
|
|
import 'src/ui/theme.dart';
|
|
|
|
void main() {
|
|
runApp(const ProviderScope(child: RipprApp()));
|
|
}
|
|
|
|
class RipprApp extends ConsumerStatefulWidget {
|
|
const RipprApp({super.key});
|
|
|
|
@override
|
|
ConsumerState<RipprApp> createState() => _RipprAppState();
|
|
}
|
|
|
|
class _RipprAppState extends ConsumerState<RipprApp> {
|
|
final _router = buildRouter();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
// Re-attach to a ride that was in progress when the process died. Must run before any
|
|
// user interaction, and the database is the only thing that knows a ride was open.
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
ref.read(recordingEngineProvider).restoreAfterProcessDeath();
|
|
});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) => MaterialApp.router(
|
|
title: 'Rippr',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ripprTheme(),
|
|
routerConfig: _router,
|
|
);
|
|
}
|