Skip to content

Commit a4fe4af

Browse files
committed
wip
1 parent 0b7ce7e commit a4fe4af

File tree

5 files changed

+16
-35
lines changed

5 files changed

+16
-35
lines changed

firebase.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131
"ui": {
3232
"enabled": true
3333
},
34-
"singleProjectMode": true,
35-
"storage": {
36-
"port": 9199
37-
}
34+
"singleProjectMode": true
3835
},
3936
"remoteconfig": {
4037
"template": "remoteconfig.template.json"

lib/screens/main/chat.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class _ChatScreenState extends State<ChatScreen> {
104104
return [
105105
// Message(Role.ast,
106106
// "Then, hold the walkie-talkie button to speak. Let go when you're done speaking. You should feel your phone vibrate when the recording starts."),
107-
Message(Role.ast, "Press the call button to get started."),
107+
Message(Role.ast, "Press that button to get started."),
108108
Message(Role.ast, "Would you like to practice ${widget.languages[widget.profile.lang]['language']['name']}?"),
109109
Message(Role.ast, "Hello, ${widget.profile.name}."),
110110
];
@@ -461,6 +461,7 @@ class _ChatScreenState extends State<ChatScreen> {
461461
loadingBar = LinearProgressIndicator(
462462
value: progressValue,
463463
minHeight: loadingHeight,
464+
color: Theme.of(context).colorScheme.tertiary,
464465
);
465466
} else if (callStatus == CallStatus.ringing || serverStatus == ServerStatus.pending) {
466467
loadingBar = LinearProgressIndicator(minHeight: loadingHeight);
@@ -481,9 +482,9 @@ class _ChatScreenState extends State<ChatScreen> {
481482
return Column(children: [
482483
_progressBar(context),
483484
Row(children: [
484-
Expanded(flex: 2, child: SizedBox()),
485+
Expanded(flex: 7, child: SizedBox()),
485486
Expanded(
486-
flex: 3,
487+
flex: 2,
487488
child: ConnectionStatus(
488489
micStatus: micStatus,
489490
serverStatus: serverStatus,
@@ -557,7 +558,7 @@ class _ChatScreenState extends State<ChatScreen> {
557558
backgroundColor: {
558559
CallStatus.idle: Theme.of(context).colorScheme.tertiary,
559560
CallStatus.ringing: Theme.of(context).colorScheme.onSurface,
560-
CallStatus.inCall: Theme.of(context).colorScheme.primary,
561+
CallStatus.inCall: Theme.of(context).colorScheme.secondary,
561562
CallStatus.error: Theme.of(context).colorScheme.tertiary,
562563
}[callStatus],
563564
icon: Icon(

lib/screens/main/feed.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ class _FeedScreenState extends State<FeedScreen> {
9494

9595
@override
9696
void dispose() {
97+
super.dispose();
9798
_globalFeedListener.cancel();
9899
_feedListener.cancel();
99100
_userFeed.clear();
100-
super.dispose();
101+
_globalFeed.clear();
102+
_globalRead.clear();
101103
}
102104

103105
void _addToUserFeed(Map<String, Item> userFeed, Map<String, bool> globalRead) {

lib/types.dart

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,19 @@ class NullDataError implements Exception {
1414
}
1515

1616
class Activity {
17-
String id;
1817
String title;
1918
String type;
2019
String name;
21-
String? language;
22-
List<Map<String, dynamic>>? goals;
23-
String? userPrompt;
24-
int? level;
20+
int level;
2521

26-
Activity(
27-
{required this.id,
28-
required this.title,
29-
required this.type,
30-
required this.name,
31-
this.language,
32-
this.userPrompt,
33-
this.goals,
34-
this.level});
22+
Activity({required this.title, required this.type, required this.name, required this.level});
3523

3624
factory Activity.fromDocumentSnapshot(DocumentSnapshot snapshot) {
3725
Map<String, dynamic>? data = snapshot.data() as Map<String, dynamic>?;
3826
if (data == null) {
3927
throw NullDataError("Activity.fromDocumentSnapshot: data is null: ${snapshot.id}");
4028
}
4129
print('Activity.data: $data');
42-
// TODO parse goals, requires Goals class {title: string, criteria: list[{body: string, points: int > 0}]}
43-
List<Map<String, dynamic>> goals = [];
4430
String? name;
4531
if (data['type'] == 'lesson') {
4632
name = snapshot['config']['topic'];
@@ -49,17 +35,11 @@ class Activity {
4935
} else {
5036
throw Exception("Activity.fromDocumentSnapshot: unknown activity type: ${snapshot.id}");
5137
}
52-
String? userPrompt = data.containsKey('user_prompt') ? snapshot['user_prompt'] : null;
53-
int? level = data.containsKey('level') ? snapshot['level'] : null;
5438
final Activity act = Activity(
55-
id: snapshot.id,
56-
language: snapshot['language'],
57-
title: snapshot['title'],
39+
title: snapshot['translations']['en-US']['title'],
5840
type: snapshot['type'],
5941
name: name!,
60-
goals: goals,
61-
userPrompt: userPrompt,
62-
level: level);
42+
level: snapshot['config']['level']);
6343
return act;
6444
}
6545
}

lib/widgets/status.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ class ConnectionStatus extends StatelessWidget {
5050
// print('serverStatus: $serverStatus');
5151
// print('callStatus: $callStatus');
5252
return Row(
53-
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
54-
children: [_micIcon(micStatus), _serverIcon(serverStatus), _callIcon(callStatus)],
53+
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
54+
mainAxisAlignment: MainAxisAlignment.spaceAround,
55+
children: [_micIcon(micStatus), _serverIcon(serverStatus)], //, _callIcon(callStatus)],
5556
);
5657
}
5758
}

0 commit comments

Comments
 (0)