Merge branch 'main' into copyeditting
This commit is contained in:
commit
763a6d425a
11 changed files with 68 additions and 59 deletions
|
|
@ -4016,9 +4016,9 @@
|
|||
"conversationBotModeSelectOption_storyGame": "Story Game",
|
||||
"conversationBotDiscussionZone_title": "Discussion Settings",
|
||||
"conversationBotDiscussionZone_discussionTopicLabel": "Discussion Topic",
|
||||
"conversationBotDiscussionZone_discussionTopicPlaceholder": "Set Discussion Topic",
|
||||
"conversationBotDiscussionZone_discussionTopicPlaceholder": "Set discussion topic",
|
||||
"conversationBotDiscussionZone_discussionKeywordsLabel": "Discussion Keywords",
|
||||
"conversationBotDiscussionZone_discussionKeywordsPlaceholder": "Set Discussion Keywords",
|
||||
"conversationBotDiscussionZone_discussionKeywordsPlaceholder": "Set discussion keywords",
|
||||
"conversationBotDiscussionZone_discussionKeywordsHintText": "Comma separated list of keywords to guide the discussion",
|
||||
"conversationBotDiscussionZone_discussionTriggerScheduleEnabledLabel": "Send discussion prompt on a schedule",
|
||||
"conversationBotDiscussionZone_discussionTriggerScheduleHourIntervalLabel": "Hours between discussion prompts",
|
||||
|
|
@ -4364,5 +4364,6 @@
|
|||
"selectBotLanguage": "Select bot language",
|
||||
"chooseVoice": "Choose a voice",
|
||||
"enterLanguageLevel": "Please enter a language level",
|
||||
"enterDiscussionTopic": "Please enter a discussion topic"
|
||||
"enterDiscussionTopic": "Please enter a discussion topic",
|
||||
"selectBotChatMode": "Select chat mode"
|
||||
}
|
||||
|
|
@ -49,9 +49,11 @@ class MissingVoiceButton extends StatelessWidget {
|
|||
),
|
||||
TextButton(
|
||||
onPressed: () => launchTTSSettings,
|
||||
style: const ButtonStyle(
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
// commenting out as suspecting this is causing an issue
|
||||
// #freeze-activity
|
||||
// style: const ButtonStyle(
|
||||
// tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
// ),
|
||||
child: Text(L10n.of(context)!.openVoiceSettings),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ class ConversationBotModeDynamicZone extends StatelessWidget {
|
|||
decoration: InputDecoration(
|
||||
hintText: L10n.of(context)!
|
||||
.conversationBotDiscussionZone_discussionTopicPlaceholder,
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 28.0, vertical: 12.0),
|
||||
),
|
||||
controller: discussionTopicController,
|
||||
validator: (value) => enabled &&
|
||||
|
|
@ -44,6 +46,7 @@ class ConversationBotModeDynamicZone extends StatelessWidget {
|
|||
decoration: InputDecoration(
|
||||
hintText: L10n.of(context)!
|
||||
.conversationBotDiscussionZone_discussionKeywordsPlaceholder,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 28.0),
|
||||
),
|
||||
controller: discussionKeywordsController,
|
||||
enabled: enabled,
|
||||
|
|
@ -58,6 +61,7 @@ class ConversationBotModeDynamicZone extends StatelessWidget {
|
|||
decoration: InputDecoration(
|
||||
hintText: L10n.of(context)!
|
||||
.conversationBotCustomZone_customSystemPromptPlaceholder,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 28.0),
|
||||
),
|
||||
validator: (value) => enabled &&
|
||||
botOptions.mode == BotMode.custom &&
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:fluffychat/pangea/constants/bot_mode.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
|
@ -26,23 +27,8 @@ class ConversationBotModeSelect extends StatelessWidget {
|
|||
// L10n.of(context)!.conversationBotModeSelectOption_storyGame,
|
||||
};
|
||||
|
||||
String? mode = initialMode;
|
||||
if (!options.containsKey(initialMode)) {
|
||||
mode = null;
|
||||
}
|
||||
|
||||
return DropdownButtonFormField(
|
||||
// Initial Value
|
||||
hint: Text(
|
||||
options[mode ?? BotMode.discussion]!,
|
||||
overflow: TextOverflow.clip,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
// ),
|
||||
isExpanded: true,
|
||||
// Down Arrow Icon
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
// Array list of items
|
||||
return DropdownButtonFormField2(
|
||||
hint: Text(L10n.of(context)!.selectBotChatMode),
|
||||
items: [
|
||||
for (final entry in options.entries)
|
||||
DropdownMenuItem(
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:fluffychat/pangea/models/bot_options_model.dart';
|
||||
import 'package:fluffychat/pangea/widgets/conversation_bot/conversation_bot_mode_dynamic_zone.dart';
|
||||
import 'package:fluffychat/pangea/widgets/conversation_bot/conversation_bot_mode_select.dart';
|
||||
|
|
@ -36,8 +37,10 @@ class ConversationBotSettingsForm extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
DropdownButtonFormField(
|
||||
// Initial Value
|
||||
DropdownButtonFormField2(
|
||||
dropdownStyleData: const DropdownStyleData(
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
hint: Text(
|
||||
L10n.of(context)!.selectBotLanguage,
|
||||
overflow: TextOverflow.clip,
|
||||
|
|
@ -45,7 +48,6 @@ class ConversationBotSettingsForm extends StatelessWidget {
|
|||
),
|
||||
value: botOptions.targetLanguage,
|
||||
isExpanded: true,
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
items: MatrixState.pangeaController.pLanguageStore.targetOptions
|
||||
.map((language) {
|
||||
return DropdownMenuItem(
|
||||
|
|
@ -60,8 +62,7 @@ class ConversationBotSettingsForm extends StatelessWidget {
|
|||
onChanged: enabled ? onUpdateBotLanguage : null,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
DropdownButtonFormField<String>(
|
||||
// Initial Value
|
||||
DropdownButtonFormField2<String>(
|
||||
hint: Text(
|
||||
L10n.of(context)!.chooseVoice,
|
||||
overflow: TextOverflow.clip,
|
||||
|
|
@ -69,7 +70,6 @@ class ConversationBotSettingsForm extends StatelessWidget {
|
|||
),
|
||||
value: botOptions.targetVoice,
|
||||
isExpanded: true,
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
items: const [],
|
||||
onChanged: enabled ? onUpdateBotVoice : null,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@ import 'dart:developer';
|
|||
import 'package:collection/collection.dart';
|
||||
import 'package:fluffychat/pangea/choreographer/widgets/choice_array.dart';
|
||||
import 'package:fluffychat/pangea/controllers/my_analytics_controller.dart';
|
||||
import 'package:fluffychat/pangea/enum/activity_type_enum.dart';
|
||||
import 'package:fluffychat/pangea/models/practice_activities.dart/practice_activity_model.dart';
|
||||
import 'package:fluffychat/pangea/models/practice_activities.dart/practice_activity_record_model.dart';
|
||||
import 'package:fluffychat/pangea/widgets/practice_activity/practice_activity_card.dart';
|
||||
import 'package:fluffychat/pangea/widgets/practice_activity/word_audio_button.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -85,9 +83,11 @@ class MultipleChoiceActivityState extends State<MultipleChoiceActivity> {
|
|||
widget.practiceCardController.onActivityFinish();
|
||||
}
|
||||
|
||||
setState(
|
||||
() => selectedChoiceIndex = index,
|
||||
);
|
||||
if (mounted) {
|
||||
setState(
|
||||
() => selectedChoiceIndex = index,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -106,9 +106,10 @@ class MultipleChoiceActivityState extends State<MultipleChoiceActivity> {
|
|||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (practiceActivity.activityType ==
|
||||
ActivityTypeEnum.wordFocusListening)
|
||||
WordAudioButton(text: practiceActivity.content.answer),
|
||||
// #freeze-activity
|
||||
// if (practiceActivity.activityType ==
|
||||
// ActivityTypeEnum.wordFocusListening)
|
||||
// WordAudioButton(text: practiceActivity.content.answer),
|
||||
ChoicesArray(
|
||||
isLoading: false,
|
||||
uniqueKeyForLayerLink: (index) => "multiple_choice_$index",
|
||||
|
|
|
|||
|
|
@ -175,13 +175,26 @@ class MessagePracticeActivityCardState extends State<PracticeActivityCard> {
|
|||
);
|
||||
|
||||
Future<void> _savorTheJoy() async {
|
||||
debugger(when: savoringTheJoy && kDebugMode);
|
||||
try {
|
||||
debugger(when: savoringTheJoy && kDebugMode);
|
||||
|
||||
if (mounted) setState(() => savoringTheJoy = true);
|
||||
if (mounted) setState(() => savoringTheJoy = true);
|
||||
|
||||
await Future.delayed(appropriateTimeForJoy);
|
||||
await Future.delayed(appropriateTimeForJoy);
|
||||
|
||||
if (mounted) setState(() => savoringTheJoy = false);
|
||||
if (mounted) setState(() => savoringTheJoy = false);
|
||||
} catch (e, s) {
|
||||
debugger(when: kDebugMode);
|
||||
ErrorHandler.logError(
|
||||
e: e,
|
||||
s: s,
|
||||
m: 'Failed to savor the joy',
|
||||
data: {
|
||||
'activity': currentActivity,
|
||||
'record': currentCompletionRecord,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Called when the user finishes an activity.
|
||||
|
|
@ -211,7 +224,8 @@ class MessagePracticeActivityCardState extends State<PracticeActivityCard> {
|
|||
widget.pangeaMessageEvent.eventId,
|
||||
);
|
||||
|
||||
//
|
||||
// wait for the joy to be savored before resolving the activity
|
||||
// and setting it to replace the previous activity
|
||||
final Iterable<dynamic> result = await Future.wait([
|
||||
_savorTheJoy(),
|
||||
_fetchNewActivity(),
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class WordAudioButtonState extends State<WordAudioButton> {
|
|||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
debugPrint('initState WordAudioButton');
|
||||
super.initState();
|
||||
ttsController.setupTTS().then((value) => setState(() {}));
|
||||
}
|
||||
|
|
@ -34,6 +35,7 @@ class WordAudioButtonState extends State<WordAudioButton> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
debugPrint('build WordAudioButton');
|
||||
return Column(
|
||||
children: [
|
||||
IconButton(
|
||||
|
|
@ -67,7 +69,9 @@ class WordAudioButtonState extends State<WordAudioButton> {
|
|||
}
|
||||
}, // Disable button if language isn't supported
|
||||
),
|
||||
ttsController.missingVoiceButton,
|
||||
// #freeze-activity
|
||||
//commenting out to see if it's causing an issue
|
||||
// ttsController.missingVoiceButton,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:fluffychat/pangea/constants/language_constants.dart';
|
||||
import 'package:fluffychat/pangea/utils/language_level_copy.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -19,18 +20,13 @@ class LanguageLevelDropdown extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DropdownButtonFormField(
|
||||
// Initial Value
|
||||
return DropdownButtonFormField2(
|
||||
hint: Text(
|
||||
L10n.of(context)!.selectLanguageLevel,
|
||||
overflow: TextOverflow.clip,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
value: initialLevel,
|
||||
isExpanded: true,
|
||||
// Down Arrow Icon
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
// Array list of items
|
||||
items: LanguageLevelType.allInts.map((int levelOption) {
|
||||
return DropdownMenuItem(
|
||||
value: levelOption,
|
||||
|
|
|
|||
18
pubspec.lock
18
pubspec.lock
|
|
@ -345,6 +345,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
dropdown_button2:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dropdown_button2
|
||||
sha256: b0fe8d49a030315e9eef6c7ac84ca964250155a6224d491c1365061bc974a9e1
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.9"
|
||||
dynamic_color:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -2642,14 +2650,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
visibility_detector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: visibility_detector
|
||||
sha256: "15c54a459ec2c17b4705450483f3d5a2858e733aee893dcee9d75fd04814940d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.3"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -2723,7 +2723,7 @@ packages:
|
|||
source: hosted
|
||||
version: "1.2.0"
|
||||
win32:
|
||||
dependency: "direct overridden"
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: "015002c060f1ae9f41a818f2d5640389cc05283e368be19dc8d77cecb43c40c9"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ description: Learn a language while texting your friends.
|
|||
# Pangea#
|
||||
publish_to: none
|
||||
# On version bump also increase the build number for F-Droid
|
||||
version: 1.21.5+3541
|
||||
version: 1.21.5+3542
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
|
@ -113,6 +113,7 @@ dependencies:
|
|||
android_intent_plus: ^5.2.0
|
||||
country_picker: ^2.0.25
|
||||
csv: ^6.0.0
|
||||
dropdown_button2: ^2.3.9
|
||||
fl_chart: ^0.67.0
|
||||
firebase_analytics: ^11.0.1
|
||||
firebase_core: ^3.1.0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue