This repository has been archived on 2024-04-18. You can view files and clone it, but cannot push or open issues or pull requests.

42 lines
1.2 KiB
Dart

import 'package:app/extensions/obtainProviderExtension.dart';
import 'package:app/state/mapState.dart';
import 'package:app/view/legalStatus.dart';
import 'package:app/view/map.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class HomeView extends StatefulWidget {
const HomeView({super.key});
@override
State<HomeView> createState() => _HomePageState();
}
class _HomePageState extends State<HomeView> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: const Text("Bubatzkarte"),
actions: [],
),
floatingActionButton: FloatingActionButton(
child: Consumer<MapState>(builder: (context, value, child) => Icon(value.followLocation ? Icons.my_location : Icons.location_disabled)),
onPressed: () => context.obtainState<MapState>().toggleLocationLock(),
),
body: const Column(
children: [
SizedBox(
height: 100,
child: LegalStatusView(),
),
Expanded(
child: MapView(),
)
],
),
);
}
}