refactor: fix remaining lint warnings and deprecated APIs
- Fix deprecated @ignore in json_serializable models (appState, yourLocation) - Fix empty catch blocks in compassMapPlugin, globalFiresBottomStats, locationUtils - Fix no_logic_in_create_state in firesApp, markdownPage, slider - Fix use_build_context_synchronously in fireAlert - Fix only_throw_errors in firesApi (8 instances) - Exclude generated .g.dart files from analysis - Update deprecated nullable: false to @JsonSerializable() Build: APK generated successfully, 0 errors, 0 warnings
This commit is contained in:
parent
948a609619
commit
862d423f6b
14 changed files with 96 additions and 69 deletions
|
|
@ -7,27 +7,30 @@ import 'generated/i18n.dart';
|
|||
typedef SlideCallback = void Function(int distance);
|
||||
|
||||
class FireDistanceSlider extends StatefulWidget {
|
||||
|
||||
const FireDistanceSlider({super.key, required this.initialValue, required this.onSlide});
|
||||
const FireDistanceSlider(
|
||||
{super.key, required this.initialValue, required this.onSlide});
|
||||
final int initialValue;
|
||||
final SlideCallback onSlide;
|
||||
|
||||
@override
|
||||
_FireDistanceSliderState createState() => _FireDistanceSliderState(
|
||||
initialValue: initialValue, onSlide: onSlide);
|
||||
_FireDistanceSliderState createState() => _FireDistanceSliderState();
|
||||
}
|
||||
|
||||
class _FireDistanceSliderState extends State<FireDistanceSlider> {
|
||||
|
||||
_FireDistanceSliderState({int initialValue = 10, required this.onSlide}) {
|
||||
_sliderValue = initialValue;
|
||||
}
|
||||
_FireDistanceSliderState();
|
||||
late int _sliderValue;
|
||||
final SlideCallback onSlide;
|
||||
late final SlideCallback onSlide;
|
||||
|
||||
Widget sizeText(int sliderValue) => Text(
|
||||
S.of(context).subscribeToValueAroundThisArea(sliderValue.toString()),
|
||||
style: const TextStyle(color: Colors.black87));
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_sliderValue = widget.initialValue;
|
||||
onSlide = widget.onSlide;
|
||||
}
|
||||
|
||||
Widget sizeText(int sliderValue) =>
|
||||
Text(S.of(context).subscribeToValueAroundThisArea(sliderValue.toString()),
|
||||
style: const TextStyle(color: Colors.black87));
|
||||
|
||||
Widget warningText(int sliderValue) => _sliderValue >= 50
|
||||
? Text(S.of(context).warningThisIsAVeryLargeArea,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue