chore: set vocab as default analytics page content
This commit is contained in:
parent
a7e1953b87
commit
312dc269ff
4 changed files with 97 additions and 100 deletions
|
|
@ -202,15 +202,17 @@ class AnalyticsPopupWrapperState extends State<AnalyticsPopupWrapper> {
|
|||
if (kIsWeb) const SizedBox(width: 4.0),
|
||||
],
|
||||
)
|
||||
: AppBar(
|
||||
leading: widget.backButtonOverride ??
|
||||
(localConstructZoom != null
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () => setConstructZoom(null),
|
||||
)
|
||||
: const SizedBox()),
|
||||
),
|
||||
: localConstructZoom != null
|
||||
? AppBar(
|
||||
leading: widget.backButtonOverride ??
|
||||
(localConstructZoom != null
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () => setConstructZoom(null),
|
||||
)
|
||||
: const SizedBox()),
|
||||
)
|
||||
: null,
|
||||
body: localView == ConstructTypeEnum.morph
|
||||
? localConstructZoom == null
|
||||
? MorphAnalyticsListView(controller: this)
|
||||
|
|
|
|||
|
|
@ -227,18 +227,22 @@ class MorphTagChip extends StatelessWidget {
|
|||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
getGrammarCopy(
|
||||
category: morphFeature,
|
||||
lemma: morphTag,
|
||||
context: context,
|
||||
) ??
|
||||
morphTag,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.brightness == Brightness.dark
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
Flexible(
|
||||
child: Text(
|
||||
getGrammarCopy(
|
||||
category: morphFeature,
|
||||
lemma: morphTag,
|
||||
context: context,
|
||||
) ??
|
||||
morphTag,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.brightness == Brightness.dark
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:collection/collection.dart';
|
||||
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/pangea/analytics_details_popup/analytics_details_popup.dart';
|
||||
import 'package:fluffychat/pangea/analytics_details_popup/vocab_analytics_list_tile.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/construct_type_enum.dart';
|
||||
|
|
@ -78,92 +79,82 @@ class VocabAnalyticsListView extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const InstructionsInlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.analyticsVocabList,
|
||||
return Column(
|
||||
children: [
|
||||
const InstructionsInlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.analyticsVocabList,
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: controller.isSearching ? 8.0 : 24.0,
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: controller.isSearching ? 8.0 : 24.0,
|
||||
),
|
||||
child: Container(
|
||||
height: 60,
|
||||
alignment: Alignment.center,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 250.0),
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
transitionBuilder: (child, animation) => FadeTransition(
|
||||
opacity: animation,
|
||||
child: child,
|
||||
),
|
||||
child: controller.isSearching
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
key: const ValueKey('search'),
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
autofocus: true,
|
||||
controller: controller.searchController,
|
||||
decoration: const InputDecoration(
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
isDense: true,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: controller.toggleSearching,
|
||||
),
|
||||
],
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
key: const ValueKey('filters'),
|
||||
children: filters,
|
||||
child: Container(
|
||||
height: 60,
|
||||
alignment: Alignment.center,
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
transitionBuilder: (child, animation) => FadeTransition(
|
||||
opacity: animation,
|
||||
child: child,
|
||||
),
|
||||
child: controller.isSearching
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
key: const ValueKey('search'),
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
autofocus: true,
|
||||
controller: controller.searchController,
|
||||
decoration: const InputDecoration(
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
isDense: true,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: controller.toggleSearching,
|
||||
),
|
||||
],
|
||||
)
|
||||
: Row(
|
||||
spacing: FluffyThemes.isColumnMode(context) ? 16.0 : 4.0,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
key: const ValueKey('filters'),
|
||||
children: filters,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: GridView.builder(
|
||||
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: 100.0,
|
||||
mainAxisExtent: 100.0,
|
||||
crossAxisSpacing: 8.0,
|
||||
mainAxisSpacing: 8.0,
|
||||
),
|
||||
itemCount: _filteredVocab.length,
|
||||
itemBuilder: (context, index) {
|
||||
final vocabItem = _filteredVocab[index];
|
||||
return VocabAnalyticsListTile(
|
||||
onTap: () => controller.setConstructZoom(vocabItem.id),
|
||||
constructUse: vocabItem,
|
||||
);
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: GridView.builder(
|
||||
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: 100.0,
|
||||
mainAxisExtent: 100.0,
|
||||
crossAxisSpacing: 8.0,
|
||||
mainAxisSpacing: 8.0,
|
||||
),
|
||||
itemCount: _filteredVocab.length,
|
||||
itemBuilder: (context, index) {
|
||||
final vocabItem = _filteredVocab[index];
|
||||
return VocabAnalyticsListTile(
|
||||
onTap: () => controller.setConstructZoom(vocabItem.id),
|
||||
constructUse: vocabItem,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class AnalyticsPage extends StatefulWidget {
|
|||
}
|
||||
|
||||
class AnalyticsPageState extends State<AnalyticsPage> {
|
||||
ProgressIndicatorEnum? selectedIndicator = ProgressIndicatorEnum.level;
|
||||
ProgressIndicatorEnum? selectedIndicator = ProgressIndicatorEnum.wordsUsed;
|
||||
|
||||
void onIndicatorSelected(ProgressIndicatorEnum indicator) => setState(() {
|
||||
selectedIndicator = indicator;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue