fix: disable activity flag button once activity complete (#5846)
This commit is contained in:
parent
4eca61d216
commit
93867e1faa
1 changed files with 17 additions and 8 deletions
|
|
@ -42,14 +42,23 @@ class OngoingActivitySessionView extends StatelessWidget {
|
|||
Expanded(
|
||||
child: ListView(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.flag_outlined),
|
||||
onPressed: activity != null
|
||||
? () => controller.flagActivity(activity)
|
||||
: null,
|
||||
),
|
||||
ListenableBuilder(
|
||||
listenable: controller.notifier,
|
||||
builder: (context, _) {
|
||||
final enabled =
|
||||
activity != null &&
|
||||
!controller.notifier.activityComplete(activity);
|
||||
|
||||
return Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.flag_outlined),
|
||||
onPressed: enabled
|
||||
? () => controller.flagActivity(activity)
|
||||
: null,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
//Hints counter bar for grammar activities only
|
||||
if (controller.widget.type == ConstructTypeEnum.morph)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue