null safety
This commit is contained in:
@@ -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,
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user