null safety

This commit is contained in:
phyothandar
2021-09-10 12:00:08 +06:30
parent a144c945b6
commit 5e672937b5
67 changed files with 901 additions and 896 deletions

View File

@@ -6,16 +6,16 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class DisplayText extends StatelessWidget {
final String text;
final String labelTextKey;
final IconData iconData;
final int maxLines;
final bool withBorder;
final Color borderColor;
final Widget icon;
final String? text;
final String? labelTextKey;
final IconData? iconData;
final int? maxLines;
final bool? withBorder;
final Color? borderColor;
final Widget? icon;
const DisplayText({
Key key,
Key? key,
this.text,
this.labelTextKey,
this.iconData,
@@ -44,7 +44,9 @@ class DisplayText extends StatelessWidget {
child: Row(
children: [
iconData == null
? icon == null ? Container() : icon
? icon == null
? Container()
: icon!
: Padding(
padding: const EdgeInsets.only(
left: .0, right: 15.0, top: 8.0, bottom: 8.0),
@@ -60,13 +62,13 @@ class DisplayText extends StatelessWidget {
labelTextKey == null
? Container()
: Text(
AppTranslations.of(context).text(labelTextKey),
AppTranslations.of(context).text(labelTextKey!),
style: labelStyle,
),
text == null
? Container()
: Text(
text,
text!,
style: textStyle,
),
],