Skip to content

Commit

Permalink
Merge pull request #413 from totem-technologies/ansell_issue_400
Browse files Browse the repository at this point in the history
Issue #400
  • Loading branch information
ansells authored Dec 1, 2022
2 parents 24854b1 + 3d28516 commit 5220151
Show file tree
Hide file tree
Showing 9 changed files with 410 additions and 52 deletions.
4 changes: 4 additions & 0 deletions i18n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"@@locale": "en",
"aboutYou": "About You",
"acceptGuidelines": "Accept Guidelines",
"addMoreTime": "Add more time",
"addProfilePicture": "Add a profile picture",
"admin": "Admin",
"ageMissing": "Age verification",
Expand Down Expand Up @@ -112,6 +113,7 @@
"endDateRequired": "End date is required",
"endDateMustBeAfterStartDate": "End date must be after start date",
"ending": "ending",
"endNow": "End Now",
"endSession": "End Circle",
"endSessionPrompt": "End Circle?",
"endSessionPromptMessage": "Are you sure you want to end this session?",
Expand Down Expand Up @@ -204,6 +206,7 @@
"introScreenTitle4": "Let's Begin!",
"introScreenMessage4": "Please find a quiet place where you are unlikely to be distracted.\\\nAlways speak from your own **experience**, try to not offer advice.\\\nIt helps to disable all notifications and put everything on silent.\\\n**Enjoy** this rare opportunity to be heard without interruption.",
"instantSession": "Instant Session",
"invalidNumber": "Invalid number",
"joinCircle": "Join Circle",
"joinCircleMessage": "Welcome! Before you enter the waiting room, please check that your audio and video are working as intended.",
"joiningCircle": "Joining Circle",
Expand Down Expand Up @@ -231,6 +234,7 @@
"mins": {}
}
},
"modifyTime": "Modify Time",
"month": "Month",
"monthly": "Monthly",
"months": "Months",
Expand Down
128 changes: 78 additions & 50 deletions lib/app/circle/components/circle_live_video_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:keybinder/keybinder.dart';
import 'package:lucide_icons/lucide_icons.dart';
import 'package:slide_to_act/slide_to_act.dart';
import 'package:totem/app/circle/components/circle_session_timer.dart';
import 'package:totem/app/circle/index.dart';
import 'package:totem/components/widgets/index.dart';
import 'package:totem/models/index.dart';
Expand Down Expand Up @@ -104,10 +105,7 @@ class _CircleLiveVideoSessionState
),
),
),
if (activeSession.expiresOn != null) ...[
_countdownTimer(activeSession),
const SizedBox(width: 40)
],
const CircleSessionTimer(),
],
),
const SizedBox(height: 10),
Expand Down Expand Up @@ -194,53 +192,83 @@ class _CircleLiveVideoSessionState
return Container();
}

Widget _countdownTimer(ActiveSession activeSession) {
final t = AppLocalizations.of(context)!;
final themeData = Theme.of(context);
final themeColors = themeData.themeColors;
// List<Widget> _countdownTimer(ActiveSession activeSession) {
// final t = AppLocalizations.of(context)!;
// final themeData = Theme.of(context);
// final themeColors = themeData.themeColors;

SessionParticipant? participant = activeSession.me();
if (participant != null) {
return CountdownTimer(
startTime: activeSession.startedOn!,
endTime: activeSession.expiresOn!,
defaultState: CountdownState(
displayValue: participant.role == Role.keeper,
displayFormat: CountdownDisplayFormat.hoursAndMinutes,
color: themeColors.primary,
backgroundColor: themeColors.secondaryText,
valueLabel: t.remaining,
),
stateTransitions: [
CountdownState(
minutesRemaining: 5,
displayValue: true,
displayFormat: CountdownDisplayFormat.minutes,
color: themeColors.reversedText,
valueLabel: t.endsIn,
),
CountdownState(
minutesRemaining: 0,
displayValue: true,
displayFormat: CountdownDisplayFormat.override,
color: themeColors.alertBackground,
backgroundColor: themeColors.alertBackground,
valueLabel: t.ending,
valueOverride: t.now,
),
CountdownState(
minutesRemaining: -1,
displayValue: true,
displayFormat: CountdownDisplayFormat.hoursAndMinutes,
color: themeColors.alertBackground,
valueLabel: t.overtime,
),
],
);
} else {
return Container();
}
}
// SessionParticipant? participant = activeSession.me();
// if (participant != null) {
// return [
// CountdownTimer(
// startTime: activeSession.startedOn!,
// endTime: activeSession.expiresOn!,
// defaultState: CountdownState(
// displayValue: participant.role == Role.keeper,
// displayFormat: CountdownDisplayFormat.hoursAndMinutes,
// color: themeColors.primary,
// backgroundColor: themeColors.secondaryText,
// valueLabel: t.remaining,
// ),
// stateTransitions: [
// CountdownState(
// minutesRemaining: 5,
// displayValue: true,
// displayFormat: CountdownDisplayFormat.minutes,
// color: themeColors.reversedText,
// valueLabel: t.endsIn,
// ),
// CountdownState(
// minutesRemaining: 0,
// displayValue: true,
// displayFormat: CountdownDisplayFormat.override,
// color: themeColors.alertBackground,
// backgroundColor: themeColors.alertBackground,
// valueLabel: t.ending,
// valueOverride: t.now,
// ),
// CountdownState(
// minutesRemaining: -1,
// displayValue: true,
// displayFormat: CountdownDisplayFormat.hoursAndMinutes,
// color: themeColors.alertBackground,
// valueLabel: t.overtime,
// ),
// ],
// ),
// if (participant.role == Role.keeper) ...[
// const SizedBox(
// width: 10,
// ),
// PopupMenuButton(
// itemBuilder: (context) => [
// if (DateTime.now().compareTo(activeSession.expiresOn!) <= 0)
// PopupMenuItem(
// value: 0,
// child: Text(t.endSession),
// ),
// if (DateTime.now().compareTo(activeSession.expiresOn!) > 0)
// PopupMenuItem(
// value: 1,
// child: Text(t.modifyTime),
// ),
// ],
// onSelected: (value) {
// if (value == 0) {
// _endSession(context);
// } else if (value == 1) {
// _modifyTime(context);
// }
// },
// },
// ),
// ],
// const SizedBox(width: 40)
// ];
// } else {
// return [];
// }
// }

Widget _speakerUserView(BuildContext context,
{required ActiveSession activeSession, required bool isPhoneLayout}) {
Expand Down
Loading

0 comments on commit 5220151

Please sign in to comment.