anyway/frontend/lib/modules/overview.dart
Remy Moll 3854cef54a
Some checks failed
Test code / Test code (push) Failing after 24s
Build web / Build Web (pull_request) Failing after 3m10s
Test code / Test code (pull_request) Failing after 44s
Build and release APK / Build APK (pull_request) Failing after 15m48s
adding google maps baby!
2024-05-17 20:12:59 +02:00

100 lines
2.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:sliding_up_panel/sliding_up_panel.dart';
import 'package:geocode/geocode.dart';
import 'dart:async';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:fast_network_navigation/modules/navigation.dart';
import 'package:fast_network_navigation/modules/map.dart';
class MainPage extends StatefulWidget {
@override
State<MainPage> createState() => _MainPageState();
}
class Debounce {
Duration delay;
Timer? _timer;
Debounce(
this.delay,
);
call(void Function() callback) {
_timer?.cancel();
_timer = Timer(delay, callback);
}
dispose() {
_timer?.cancel();
}
}
class _MainPageState extends State<MainPage> {
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
return SlidingUpPanel(
renderPanelSheet: false,
panel: _floatingPanel(theme),
collapsed: _floatingCollapsed(theme),
body: MapWidget()
);
}
Widget _floatingCollapsed(ThemeData theme){
return Container(
decoration: BoxDecoration(
color: theme.canvasColor,
borderRadius: BorderRadius.only(topLeft: Radius.circular(24.0), topRight: Radius.circular(24.0)),
),
child: Greeting(theme)
);
}
Widget _floatingPanel(ThemeData theme){
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(24.0)),
boxShadow: [
BoxShadow(
blurRadius: 20.0,
color: theme.shadowColor,
),
]
),
child: Center(
child: Padding(
padding: EdgeInsets.all(8.0),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
Greeting(theme),
Text("Got a lot to do today! Here is a rundown:"),
...loadDestinations(),
],
),
),
),
),
);
}
Widget Greeting (ThemeData theme) {
return Center(
child: Text(
"Explore #todo",
style: TextStyle(color: theme.primaryColor, fontSize: 24.0, fontWeight: FontWeight.bold),
),
);
}
}