mirror of
https://github.com/git-touch/git-touch
synced 2024-12-12 08:27:04 +01:00
refactor: check null
This commit is contained in:
parent
9b339c6cdf
commit
057bad71fe
@ -106,7 +106,7 @@ class _User extends StatelessWidget {
|
||||
CommonStyle.border,
|
||||
AntList(
|
||||
children: [
|
||||
if (isNotNullOrEmpty(p.company))
|
||||
if (p.company != null)
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.organization),
|
||||
child: TextWithAt(
|
||||
@ -117,7 +117,7 @@ class _User extends StatelessWidget {
|
||||
oneLine: true,
|
||||
),
|
||||
),
|
||||
if (isNotNullOrEmpty(p.location))
|
||||
if (p.location != null)
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.location),
|
||||
child: Text(p.location!),
|
||||
@ -125,7 +125,7 @@ class _User extends StatelessWidget {
|
||||
MapsLauncher.launchQuery(p.location!);
|
||||
},
|
||||
),
|
||||
if (isNotNullOrEmpty(p.email))
|
||||
if (p.email.isNotEmpty)
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.mail),
|
||||
child: Text(p.email),
|
||||
@ -133,7 +133,7 @@ class _User extends StatelessWidget {
|
||||
launchStringUrl('mailto:${p.email}');
|
||||
},
|
||||
),
|
||||
if (isNotNullOrEmpty(p.websiteUrl))
|
||||
if (p.websiteUrl != null)
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.link),
|
||||
child: Text(p.websiteUrl!),
|
||||
@ -331,7 +331,7 @@ class GhUserScreen extends StatelessWidget {
|
||||
),
|
||||
AntList(
|
||||
children: [
|
||||
if (isNotNullOrEmpty(p.location))
|
||||
if (p.location != null)
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.location),
|
||||
child: Text(p.location!),
|
||||
@ -340,7 +340,7 @@ class GhUserScreen extends StatelessWidget {
|
||||
'https://www.google.com/maps/place/${p.location!.replaceAll(RegExp(r'\s+'), '')}');
|
||||
},
|
||||
),
|
||||
if (isNotNullOrEmpty(p.email))
|
||||
if (p.email != null)
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.mail),
|
||||
child: Text(p.email!),
|
||||
@ -348,7 +348,7 @@ class GhUserScreen extends StatelessWidget {
|
||||
launchStringUrl('mailto:${p.email!}');
|
||||
},
|
||||
),
|
||||
if (isNotNullOrEmpty(p.websiteUrl))
|
||||
if (p.websiteUrl != null)
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.link),
|
||||
child: Text(p.websiteUrl!),
|
||||
|
@ -108,10 +108,6 @@ List<T> joinAll<T>(T seperator, List<List<T>> xss) {
|
||||
|
||||
final numberFormat = NumberFormat();
|
||||
|
||||
bool isNotNullOrEmpty(String? text) {
|
||||
return text != null && text.isNotEmpty;
|
||||
}
|
||||
|
||||
Future<void> launchStringUrl(String? url) async {
|
||||
if (url == null) return;
|
||||
|
||||
|
@ -18,7 +18,7 @@ class GhBioWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (isNotNullOrEmpty(location)) {
|
||||
if (location != null) {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
|
Loading…
Reference in New Issue
Block a user