-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1719 from 100mslive/FLUT-239
Added option to view ended polls
- Loading branch information
Showing
24 changed files
with
873 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...oom_kit/lib/src/widgets/poll_widgets/leaderboard_widgets/leaderboard_creator_summary.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:hms_room_kit/src/widgets/poll_widgets/leaderboard_widgets/summary_box.dart'; | ||
|
||
class LeaderboardCreatorSummary extends StatelessWidget { | ||
final double? votedPercent; | ||
final String? votedDescription; | ||
final double? correctPercent; | ||
final String? correctDescription; | ||
final int? avgTimeInMilliseconds; | ||
final double? avgScore; | ||
|
||
const LeaderboardCreatorSummary( | ||
{super.key, | ||
this.votedPercent, | ||
this.votedDescription, | ||
this.correctPercent, | ||
this.correctDescription, | ||
this.avgTimeInMilliseconds, | ||
this.avgScore}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Column( | ||
children: [ | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Expanded( | ||
child: SummaryBox( | ||
title: "VOTED", | ||
subtitle: (votedPercent == null || votedDescription == null) | ||
? "-" | ||
: "${votedPercent!.toStringAsFixed(2)}% ($votedDescription)"), | ||
), | ||
const SizedBox( | ||
width: 10, | ||
), | ||
Expanded( | ||
child: SummaryBox( | ||
title: "CORRECT ANSWERS", | ||
subtitle: (correctPercent == null || | ||
correctDescription == null) | ||
? "-" | ||
: "${correctPercent!.toStringAsFixed(2)}% ($correctDescription)"), | ||
) | ||
], | ||
), | ||
const SizedBox( | ||
height: 10, | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
if (avgTimeInMilliseconds != null && avgTimeInMilliseconds! > 0) | ||
Expanded( | ||
child: SummaryBox( | ||
title: "AVG. TIME TAKEN", | ||
subtitle: avgTimeInMilliseconds == null | ||
? "-" | ||
: "${avgTimeInMilliseconds! / 1000}s"), | ||
), | ||
if (avgScore != null && avgScore! > 0) | ||
const SizedBox( | ||
width: 10, | ||
), | ||
Expanded( | ||
child: SummaryBox( | ||
title: "AVG. SCORE", | ||
subtitle: avgScore == null | ||
? "-" | ||
: avgScore!.toStringAsPrecision(2)), | ||
) | ||
], | ||
), | ||
], | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.