Removed column on fires map
This commit is contained in:
parent
aa4909f69f
commit
cee04a3d12
1 changed files with 48 additions and 52 deletions
|
|
@ -1,23 +1,24 @@
|
||||||
|
import 'dart:convert' show json;
|
||||||
|
import 'dart:core';
|
||||||
|
|
||||||
|
import 'package:comunes_flutter/comunes_flutter.dart';
|
||||||
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'basicLocation.dart';
|
|
||||||
import 'package:flutter_map/flutter_map.dart';
|
import 'package:flutter_map/flutter_map.dart';
|
||||||
import 'package:flutter_map/plugin_api.dart';
|
import 'package:flutter_map/plugin_api.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:just_debounce_it/just_debounce_it.dart';
|
||||||
import 'package:latlong/latlong.dart';
|
import 'package:latlong/latlong.dart';
|
||||||
import 'package:comunes_flutter/comunes_flutter.dart';
|
|
||||||
|
import 'basicLocation.dart';
|
||||||
import 'colors.dart';
|
import 'colors.dart';
|
||||||
import 'customBottomAppBar.dart';
|
import 'customBottomAppBar.dart';
|
||||||
import 'dart:core';
|
|
||||||
import 'globals.dart' as globals;
|
|
||||||
import 'package:http/http.dart' as http;
|
|
||||||
import 'dart:convert' show json;
|
|
||||||
import 'fireMarker.dart';
|
|
||||||
import 'zoomMapPlugin.dart';
|
|
||||||
import 'dummyMapPlugin.dart';
|
import 'dummyMapPlugin.dart';
|
||||||
import 'fireMarkType.dart';
|
import 'fireMarkType.dart';
|
||||||
|
import 'fireMarker.dart';
|
||||||
|
import 'globals.dart' as globals;
|
||||||
import 'slider.dart';
|
import 'slider.dart';
|
||||||
import 'package:just_debounce_it/just_debounce_it.dart';
|
import 'zoomMapPlugin.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
|
||||||
|
|
||||||
|
|
||||||
enum MapOperation { view, subscriptionConfirm, unsubscribe }
|
enum MapOperation { view, subscriptionConfirm, unsubscribe }
|
||||||
|
|
||||||
|
|
@ -40,7 +41,6 @@ class _GenericMapState extends State<GenericMap> {
|
||||||
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
||||||
final FirebaseMessaging _firebaseMessaging = new FirebaseMessaging();
|
final FirebaseMessaging _firebaseMessaging = new FirebaseMessaging();
|
||||||
|
|
||||||
|
|
||||||
final BasicLocation location;
|
final BasicLocation location;
|
||||||
final String title;
|
final String title;
|
||||||
int numFires;
|
int numFires;
|
||||||
|
|
@ -137,45 +137,41 @@ class _GenericMapState extends State<GenericMap> {
|
||||||
appBar: new AppBar(
|
appBar: new AppBar(
|
||||||
title: new Text(title),
|
title: new Text(title),
|
||||||
),
|
),
|
||||||
floatingActionButton: Column(mainAxisAlignment: MainAxisAlignment.end,
|
floatingActionButton: FloatingActionButton.extended(
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
onPressed: () {
|
||||||
children: <Widget>[
|
setState(() {
|
||||||
FloatingActionButton.extended(
|
switch (operation) {
|
||||||
onPressed: () {
|
case MapOperation.view:
|
||||||
setState(() {
|
operation = MapOperation.subscriptionConfirm;
|
||||||
switch (operation) {
|
break;
|
||||||
case MapOperation.view:
|
case MapOperation.subscriptionConfirm:
|
||||||
operation = MapOperation.subscriptionConfirm;
|
// IOS specific
|
||||||
break;
|
_firebaseMessaging.requestNotificationPermissions();
|
||||||
case MapOperation.subscriptionConfirm:
|
operation = MapOperation.unsubscribe;
|
||||||
// IOS specific
|
break;
|
||||||
_firebaseMessaging.requestNotificationPermissions();
|
case MapOperation.unsubscribe:
|
||||||
operation = MapOperation.unsubscribe;
|
operation = MapOperation.view;
|
||||||
break;
|
break;
|
||||||
case MapOperation.unsubscribe:
|
}
|
||||||
operation = MapOperation.view;
|
});
|
||||||
break;
|
},
|
||||||
}
|
icon: new Icon(
|
||||||
});
|
operation == MapOperation.view
|
||||||
},
|
? Icons.notifications_active
|
||||||
icon: new Icon(
|
: operation == MapOperation.subscriptionConfirm
|
||||||
operation == MapOperation.view
|
? Icons.check
|
||||||
? Icons.notifications_active
|
: Icons.notifications_off,
|
||||||
: operation == MapOperation.subscriptionConfirm
|
color: fires600),
|
||||||
? Icons.check
|
label: new Text(
|
||||||
: Icons.notifications_off,
|
operation == MapOperation.view
|
||||||
color: fires600),
|
? 'Subscribe to fires notifications'
|
||||||
label: new Text(
|
: operation == MapOperation.subscriptionConfirm
|
||||||
operation == MapOperation.view
|
? 'Confirm'
|
||||||
? 'Subscribe to fires notifications'
|
: 'Unsubscribe',
|
||||||
: operation == MapOperation.subscriptionConfirm
|
style: const TextStyle(color: fires600),
|
||||||
? 'Confirm'
|
),
|
||||||
: 'Unsubscribe',
|
backgroundColor: Colors.white,
|
||||||
style: const TextStyle(color: fires600),
|
),
|
||||||
),
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
)
|
|
||||||
]),
|
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||||
bottomNavigationBar: new CustomBottomAppBar(
|
bottomNavigationBar: new CustomBottomAppBar(
|
||||||
fabLocation: FloatingActionButtonLocation.centerFloat,
|
fabLocation: FloatingActionButtonLocation.centerFloat,
|
||||||
|
|
@ -184,7 +180,7 @@ class _GenericMapState extends State<GenericMap> {
|
||||||
// height: 170.0,
|
// height: 170.0,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
actions: listWithoutNulls(<Widget>[
|
actions: listWithoutNulls(<Widget>[
|
||||||
operation == MapOperation.subscriptionConfirm|| numFires == null
|
operation == MapOperation.subscriptionConfirm || numFires == null
|
||||||
? null
|
? null
|
||||||
: numFires > 0
|
: numFires > 0
|
||||||
? new Text('${numFires.toString()} fires at ${kmAround
|
? new Text('${numFires.toString()} fires at ${kmAround
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue