Skip to content

Commit

Permalink
fix #157 null check operator used on a null value in _CardTileWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
mediocre9 committed Apr 22, 2024
1 parent 39b2288 commit e7f335f
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions lib/screens/bluetooth_home_screen/widgets/devices_list_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,34 @@ class _CardTileWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Card(
child: ListTile(
tileColor: device.isBonded
? AppColors.pairedCard
: AppColors.discoveredCard,
enableFeedback: true,
title: Text(device.name!,
style: Theme.of(context).textTheme.titleMedium),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Type: ${device.type.stringValue}',
style: Theme.of(context).textTheme.labelMedium),
Text('Bonded: ${device.isBonded ? "Yes" : "No"}',
style: Theme.of(context).textTheme.labelMedium),
Text('MAC: ${device.address}',
style: Theme.of(context).textTheme.labelMedium),
],
),
onTap: onPressed))
child: ListTile(
tileColor:
device.isBonded ? AppColors.pairedCard : AppColors.discoveredCard,
enableFeedback: true,
title: Text(
device.name ?? "Unknown",
style: Theme.of(context).textTheme.titleMedium,
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'Type: ${device.type.stringValue}',
style: Theme.of(context).textTheme.labelMedium,
),
Text(
'Bonded: ${device.isBonded ? "Yes" : "No"}',
style: Theme.of(context).textTheme.labelMedium,
),
Text(
'MAC: ${device.address}',
style: Theme.of(context).textTheme.labelMedium,
),
],
),
onTap: onPressed),
)
.animate()
.fadeIn(duration: 600.ms)
.slide(curve: Curves.easeInOut, begin: const Offset(-1, 0));
Expand Down

0 comments on commit e7f335f

Please sign in to comment.