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
|
|
@ -4,23 +4,24 @@ import 'package:get_it/get_it.dart';
|
|||
import 'package:redux/redux.dart';
|
||||
|
||||
import 'models/appState.dart';
|
||||
import 'models/fireMapState.dart';
|
||||
import 'redux/fireMapActions.dart';
|
||||
|
||||
/// Layer selector widget for changing map layers
|
||||
class LayerSelectorMapPluginWidget extends StatelessWidget {
|
||||
const LayerSelectorMapPluginWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Store<AppState> store = GetIt.instance<Store<AppState>>();
|
||||
final Store<AppState> store = GetIt.instance<Store<AppState>>();
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) =>
|
||||
builder: (BuildContext context, BoxConstraints constraints) =>
|
||||
Stack(fit: StackFit.expand, children: <Widget>[
|
||||
Positioned(
|
||||
top: constraints.maxHeight - 60,
|
||||
left: 10.0,
|
||||
child: new CenteredRow(
|
||||
child: CenteredRow(
|
||||
children: <Widget>[
|
||||
new Column(
|
||||
Column(
|
||||
children: <Widget>[_LayerSelectorButton(store)],
|
||||
)
|
||||
],
|
||||
|
|
@ -30,7 +31,7 @@ class LayerSelectorMapPluginWidget extends StatelessWidget {
|
|||
}
|
||||
|
||||
Widget _LayerSelectorButton(Store<AppState> store) {
|
||||
final key = GlobalKey<PopupMenuButtonState<FireMapLayer>>();
|
||||
final GlobalKey<PopupMenuButtonState<FireMapLayer>> key = GlobalKey<PopupMenuButtonState<FireMapLayer>>();
|
||||
|
||||
return PopupMenuButton<FireMapLayer>(
|
||||
key: key,
|
||||
|
|
@ -40,17 +41,17 @@ class LayerSelectorMapPluginWidget extends StatelessWidget {
|
|||
},
|
||||
itemBuilder: (BuildContext context) {
|
||||
return FireMapLayer.values.map((FireMapLayer layer) {
|
||||
final isSelected = store.state.fireMapState.layer == layer;
|
||||
final bool isSelected = store.state.fireMapState.layer == layer;
|
||||
return PopupMenuItem<FireMapLayer>(
|
||||
value: layer,
|
||||
child: Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
isSelected ? Icons.check : Icons.check,
|
||||
color: isSelected ? Colors.blue : Colors.transparent,
|
||||
size: 20,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
_getLayerName(layer),
|
||||
style: TextStyle(
|
||||
|
|
@ -66,7 +67,7 @@ class LayerSelectorMapPluginWidget extends StatelessWidget {
|
|||
child: FloatingActionButton(
|
||||
backgroundColor: Colors.black26,
|
||||
mini: true,
|
||||
child: Icon(Icons.layers),
|
||||
child: const Icon(Icons.layers),
|
||||
onPressed: () {
|
||||
key.currentState?.showButtonMenu();
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue