added xp number to xp progress bar
This commit is contained in:
parent
7f651417fd
commit
d904c59d6a
2 changed files with 32 additions and 20 deletions
|
|
@ -5,12 +5,16 @@ import 'package:flutter/foundation.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
String getGrammarCopy(
|
||||
{required String category,
|
||||
required String feature,
|
||||
required BuildContext context}) {
|
||||
/// Used on morph constructs
|
||||
String getGrammarCopy({
|
||||
required String category,
|
||||
|
||||
/// This is the tag / feature
|
||||
required String lemma,
|
||||
required BuildContext context,
|
||||
}) {
|
||||
final String key =
|
||||
'grammarCopy${category.toUpperCase()}${feature.toLowerCase()}';
|
||||
'grammarCopy${category.toUpperCase()}${lemma.toLowerCase()}';
|
||||
|
||||
switch (key) {
|
||||
case 'grammarCopyPOSsconj':
|
||||
|
|
|
|||
|
|
@ -66,11 +66,8 @@ class AnalyticsPopup extends StatelessWidget {
|
|||
return Column(
|
||||
children: [
|
||||
ExpansionTile(
|
||||
title: Text(
|
||||
category.key != 'Other'
|
||||
? getGrammarCopy(category.key, context)
|
||||
: category.key,
|
||||
),
|
||||
// GABBY TODO switch back to getGrammarCopy once it's updated
|
||||
title: Text(category.key),
|
||||
children: category.value.map((constructUses) {
|
||||
return ConstructUsesXPTile(
|
||||
indicator: indicator,
|
||||
|
|
@ -127,23 +124,34 @@ class ConstructUsesXPTile extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final lemma = constructUses.lemma;
|
||||
return Tooltip(
|
||||
message: "${constructUses.points} / ${constructsModel.maxXPPerLemma}",
|
||||
child: ListTile(
|
||||
onTap: () {},
|
||||
title: Text(
|
||||
constructsModel.type == ConstructTypeEnum.morph
|
||||
? getGrammarCopy(lemma, context)
|
||||
: lemma,
|
||||
? getGrammarCopy(
|
||||
category: constructUses.category,
|
||||
lemma: constructUses.lemma,
|
||||
context: context,
|
||||
)
|
||||
: constructUses.lemma,
|
||||
),
|
||||
subtitle: LinearProgressIndicator(
|
||||
value: constructUses.points / constructsModel.maxXPPerLemma,
|
||||
minHeight: 20,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
color: indicator.color(context),
|
||||
subtitle: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: LinearProgressIndicator(
|
||||
value: constructUses.points / constructsModel.maxXPPerLemma,
|
||||
minHeight: 20,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
color: indicator.color(context),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text("${constructUses.points}xp"),
|
||||
],
|
||||
),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue