null safety

This commit is contained in:
phyothandar
2021-09-10 14:25:37 +06:30
parent 5a313d641e
commit 079c9a135d
31 changed files with 230 additions and 227 deletions

View File

@@ -6,20 +6,20 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class InputText extends StatelessWidget {
final String labelTextKey;
final IconData iconData;
final TextEditingController controller;
final FormFieldValidator<String> validator;
final String? labelTextKey;
final IconData? iconData;
final TextEditingController? controller;
final FormFieldValidator<String>? validator;
final int maxLines;
final bool withBorder;
final Color borderColor;
final TextInputType textInputType;
final Color? borderColor;
final TextInputType? textInputType;
final bool autoFocus;
final TextAlign textAlign;
final bool enabled;
const InputText(
{Key key,
{Key? key,
this.labelTextKey,
this.iconData,
this.controller,
@@ -30,7 +30,7 @@ class InputText extends StatelessWidget {
this.autoFocus = false,
this.textInputType,
this.enabled = true,
this.textAlign})
this.textAlign = TextAlign.start})
: super(key: key);
@override
Widget build(BuildContext context) {
@@ -46,7 +46,7 @@ class InputText extends StatelessWidget {
style: textStyle,
maxLines: maxLines,
keyboardType: textInputType,
textAlign: textAlign ?? TextAlign.start,
textAlign: textAlign,
decoration: new InputDecoration(
// hintText: '',
hintStyle: TextStyle(
@@ -54,7 +54,7 @@ class InputText extends StatelessWidget {
),
labelText: labelTextKey == null
? null
: AppTranslations.of(context).text(labelTextKey),
: AppTranslations.of(context)!.text(labelTextKey!),
labelStyle: languageModel.isEng
? newLabelStyle(color: Colors.black54, fontSize: 20)
: newLabelStyleMM(color: Colors.black54, fontSize: 20),