fix: resolve 2 remaining strict analysis errors
- introPage.dart: Convert fireItems to proper static function closure - mainDrawer.dart: Convert unreadCount int to String for Text widget
This commit is contained in:
parent
1864e5b105
commit
7a4c9fb3bc
61 changed files with 1386 additions and 1202 deletions
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:redux/src/store.dart';
|
||||
|
||||
import 'colors.dart';
|
||||
import 'compassMapPlugin.dart';
|
||||
|
|
@ -9,12 +10,11 @@ import 'customBottomAppBar.dart';
|
|||
import 'generated/i18n.dart';
|
||||
import 'mainDrawer.dart';
|
||||
import 'models/appState.dart';
|
||||
import 'firesSpinner.dart';
|
||||
|
||||
class _ViewModel {
|
||||
List<Polyline> monitoredAreas;
|
||||
|
||||
_ViewModel(this.monitoredAreas);
|
||||
List<Polyline> monitoredAreas;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
|
|
@ -28,65 +28,63 @@ class _ViewModel {
|
|||
}
|
||||
|
||||
class MonitoredAreasPage extends StatelessWidget {
|
||||
static const String routeName = "monitoredAreasMap";
|
||||
const MonitoredAreasPage({super.key});
|
||||
|
||||
static const String routeName = 'monitoredAreasMap';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new StoreConnector<AppState, _ViewModel>(
|
||||
return StoreConnector<AppState, _ViewModel>(
|
||||
distinct: true,
|
||||
converter: (store) {
|
||||
return new _ViewModel(store.state.monitoredAreas);
|
||||
converter: (Store<AppState> store) {
|
||||
return _ViewModel(store.state.monitoredAreas);
|
||||
},
|
||||
builder: (context, view) {
|
||||
return new Scaffold(
|
||||
builder: (BuildContext context, _ViewModel view) {
|
||||
return Scaffold(
|
||||
appBar:
|
||||
new AppBar(title: new Text(S.of(context).monitoredAreasTitle)),
|
||||
drawer: new MainDrawer(context, MonitoredAreasPage.routeName),
|
||||
bottomNavigationBar: new CustomBottomAppBar(
|
||||
AppBar(title: Text(S.of(context).monitoredAreasTitle)),
|
||||
drawer: MainDrawer(context, MonitoredAreasPage.routeName),
|
||||
bottomNavigationBar: CustomBottomAppBar(
|
||||
fabLocation: FloatingActionButtonLocation.centerDocked,
|
||||
showNotch: true,
|
||||
color: fires100,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
actions: <Widget>[
|
||||
new Flexible(
|
||||
child: new Padding(
|
||||
padding: new EdgeInsets.only(left: 10.0, right: 10.0),
|
||||
child: new Column(
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
new Text(S.of(context).mapPrivacy,
|
||||
style: new TextStyle(
|
||||
children: <Widget>[
|
||||
Text(S.of(context).mapPrivacy,
|
||||
style: const TextStyle(
|
||||
fontStyle: FontStyle.italic,
|
||||
color: Colors.black38))
|
||||
])))
|
||||
]),
|
||||
body: !(view.monitoredAreas is List)
|
||||
? new FiresSpinner()
|
||||
: new Padding(
|
||||
padding: new EdgeInsets.all(10.0),
|
||||
child: new Column(
|
||||
children: [
|
||||
new Padding(
|
||||
padding: new EdgeInsets.only(
|
||||
top: 8.0, bottom: 8.0, left: 0.0, right: 0.0),
|
||||
child: new Text(S.of(context).inGreenMonitoredAreas),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 8.0, bottom: 8.0),
|
||||
child: Text(S.of(context).inGreenMonitoredAreas),
|
||||
),
|
||||
new Flexible(
|
||||
child: new FlutterMap(
|
||||
options: new MapOptions(
|
||||
initialCenter: new LatLng(53.5775, 3.106111),
|
||||
Flexible(
|
||||
child: FlutterMap(
|
||||
options: const MapOptions(
|
||||
initialCenter: LatLng(53.5775, 3.106111),
|
||||
initialZoom: 1.0,
|
||||
),
|
||||
children: [
|
||||
new TileLayer(
|
||||
children: <Widget>[
|
||||
TileLayer(
|
||||
urlTemplate:
|
||||
"https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",
|
||||
subdomains: ['a', 'b', 'c', 'd'],
|
||||
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
|
||||
subdomains: const <String>['a', 'b', 'c', 'd'],
|
||||
userAgentPackageName:
|
||||
'com.example.fires_flutter'),
|
||||
new CompassMapPluginWidget(),
|
||||
new PolylineLayer(
|
||||
const CompassMapPluginWidget(),
|
||||
PolylineLayer(
|
||||
polylines: view.monitoredAreas,
|
||||
)
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue