commenting out audio button in debug attempt
This commit is contained in:
parent
199c1ce655
commit
dfe1ca6653
5 changed files with 39 additions and 18 deletions
|
|
@ -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),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue