null safety
This commit is contained in:
@@ -5,10 +5,10 @@ import 'package:flutter/material.dart';
|
||||
import 'local_text.dart';
|
||||
|
||||
class DialogInput extends StatefulWidget {
|
||||
final String value;
|
||||
final String label;
|
||||
final String? value;
|
||||
final String? label;
|
||||
|
||||
const DialogInput({Key key, this.label, this.value}) : super(key: key);
|
||||
const DialogInput({Key? key, this.label, this.value}) : super(key: key);
|
||||
@override
|
||||
_DialogInputState createState() => _DialogInputState();
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class _DialogInputState extends State<DialogInput> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.value != null) {
|
||||
_controller.text = widget.value;
|
||||
_controller.text = widget.value!;
|
||||
_focusNode.addListener(() {
|
||||
if (_focusNode.hasFocus) {
|
||||
_controller.selection = TextSelection(
|
||||
@@ -41,7 +41,7 @@ class _DialogInputState extends State<DialogInput> {
|
||||
child: AlertDialog(
|
||||
title: LocalText(
|
||||
context,
|
||||
widget.label,
|
||||
widget.label!,
|
||||
fontSize: 20,
|
||||
color: primaryColor,
|
||||
),
|
||||
@@ -77,7 +77,7 @@ class _DialogInputState extends State<DialogInput> {
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
onPressed: () async {
|
||||
if (!_formKey.currentState.validate()) return;
|
||||
if (!_formKey.currentState!.validate()) return;
|
||||
_save();
|
||||
})
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user