feat(map): migrate to flutter_map 8.2 with OSM-compliant tiles

This commit is contained in:
2026-02-17 16:41:02 +01:00
parent f709d72f50
commit 4b9b9a2327
5 changed files with 88 additions and 143 deletions

View File

@ -1,30 +1,34 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart';
import 'package:ot_viewer_app/main.dart';
import 'package:ot_viewer_app/refresh_cubit.dart';
import 'package:ot_viewer_app/settings_page.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
setUpAll(() async {
TestWidgetsFlutterBinding.ensureInitialized();
final tempDir = await Directory.systemTemp.createTemp('ot_viewer_test');
HydratedBloc.storage = await HydratedStorage.build(
storageDirectory: tempDir,
);
});
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
testWidgets('App shell renders with map and settings tabs',
(WidgetTester tester) async {
await tester.pumpWidget(
MultiBlocProvider(
providers: [
BlocProvider(create: (context) => SettingsCubit()),
BlocProvider(create: (context) => RefreshCubit()),
],
child: const MyApp(),
),
);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
expect(find.text('Map'), findsOneWidget);
expect(find.text('Settings'), findsOneWidget);
});
}