forked from firka/student-legacy
finished new morning live card
This commit is contained in:
parent
90debfa60c
commit
3f537976e9
@ -195,8 +195,8 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
// ];
|
||||
// String? selectedValue;
|
||||
|
||||
// DateTime now = DateTime.now();
|
||||
DateTime now = DateTime(2024, 4, 22, 5, 55);
|
||||
DateTime now = DateTime.now();
|
||||
// DateTime now = DateTime(2024, 4, 22, 5, 55);
|
||||
LiveCardState currentState = LiveCardState.empty;
|
||||
|
||||
if (now.isBefore(DateTime(now.year, DateTime.august, 31)) &&
|
||||
|
@ -3,6 +3,10 @@ import 'package:refilc/api/providers/user_provider.dart';
|
||||
import 'package:refilc/helpers/subject.dart';
|
||||
import 'package:refilc/icons/filc_icons.dart';
|
||||
import 'package:refilc/models/settings.dart';
|
||||
import 'package:refilc_kreta_api/models/category.dart';
|
||||
import 'package:refilc_kreta_api/models/lesson.dart';
|
||||
import 'package:refilc_kreta_api/models/subject.dart';
|
||||
import 'package:refilc_kreta_api/models/teacher.dart';
|
||||
import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart';
|
||||
import 'package:refilc_mobile_ui/pages/home/live_card/heads_up_countdown.dart';
|
||||
import 'package:refilc_mobile_ui/pages/home/live_card/segmented_countdown.dart';
|
||||
@ -56,7 +60,28 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
Duration bellDelay = liveCard.delay;
|
||||
|
||||
// test
|
||||
liveCard.currentState = LiveCardState.morning;
|
||||
// liveCard.currentState = LiveCardState.morning;
|
||||
// liveCard.nextLesson = Lesson(
|
||||
// date: DateTime.now().add(Duration(
|
||||
// minutes: 30,
|
||||
// )),
|
||||
// subject: GradeSubject(
|
||||
// category: Category(id: 'asd'), id: 'asd', name: 'Matematika'),
|
||||
// lessonIndex: 'lessonIndex',
|
||||
// teacher: Teacher(id: 'id', name: 'name'),
|
||||
// start: DateTime.now().add(Duration(
|
||||
// minutes: 30,
|
||||
// )),
|
||||
// end: DateTime.now().add(Duration(
|
||||
// minutes: 30 + 45,
|
||||
// )),
|
||||
// homeworkId: 'homeworkId',
|
||||
// id: 'id',
|
||||
// description: 'description',
|
||||
// room: 'ABC69',
|
||||
// groupName: 'groupName',
|
||||
// name: 'name',
|
||||
// );
|
||||
|
||||
final dt = DateTime(2024, 3, 22, 17, 12, 1, 1, 1);
|
||||
|
||||
@ -161,19 +186,29 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
// ),
|
||||
// )
|
||||
// : null,
|
||||
children: liveCard.nextLesson == null
|
||||
children: liveCard.nextLesson != null
|
||||
? [
|
||||
SplittedPanel(
|
||||
hasShadow: false,
|
||||
padding: EdgeInsets.zero,
|
||||
cardPadding: const EdgeInsets.all(18.0),
|
||||
cardPadding: EdgeInsets.zero,
|
||||
spacing: 8.0,
|
||||
children: [
|
||||
SplittedPanel(
|
||||
hasShadow: false,
|
||||
isTransparent: true,
|
||||
padding: EdgeInsets.zero,
|
||||
cardPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 18.0,
|
||||
vertical: 16.0,
|
||||
),
|
||||
spacing: 0.0,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Hamarosan kezdődik az első órád!'.i18n,
|
||||
'first_lesson_soon'.i18n,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16.0,
|
||||
@ -185,6 +220,18 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
SegmentedCountdown(date: dt)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SplittedPanel(
|
||||
hasShadow: false,
|
||||
isTransparent: true,
|
||||
padding: EdgeInsets.zero,
|
||||
cardPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 18.0,
|
||||
vertical: 14.0,
|
||||
),
|
||||
spacing: 0.0,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -193,13 +240,18 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
Icon(
|
||||
SubjectIcon.resolveVariant(
|
||||
context: context,
|
||||
subjectName: 'matekgeci',
|
||||
subject: liveCard.nextLesson!.subject,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12.0),
|
||||
Text(
|
||||
'matekfasz',
|
||||
style: TextStyle(
|
||||
(liveCard.nextLesson!.subject.isRenamed
|
||||
? liveCard
|
||||
.nextLesson!.subject.renamedTo
|
||||
: liveCard
|
||||
.nextLesson!.subject.name) ??
|
||||
'',
|
||||
style: const TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@ -208,10 +260,40 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'8:00-8:45',
|
||||
Container(
|
||||
width: liveCard.nextLesson!.room.length > 20
|
||||
? 111
|
||||
: null,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6.0, vertical: 3.5),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.15),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Text(
|
||||
liveCard.nextLesson!.room,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
height: 1.1,
|
||||
fontSize: 12.5,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.9),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'${DateFormat('H:mm').format(liveCard.nextLesson!.start)}-${DateFormat('H:mm').format(liveCard.nextLesson!.end)}',
|
||||
style: const TextStyle(
|
||||
fontSize: 12.5,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
@ -221,6 +303,8 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
||||
: null,
|
||||
);
|
||||
|
@ -21,6 +21,8 @@ extension Localization on String {
|
||||
"h": "hour(s)",
|
||||
"m": "minute(s)",
|
||||
"s": "sec(s)",
|
||||
// v5
|
||||
"first_lesson_soon": "Your first lesson starts soon!",
|
||||
},
|
||||
"hu_hu": {
|
||||
"next": "Következő",
|
||||
@ -40,6 +42,8 @@ extension Localization on String {
|
||||
"h": "óra",
|
||||
"m": "perc",
|
||||
"s": "másodperc",
|
||||
// v5
|
||||
"first_lesson_soon": "Hamarosan kezdődik az első órád!",
|
||||
},
|
||||
"de_de": {
|
||||
"next": "Nächste",
|
||||
@ -56,9 +60,11 @@ extension Localization on String {
|
||||
"first_lesson_3": ", um ",
|
||||
"first_lesson_4": " Uhr.",
|
||||
// segmented countdown
|
||||
"h": "óra",
|
||||
"m": "perc",
|
||||
"s": "másodperc",
|
||||
"h": "Stunden",
|
||||
"m": "Minute",
|
||||
"s": "Sekunde",
|
||||
// v5
|
||||
"first_lesson_soon": "Ihre erste Unterrichtsstunde beginnt bald!",
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user