Merge branch 'main' into 871-autoplay-translation-on-by-default
This commit is contained in:
commit
61397d1228
2 changed files with 15 additions and 11 deletions
|
|
@ -105,23 +105,23 @@ extension ConstructUseTypeExtension on ConstructUseTypeEnum {
|
|||
return 2;
|
||||
|
||||
case ConstructUseTypeEnum.corIt:
|
||||
return 1;
|
||||
|
||||
case ConstructUseTypeEnum.ignIt:
|
||||
case ConstructUseTypeEnum.ignIGC:
|
||||
case ConstructUseTypeEnum.ignPA:
|
||||
case ConstructUseTypeEnum.ignWL:
|
||||
return 1;
|
||||
|
||||
case ConstructUseTypeEnum.unk:
|
||||
case ConstructUseTypeEnum.nan:
|
||||
return 0;
|
||||
|
||||
case ConstructUseTypeEnum.incIt:
|
||||
case ConstructUseTypeEnum.incIGC:
|
||||
return -1;
|
||||
return -2;
|
||||
|
||||
case ConstructUseTypeEnum.incPA:
|
||||
case ConstructUseTypeEnum.incWL:
|
||||
return -2;
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ class AnalyticsPopup extends StatelessWidget {
|
|||
super.key,
|
||||
});
|
||||
|
||||
// we just want to show the constructs that have points
|
||||
List<ConstructUses> get constructs => constructsModel.constructList
|
||||
.where((constructUse) => constructUse.points > 0)
|
||||
.toList();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
|
|
@ -36,16 +41,16 @@ class AnalyticsPopup extends StatelessWidget {
|
|||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
child: constructsModel.constructList.isEmpty
|
||||
child: constructs.isEmpty
|
||||
? Center(
|
||||
child: Text(L10n.of(context)!.noDataFound),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: constructsModel.constructList.length,
|
||||
itemCount: constructs.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Tooltip(
|
||||
message:
|
||||
"${constructsModel.constructList[index].points} / ${constructsModel.maxXPPerLemma}",
|
||||
"${constructs[index].points} / ${constructsModel.maxXPPerLemma}",
|
||||
child: ListTile(
|
||||
onTap: () {},
|
||||
title: Text(
|
||||
|
|
@ -55,12 +60,11 @@ class AnalyticsPopup extends StatelessWidget {
|
|||
.constructList[index].lemma,
|
||||
context,
|
||||
)
|
||||
: constructsModel.constructList[index].lemma,
|
||||
: constructs[index].lemma,
|
||||
),
|
||||
subtitle: LinearProgressIndicator(
|
||||
value:
|
||||
constructsModel.constructList[index].points /
|
||||
constructsModel.maxXPPerLemma,
|
||||
value: constructs[index].points /
|
||||
constructsModel.maxXPPerLemma,
|
||||
minHeight: 20,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(AppConfig.borderRadius),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue