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,61 +4,61 @@ import 'package:flutter/material.dart';
|
|||
import 'colors.dart';
|
||||
import 'generated/i18n.dart';
|
||||
|
||||
typedef void SlideCallback(int distance);
|
||||
typedef SlideCallback = void Function(int distance);
|
||||
|
||||
class FireDistanceSlider extends StatefulWidget {
|
||||
|
||||
const FireDistanceSlider({super.key, required this.initialValue, required this.onSlide});
|
||||
final int initialValue;
|
||||
final SlideCallback onSlide;
|
||||
|
||||
FireDistanceSlider({required this.initialValue, required this.onSlide});
|
||||
|
||||
@override
|
||||
_FireDistanceSliderState createState() => new _FireDistanceSliderState(
|
||||
_FireDistanceSliderState createState() => _FireDistanceSliderState(
|
||||
initialValue: initialValue, onSlide: onSlide);
|
||||
}
|
||||
|
||||
class _FireDistanceSliderState extends State<FireDistanceSlider> {
|
||||
|
||||
_FireDistanceSliderState({int initialValue = 10, required this.onSlide}) {
|
||||
_sliderValue = initialValue;
|
||||
}
|
||||
late int _sliderValue;
|
||||
final SlideCallback onSlide;
|
||||
|
||||
_FireDistanceSliderState({int initialValue = 10, required this.onSlide}) {
|
||||
this._sliderValue = initialValue;
|
||||
}
|
||||
|
||||
Widget sizeText(int sliderValue) => new Text(
|
||||
Widget sizeText(int sliderValue) => Text(
|
||||
S.of(context).subscribeToValueAroundThisArea(sliderValue.toString()),
|
||||
style: new TextStyle(color: Colors.black87));
|
||||
style: const TextStyle(color: Colors.black87));
|
||||
|
||||
Widget warningText(int sliderValue) => _sliderValue >= 50
|
||||
? new Text(S.of(context).warningThisIsAVeryLargeArea,
|
||||
style: new TextStyle(color: fires900))
|
||||
: new Text('');
|
||||
? Text(S.of(context).warningThisIsAVeryLargeArea,
|
||||
style: const TextStyle(color: fires900))
|
||||
: const Text('');
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var slider = new Slider(
|
||||
final Slider slider = Slider(
|
||||
value: _sliderValue + 0.0,
|
||||
activeColor: fires900,
|
||||
inactiveColor: Colors.black45,
|
||||
min: 1.0,
|
||||
max: 100.0,
|
||||
divisions: 99,
|
||||
label: '${_sliderValue.round()}',
|
||||
label: '$_sliderValue',
|
||||
onChanged: (double value) {
|
||||
_sliderValue = value.round();
|
||||
onSlide(_sliderValue);
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
return new Column(
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: listWithoutNulls(<Widget>[
|
||||
new SizedBox(height: 50.0),
|
||||
new Row(mainAxisSize: MainAxisSize.max, children: <Widget>[slider]),
|
||||
const SizedBox(height: 50.0),
|
||||
Row(children: <Widget>[slider]),
|
||||
// new SizedBox(height: 5.0),
|
||||
new Column(children: <Widget>[
|
||||
Column(children: <Widget>[
|
||||
sizeText(_sliderValue),
|
||||
new SizedBox(height: 5.0),
|
||||
const SizedBox(height: 5.0),
|
||||
warningText(_sliderValue)
|
||||
])
|
||||
]),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue