added event functionality and summary to livecard
This commit is contained in:
parent
580c92b13d
commit
1a9080dcc2
@ -19,7 +19,8 @@ enum LiveCardState {
|
|||||||
duringBreak,
|
duringBreak,
|
||||||
morning,
|
morning,
|
||||||
afternoon,
|
afternoon,
|
||||||
night
|
night,
|
||||||
|
summary
|
||||||
}
|
}
|
||||||
|
|
||||||
class LiveCardProvider extends ChangeNotifier {
|
class LiveCardProvider extends ChangeNotifier {
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
#include <dynamic_color/dynamic_color_plugin.h>
|
#include <dynamic_color/dynamic_color_plugin.h>
|
||||||
|
#include <file_selector_linux/file_selector_plugin.h>
|
||||||
#include <flutter_acrylic/flutter_acrylic_plugin.h>
|
#include <flutter_acrylic/flutter_acrylic_plugin.h>
|
||||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
|
|
||||||
@ -14,6 +15,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
|||||||
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
|
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
|
||||||
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
|
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
||||||
|
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) flutter_acrylic_registrar =
|
g_autoptr(FlPluginRegistrar) flutter_acrylic_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterAcrylicPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterAcrylicPlugin");
|
||||||
flutter_acrylic_plugin_register_with_registrar(flutter_acrylic_registrar);
|
flutter_acrylic_plugin_register_with_registrar(flutter_acrylic_registrar);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
dynamic_color
|
dynamic_color
|
||||||
|
file_selector_linux
|
||||||
flutter_acrylic
|
flutter_acrylic
|
||||||
url_launcher_linux
|
url_launcher_linux
|
||||||
)
|
)
|
||||||
|
@ -7,6 +7,7 @@ import Foundation
|
|||||||
|
|
||||||
import connectivity_plus
|
import connectivity_plus
|
||||||
import dynamic_color
|
import dynamic_color
|
||||||
|
import file_selector_macos
|
||||||
import flutter_local_notifications
|
import flutter_local_notifications
|
||||||
import macos_window_utils
|
import macos_window_utils
|
||||||
import package_info_plus
|
import package_info_plus
|
||||||
@ -18,6 +19,7 @@ import url_launcher_macos
|
|||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
|
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
|
||||||
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
|
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
|
||||||
|
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||||
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
|
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
|
||||||
MacOSWindowUtilsPlugin.register(with: registry.registrar(forPlugin: "MacOSWindowUtilsPlugin"))
|
MacOSWindowUtilsPlugin.register(with: registry.registrar(forPlugin: "MacOSWindowUtilsPlugin"))
|
||||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||||
|
@ -4,6 +4,7 @@ import 'package:filcnaplo/helpers/subject.dart';
|
|||||||
import 'package:filcnaplo/icons/filc_icons.dart';
|
import 'package:filcnaplo/icons/filc_icons.dart';
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/pages/home/live_card/heads_up_countdown.dart';
|
import 'package:filcnaplo_mobile_ui/pages/home/live_card/heads_up_countdown.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/screens/summary/summary_screen.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo/api/providers/live_card_provider.dart';
|
import 'package:filcnaplo/api/providers/live_card_provider.dart';
|
||||||
@ -52,6 +53,21 @@ class _LiveCardState extends State<LiveCard> {
|
|||||||
Duration bellDelay = liveCard.delay;
|
Duration bellDelay = liveCard.delay;
|
||||||
|
|
||||||
switch (liveCard.currentState) {
|
switch (liveCard.currentState) {
|
||||||
|
case LiveCardState.summary:
|
||||||
|
child = LiveCardWidget(
|
||||||
|
key: const Key('livecard.summary'),
|
||||||
|
title: '',
|
||||||
|
icon: FeatherIcons.arrowRight,
|
||||||
|
description: Text(''),
|
||||||
|
onTap: () => Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) => const SummaryScreen(
|
||||||
|
currentPage: 'grades',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
break;
|
||||||
case LiveCardState.morning:
|
case LiveCardState.morning:
|
||||||
child = LiveCardWidget(
|
child = LiveCardWidget(
|
||||||
key: const Key('livecard.morning'),
|
key: const Key('livecard.morning'),
|
||||||
|
@ -9,6 +9,7 @@ enum ProgressAccuracy { minutes, seconds }
|
|||||||
class LiveCardWidget extends StatefulWidget {
|
class LiveCardWidget extends StatefulWidget {
|
||||||
const LiveCardWidget({
|
const LiveCardWidget({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
this.isEvent = false,
|
||||||
this.leading,
|
this.leading,
|
||||||
this.title,
|
this.title,
|
||||||
this.titleItalic = false,
|
this.titleItalic = false,
|
||||||
@ -22,8 +23,10 @@ class LiveCardWidget extends StatefulWidget {
|
|||||||
this.progressMax,
|
this.progressMax,
|
||||||
this.progressAccuracy = ProgressAccuracy.minutes,
|
this.progressAccuracy = ProgressAccuracy.minutes,
|
||||||
this.onProgressTap,
|
this.onProgressTap,
|
||||||
|
this.onTap,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final bool isEvent;
|
||||||
final String? leading;
|
final String? leading;
|
||||||
final String? title;
|
final String? title;
|
||||||
final bool titleItalic;
|
final bool titleItalic;
|
||||||
@ -37,6 +40,7 @@ class LiveCardWidget extends StatefulWidget {
|
|||||||
final double? progressMax;
|
final double? progressMax;
|
||||||
final ProgressAccuracy? progressAccuracy;
|
final ProgressAccuracy? progressAccuracy;
|
||||||
final Function()? onProgressTap;
|
final Function()? onProgressTap;
|
||||||
|
final Function()? onTap;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<LiveCardWidget> createState() => _LiveCardWidgetState();
|
State<LiveCardWidget> createState() => _LiveCardWidgetState();
|
||||||
@ -51,6 +55,7 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
onLongPressDown: (_) => setState(() => hold = true),
|
onLongPressDown: (_) => setState(() => hold = true),
|
||||||
onLongPressEnd: (_) => setState(() => hold = false),
|
onLongPressEnd: (_) => setState(() => hold = false),
|
||||||
onLongPressCancel: () => setState(() => hold = false),
|
onLongPressCancel: () => setState(() => hold = false),
|
||||||
|
onTap: widget.onTap,
|
||||||
child: AnimatedScale(
|
child: AnimatedScale(
|
||||||
scale: hold ? 1.03 : 1.0,
|
scale: hold ? 1.03 : 1.0,
|
||||||
curve: Curves.easeInOutBack,
|
curve: Curves.easeInOutBack,
|
||||||
@ -73,7 +78,48 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 6.0),
|
padding: const EdgeInsets.symmetric(horizontal: 6.0),
|
||||||
child: OverflowBox(
|
child: OverflowBox(
|
||||||
maxHeight: 96.0,
|
maxHeight: 96.0,
|
||||||
child: Column(
|
child: widget.isEvent
|
||||||
|
? Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
widget.title ?? 'Esemény',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 32,
|
||||||
|
fontStyle:
|
||||||
|
widget.titleItalic ? FontStyle.italic : null,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
widget.description ??
|
||||||
|
const Text('Nincs leírás megadva.'),
|
||||||
|
SizedBox(
|
||||||
|
height: 15,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.secondary
|
||||||
|
.withOpacity(0.5),
|
||||||
|
borderRadius: const BorderRadius.all(
|
||||||
|
Radius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
child: Icon(widget.icon),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
@ -83,21 +129,25 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
children: [
|
children: [
|
||||||
if (widget.leading != null)
|
if (widget.leading != null)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 12.0, top: 8.0),
|
padding: const EdgeInsets.only(
|
||||||
|
right: 12.0, top: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.leading!,
|
widget.leading!,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 32.0,
|
fontSize: 32.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.secondary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
@ -106,56 +156,98 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
child: Text.rich(
|
child: Text.rich(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
children: [
|
children: [
|
||||||
TextSpan(text: widget.title!, style: TextStyle(fontStyle: widget.titleItalic ? FontStyle.italic : null)),
|
TextSpan(
|
||||||
|
text: widget.title!,
|
||||||
|
style: TextStyle(
|
||||||
|
fontStyle: widget
|
||||||
|
.titleItalic
|
||||||
|
? FontStyle.italic
|
||||||
|
: null)),
|
||||||
if (widget.subtitle != null)
|
if (widget.subtitle != null)
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(left: 6.0, bottom: 3.0),
|
margin: const EdgeInsets
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4.0, vertical: 2.0),
|
.only(
|
||||||
decoration: BoxDecoration(
|
left: 6.0,
|
||||||
color: Theme.of(context).colorScheme.secondary.withOpacity(.3),
|
bottom: 3.0),
|
||||||
borderRadius: BorderRadius.circular(4.0),
|
padding:
|
||||||
|
const EdgeInsets
|
||||||
|
.symmetric(
|
||||||
|
horizontal: 4.0,
|
||||||
|
vertical: 2.0),
|
||||||
|
decoration:
|
||||||
|
BoxDecoration(
|
||||||
|
color: Theme.of(
|
||||||
|
context)
|
||||||
|
.colorScheme
|
||||||
|
.secondary
|
||||||
|
.withOpacity(.3),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius
|
||||||
|
.circular(
|
||||||
|
4.0),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.subtitle!,
|
widget.subtitle!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
height: 1.2,
|
height: 1.2,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight:
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
FontWeight.w600,
|
||||||
|
color: Theme.of(
|
||||||
|
context)
|
||||||
|
.colorScheme
|
||||||
|
.secondary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
style: const TextStyle(fontWeight: FontWeight.w600, fontSize: 22.0),
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 22.0),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
softWrap: false,
|
softWrap: false,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (widget.title != null) const SizedBox(width: 6.0),
|
if (widget.title != null)
|
||||||
|
const SizedBox(width: 6.0),
|
||||||
if (widget.icon != null)
|
if (widget.icon != null)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 4.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
widget.icon,
|
widget.icon,
|
||||||
size: 26.0,
|
size: 26.0,
|
||||||
color: AppColors.of(context).text.withOpacity(.75),
|
color: AppColors.of(context)
|
||||||
|
.text
|
||||||
|
.withOpacity(.75),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (widget.description != null)
|
if (widget.description != null)
|
||||||
DefaultTextStyle(
|
DefaultTextStyle(
|
||||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodyMedium!
|
||||||
|
.copyWith(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
height: 1.0,
|
height: 1.0,
|
||||||
color: AppColors.of(context).text.withOpacity(.75),
|
color: AppColors.of(context)
|
||||||
|
.text
|
||||||
|
.withOpacity(.75),
|
||||||
),
|
),
|
||||||
maxLines: !(widget.nextSubject == null && widget.progressCurrent == null && widget.progressMax == null) ? 1 : 2,
|
maxLines:
|
||||||
|
!(widget.nextSubject == null &&
|
||||||
|
widget.progressCurrent ==
|
||||||
|
null &&
|
||||||
|
widget.progressMax == null)
|
||||||
|
? 1
|
||||||
|
: 2,
|
||||||
softWrap: false,
|
softWrap: false,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
child: widget.description!,
|
child: widget.description!,
|
||||||
@ -166,28 +258,47 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (!(widget.nextSubject == null && widget.progressCurrent == null && widget.progressMax == null))
|
if (!(widget.nextSubject == null &&
|
||||||
|
widget.progressCurrent == null &&
|
||||||
|
widget.progressMax == null))
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (widget.nextSubject != null) const Icon(FeatherIcons.arrowRight, size: 12.0),
|
if (widget.nextSubject != null)
|
||||||
if (widget.nextSubject != null) const SizedBox(width: 4.0),
|
const Icon(FeatherIcons.arrowRight,
|
||||||
|
size: 12.0),
|
||||||
|
if (widget.nextSubject != null)
|
||||||
|
const SizedBox(width: 4.0),
|
||||||
if (widget.nextSubject != null)
|
if (widget.nextSubject != null)
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text.rich(
|
child: Text.rich(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: widget.nextSubject!, style: TextStyle(fontStyle: widget.nextSubjectItalic ? FontStyle.italic : null)),
|
text: widget.nextSubject!,
|
||||||
|
style: TextStyle(
|
||||||
|
fontStyle:
|
||||||
|
widget.nextSubjectItalic
|
||||||
|
? FontStyle.italic
|
||||||
|
: null)),
|
||||||
if (widget.nextRoom != null)
|
if (widget.nextRoom != null)
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(left: 4.0),
|
margin: const EdgeInsets.only(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 3.0, vertical: 1.5),
|
left: 4.0),
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(
|
||||||
|
horizontal: 3.0,
|
||||||
|
vertical: 1.5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.secondary.withOpacity(.25),
|
color: Theme.of(context)
|
||||||
borderRadius: BorderRadius.circular(4.0),
|
.colorScheme
|
||||||
|
.secondary
|
||||||
|
.withOpacity(.25),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(
|
||||||
|
4.0),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.nextRoom!,
|
widget.nextRoom!,
|
||||||
@ -195,7 +306,10 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
height: 1.1,
|
height: 1.1,
|
||||||
fontSize: 11.0,
|
fontSize: 11.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme.of(context).colorScheme.secondary.withOpacity(.9),
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.secondary
|
||||||
|
.withOpacity(.9),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -203,7 +317,9 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.of(context).text.withOpacity(.8),
|
color: AppColors.of(context)
|
||||||
|
.text
|
||||||
|
.withOpacity(.8),
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
@ -211,19 +327,26 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
softWrap: false,
|
softWrap: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (widget.nextRoom == null && widget.nextSubject == null) const Spacer(),
|
if (widget.nextRoom == null &&
|
||||||
if (widget.progressCurrent != null && widget.progressMax != null)
|
widget.nextSubject == null)
|
||||||
|
const Spacer(),
|
||||||
|
if (widget.progressCurrent != null &&
|
||||||
|
widget.progressMax != null)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: widget.onProgressTap,
|
onTap: widget.onProgressTap,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Text(
|
child: Text(
|
||||||
"remaining ${widget.progressAccuracy == ProgressAccuracy.minutes ? 'min' : 'sec'}"
|
"remaining ${widget.progressAccuracy == ProgressAccuracy.minutes ? 'min' : 'sec'}"
|
||||||
.plural((widget.progressMax! - widget.progressCurrent!).round()),
|
.plural((widget.progressMax! -
|
||||||
|
widget.progressCurrent!)
|
||||||
|
.round()),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: AppColors.of(context).text.withOpacity(.75),
|
color: AppColors.of(context)
|
||||||
|
.text
|
||||||
|
.withOpacity(.75),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -231,10 +354,13 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (widget.progressCurrent != null && widget.progressMax != null)
|
if (widget.progressCurrent != null &&
|
||||||
|
widget.progressMax != null)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||||
child: ProgressBar(value: widget.progressCurrent! / widget.progressMax!),
|
child: ProgressBar(
|
||||||
|
value: widget.progressCurrent! /
|
||||||
|
widget.progressMax!),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user