Reputation: 9
child: Text(
title,
style: TextStyle(color : Colors.grey[700], decoration: _enabledMap[title] == true ? TextDecoration.lineThrough)
),
Hi there, I am new to coding and I need help, please can you show me where I'm going wrong
Upvotes: 0
Views: 31
Reputation: 63864
You are providing data only for _enabledMap[title] == true
. But you also need to provide when data is false for ternary case. You can provide null if you don't like to pass any TextDecoration
decoration: _enabledMap[title] == true
? TextDecoration.lineThrough
: null
For more info, see the Dart docs on conditional expressions
Upvotes: 1