null safety
This commit is contained in:
@@ -33,7 +33,7 @@ Future showMsgDialog(BuildContext context, String title, String msg) {
|
||||
|
||||
Future<void> showConfirmDialog(
|
||||
BuildContext context, String translationKey, ok(),
|
||||
{List<String> translationVariables}) async {
|
||||
{List<String>? translationVariables}) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
@@ -42,7 +42,7 @@ Future<void> showConfirmDialog(
|
||||
child: LocalText(
|
||||
context,
|
||||
translationKey,
|
||||
translationVariables: translationVariables,
|
||||
translationVariables: translationVariables!,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
@@ -188,7 +188,7 @@ Widget getStatus(String status) {
|
||||
],
|
||||
)
|
||||
: Text(
|
||||
status ?? "",
|
||||
status,
|
||||
style: TextStyle(
|
||||
color: primaryColor,
|
||||
fontSize: 18,
|
||||
@@ -230,10 +230,10 @@ Widget phoneWidget(BuildContext context, String phone) {
|
||||
}
|
||||
|
||||
Widget fcsInput(String label, IconData iconData,
|
||||
{TextEditingController controller,
|
||||
String value,
|
||||
{required TextEditingController controller,
|
||||
required String value,
|
||||
bool autoFocus = false,
|
||||
TextInputType textInputType}) {
|
||||
TextInputType? textInputType}) {
|
||||
return TextFormField(
|
||||
initialValue: value,
|
||||
controller: controller,
|
||||
@@ -257,7 +257,7 @@ Widget fcsInput(String label, IconData iconData,
|
||||
}
|
||||
|
||||
Widget fcsInputReadOnly(String label, IconData iconData,
|
||||
{TextEditingController controller, String value}) {
|
||||
{required TextEditingController controller, required String value}) {
|
||||
return TextFormField(
|
||||
initialValue: value,
|
||||
controller: controller,
|
||||
@@ -279,7 +279,7 @@ Widget fcsInputReadOnly(String label, IconData iconData,
|
||||
}
|
||||
|
||||
Widget fcsDropDown(String label, IconData iconData,
|
||||
{TextEditingController controller}) {
|
||||
{required TextEditingController controller}) {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
@@ -308,7 +308,7 @@ Widget _dropDown() {
|
||||
height: 2,
|
||||
color: primaryColor,
|
||||
),
|
||||
onChanged: (String newValue) {},
|
||||
onChanged: (String? newValue) {},
|
||||
items: <String>['Ko Nge', 'Two', 'Free', 'Four']
|
||||
.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
@@ -320,7 +320,7 @@ Widget _dropDown() {
|
||||
}
|
||||
|
||||
Widget fcsButton(BuildContext context, String text,
|
||||
{Function callack, IconData iconData}) {
|
||||
{Function? callack, IconData? iconData}) {
|
||||
var languageModel = Provider.of<LanguageModel>(context);
|
||||
|
||||
var style = languageModel.isEng
|
||||
@@ -344,7 +344,7 @@ Widget fcsButton(BuildContext context, String text,
|
||||
minWidth: 900.0,
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: callack,
|
||||
onPressed: callack == null ? null : () => callack(),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@@ -371,7 +371,7 @@ String getLocalString(BuildContext context, String key) {
|
||||
}
|
||||
|
||||
void showToast(GlobalKey key, String text) {
|
||||
final ScaffoldState scaffold = key.currentState;
|
||||
final ScaffoldState scaffold = key.currentState as ScaffoldState;
|
||||
scaffold.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(text),
|
||||
|
||||
Reference in New Issue
Block a user