Merge branch 'refilc:dev' into dev

This commit is contained in:
Geryy 2024-05-03 17:25:59 +02:00 committed by GitHub
commit 8f05dc4ed4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
38 changed files with 679 additions and 335 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 754 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 658 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 491 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -187,7 +187,7 @@ class AppTheme {
accentColor == AccentColor.ogfilc) || accentColor == AccentColor.ogfilc) ||
!settings.newColors !settings.newColors
? accent ? accent
: ColorsUtils().lighten(accent, amount: 0.3); : ColorsUtils().lighten(accent, amount: 0.22);
// Color newScaffoldBg = ColorsUtils().lighten(accent, amount: 0.4); // Color newScaffoldBg = ColorsUtils().lighten(accent, amount: 0.4);
Color newTertiary = (accentColor == AccentColor.adaptive || Color newTertiary = (accentColor == AccentColor.adaptive ||
accentColor == AccentColor.custom || accentColor == AccentColor.custom ||

View File

@ -27,6 +27,7 @@ class LessonTile extends StatelessWidget {
this.currentLessonIndicator = true, this.currentLessonIndicator = true,
this.padding, this.padding,
this.contentPadding, this.contentPadding,
this.showSubTiles = true,
}); });
final Lesson lesson; final Lesson lesson;
@ -37,6 +38,7 @@ class LessonTile extends StatelessWidget {
final bool currentLessonIndicator; final bool currentLessonIndicator;
final EdgeInsetsGeometry? padding; final EdgeInsetsGeometry? padding;
final EdgeInsetsGeometry? contentPadding; final EdgeInsetsGeometry? contentPadding;
final bool showSubTiles;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -149,7 +151,8 @@ class LessonTile extends StatelessWidget {
child: PanelTitle(title: Text(lesson.name)), child: PanelTitle(title: Text(lesson.name)),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.only(bottom: subtiles.isEmpty ? 0.0 : 12.0), padding: EdgeInsets.only(
bottom: (subtiles.isNotEmpty && showSubTiles) ? 12.0 : 0.0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -446,7 +449,7 @@ class LessonTile extends StatelessWidget {
), ),
// Homework & Exams // Homework & Exams
...subtiles, if (showSubTiles) ...subtiles,
], ],
), ),
), ),

View File

@ -3,7 +3,7 @@ description: "Egy nem hivatalos e-KRÉTA kliens, diákoktól diákoknak."
homepage: https://refilc.hu homepage: https://refilc.hu
publish_to: "none" publish_to: "none"
version: 5.0.0+252 version: 5.0.0+253
environment: environment:
sdk: ">=2.17.0 <=3.3.2" sdk: ">=2.17.0 <=3.3.2"

View File

@ -19,6 +19,7 @@ import 'package:refilc_kreta_api/models/grade.dart';
import 'package:refilc_kreta_api/models/subject.dart'; import 'package:refilc_kreta_api/models/subject.dart';
import 'package:refilc_mobile_ui/common/average_display.dart'; import 'package:refilc_mobile_ui/common/average_display.dart';
import 'package:refilc_mobile_ui/common/bottom_sheet_menu/rounded_bottom_sheet.dart'; import 'package:refilc_mobile_ui/common/bottom_sheet_menu/rounded_bottom_sheet.dart';
import 'package:refilc_mobile_ui/common/empty.dart';
import 'package:refilc_mobile_ui/common/filter_bar.dart'; import 'package:refilc_mobile_ui/common/filter_bar.dart';
import 'package:refilc_mobile_ui/common/panel/panel.dart'; import 'package:refilc_mobile_ui/common/panel/panel.dart';
import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart'; import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart';
@ -281,7 +282,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView>
title: Text("exams".i18n), title: Text("exams".i18n),
children: _tiles, children: _tiles,
)) ))
: const SizedBox(), : const Empty(),
), ),
); );

View File

@ -213,8 +213,8 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
// } // }
// TODO: REMOVE IN PRODUCTION BUILD!!! // TODO: REMOVE IN PRODUCTION BUILD!!!
print(_liveCard.currentState); // print(_liveCard.currentState);
_liveCard.currentState = LiveCardState.morning; _liveCard.currentState = LiveCardState.duringLesson;
return Scaffold( return Scaffold(
body: Stack( body: Stack(
@ -326,9 +326,11 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
expandedHeight: _liveCardAnimation.value * expandedHeight: _liveCardAnimation.value *
(_liveCard.currentState == LiveCardState.morning (_liveCard.currentState == LiveCardState.morning
? 274.0 ? 274.0
: (_liveCard.currentState == : ((_liveCard.currentState ==
LiveCardState.duringLesson LiveCardState.duringLesson ||
? 288.0 _liveCard.currentState ==
LiveCardState.duringBreak)
? 292.0
: 238.0)), : 238.0)),
// Live Card // Live Card
@ -340,14 +342,21 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
top: ((_liveCard.currentState == top: ((_liveCard.currentState ==
LiveCardState.morning || LiveCardState.morning ||
_liveCard.currentState == _liveCard.currentState ==
LiveCardState.duringLesson) LiveCardState.duringLesson ||
_liveCard.currentState ==
LiveCardState.duringBreak)
? 0.0 ? 0.0
: 62.0) + : 62.0) +
MediaQuery.of(context).padding.top, MediaQuery.of(context).padding.top,
bottom: _liveCard.currentState == bottom: (_liveCard.currentState ==
LiveCardState.morning LiveCardState.morning)
? 44.0 ? 44.0
: 52.0, : ((_liveCard.currentState ==
LiveCardState.duringLesson ||
_liveCard.currentState ==
LiveCardState.duringBreak)
? 55.0
: 52.0),
), ),
child: Transform.scale( child: Transform.scale(
scale: _liveCardAnimation.value, scale: _liveCardAnimation.value,

View File

@ -3,7 +3,6 @@
import 'package:animations/animations.dart'; import 'package:animations/animations.dart';
import 'package:refilc/api/providers/user_provider.dart'; import 'package:refilc/api/providers/user_provider.dart';
import 'package:refilc/helpers/subject.dart'; import 'package:refilc/helpers/subject.dart';
import 'package:refilc/icons/filc_icons.dart';
import 'package:refilc/models/settings.dart'; import 'package:refilc/models/settings.dart';
import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc/ui/widgets/lesson/lesson_tile.dart'; import 'package:refilc/ui/widgets/lesson/lesson_tile.dart';
@ -11,7 +10,9 @@ import 'package:refilc_kreta_api/models/category.dart';
import 'package:refilc_kreta_api/models/lesson.dart'; import 'package:refilc_kreta_api/models/lesson.dart';
import 'package:refilc_kreta_api/models/subject.dart'; import 'package:refilc_kreta_api/models/subject.dart';
import 'package:refilc_kreta_api/models/teacher.dart'; import 'package:refilc_kreta_api/models/teacher.dart';
import 'package:refilc_mobile_ui/common/panel/panel.dart';
import 'package:refilc_mobile_ui/common/progress_bar.dart'; import 'package:refilc_mobile_ui/common/progress_bar.dart';
import 'package:refilc_mobile_ui/common/round_border_icon.dart';
// import 'package:refilc_kreta_api/models/category.dart'; // import 'package:refilc_kreta_api/models/category.dart';
// import 'package:refilc_kreta_api/models/lesson.dart'; // import 'package:refilc_kreta_api/models/lesson.dart';
// import 'package:refilc_kreta_api/models/subject.dart'; // import 'package:refilc_kreta_api/models/subject.dart';
@ -70,8 +71,8 @@ class LiveCardStateA extends State<LiveCard> {
// test // test
// TODO: REMOVE IN PRODUCTION BUILD!!! // TODO: REMOVE IN PRODUCTION BUILD!!!
liveCard.currentState = LiveCardState.morning; liveCard.currentState = LiveCardState.duringLesson;
liveCard.nextLesson = Lesson( liveCard.currentLesson = Lesson(
date: DateTime.now().add(Duration( date: DateTime.now().add(Duration(
minutes: 30, minutes: 30,
)), )),
@ -93,7 +94,7 @@ class LiveCardStateA extends State<LiveCard> {
name: 'name', name: 'name',
); );
// liveCard.nextLesson = liveCard.currentLesson; liveCard.nextLesson = liveCard.currentLesson;
// final dt = DateTime(2024, 3, 22, 17, 12, 1, 1, 1); // final dt = DateTime(2024, 3, 22, 17, 12, 1, 1, 1);
@ -304,7 +305,7 @@ class LiveCardStateA extends State<LiveCard> {
width: 10, width: 10,
), ),
Text( Text(
'${DateFormat('H:mm').format(liveCard.nextLesson!.start)}-${DateFormat('H:mm').format(liveCard.nextLesson!.end)}', '${DateFormat('H:mm').format(liveCard.nextLesson!.start)} - ${DateFormat('H:mm').format(liveCard.nextLesson!.end)}',
style: const TextStyle( style: const TextStyle(
fontSize: 12.5, fontSize: 12.5,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -411,8 +412,9 @@ class LiveCardStateA extends State<LiveCard> {
swapRoom: true, swapRoom: true,
currentLessonIndicator: false, currentLessonIndicator: false,
padding: padding:
const EdgeInsets.only(top: 8.0, bottom: 4.0), const EdgeInsets.only(top: 6.0, bottom: 4.0),
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
showSubTiles: false,
), ),
if (!(nextSubject == null && if (!(nextSubject == null &&
progressCurrent == null && progressCurrent == null &&
@ -546,7 +548,7 @@ class LiveCardStateA extends State<LiveCard> {
width: 10, width: 10,
), ),
Text( Text(
'${DateFormat('H:mm').format(liveCard.nextLesson!.start)}-${DateFormat('H:mm').format(liveCard.nextLesson!.end)}', '${DateFormat('H:mm').format(liveCard.nextLesson!.start)} - ${DateFormat('H:mm').format(liveCard.nextLesson!.end)}',
style: const TextStyle( style: const TextStyle(
fontSize: 12.5, fontSize: 12.5,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -566,12 +568,17 @@ class LiveCardStateA extends State<LiveCard> {
); );
break; break;
case LiveCardState.duringBreak: case LiveCardState.duringBreak:
final iconFloorMap = { if (liveCard.prevLesson == null || liveCard.nextLesson == null) {
"to room": FeatherIcons.chevronsRight, child = Container();
"up floor": FilcIcons.upstairs, break;
"down floor": FilcIcons.downstairs, }
"ground floor": FilcIcons.downstairs,
}; // final iconFloorMap = {
// "to room": FeatherIcons.chevronsRight,
// "up floor": FilcIcons.upstairs,
// "down floor": FilcIcons.downstairs,
// "ground floor": FilcIcons.downstairs,
// };
final diff = liveCard.getFloorDifference(); final diff = liveCard.getFloorDifference();
@ -587,36 +594,352 @@ class LiveCardStateA extends State<LiveCard> {
final showMinutes = maxTime - elapsedTime > 60; final showMinutes = maxTime - elapsedTime > 60;
// child = LiveCardWidget(
// key: const Key('livecard.duringBreak'),
// title: "break".i18n,
// icon: iconFloorMap[diff],
// description: liveCard.nextLesson!.room != liveCard.prevLesson!.room
// ? Text("go $diff".i18n.fill([
// diff != "to room"
// ? (liveCard.nextLesson!.getFloor() ?? 0)
// : liveCard.nextLesson!.room
// ]))
// : Text("stay".i18n),
// nextSubject: liveCard.nextLesson?.subject.renamedTo ??
// liveCard.nextLesson?.subject.name.capital(),
// nextSubjectItalic: liveCard.nextLesson?.subject.isRenamed == true &&
// settingsProvider.renamedSubjectsItalics,
// nextRoom: diff != "to room" ? liveCard.nextLesson?.room : null,
// progressMax: showMinutes ? maxTime / 60 : maxTime,
// progressCurrent: showMinutes ? elapsedTime / 60 : elapsedTime,
// progressAccuracy:
// showMinutes ? ProgressAccuracy.minutes : ProgressAccuracy.seconds,
// onProgressTap: () {
// showDialog(
// barrierColor: Colors.black,
// context: context,
// builder: (context) => HeadsUpCountdown(
// maxTime: maxTime,
// elapsedTime: elapsedTime,
// ),
// );
// },
// );
var nextSubject = liveCard.nextLesson?.subject.renamedTo ??
liveCard.nextLesson?.subject.name.capital();
var nextSubjectItalic =
liveCard.nextLesson?.subject.isRenamed == true &&
settingsProvider.renamedSubjectsItalics;
// var nextRoom = diff != "to room" ? liveCard.nextLesson?.room : null;
var progressMax = showMinutes ? maxTime / 60 : maxTime;
var progressCurrent = showMinutes ? elapsedTime / 60 : elapsedTime;
var progressAccuracy =
showMinutes ? ProgressAccuracy.minutes : ProgressAccuracy.seconds;
// Lesson breakLesson = Lesson(
// date: DateTime.now(),
// start: liveCard.prevLesson!.end,
// end: liveCard.nextLesson!.start,
// name: 'break'.i18n,
// description: 'Menj a XY terembe...',
// );
child = LiveCardWidget( child = LiveCardWidget(
key: const Key('livecard.duringBreak'), key: const Key('livecard.duringBreak'),
title: "break".i18n, children: liveCard.nextLesson != null
icon: iconFloorMap[diff], ? [
description: liveCard.nextLesson!.room != liveCard.prevLesson!.room SplittedPanel(
? Text("go $diff".i18n.fill([ hasShadow: false,
diff != "to room" padding: EdgeInsets.zero,
? (liveCard.nextLesson!.getFloor() ?? 0) cardPadding: EdgeInsets.zero,
: liveCard.nextLesson!.room spacing: 8.0,
])) children: [
: Text("stay".i18n), SplittedPanel(
nextSubject: liveCard.nextLesson?.subject.renamedTo ?? hasShadow: false,
liveCard.nextLesson?.subject.name.capital(), isTransparent: true,
nextSubjectItalic: liveCard.nextLesson?.subject.isRenamed == true && padding: EdgeInsets.zero,
settingsProvider.renamedSubjectsItalics, cardPadding: const EdgeInsets.symmetric(
nextRoom: diff != "to room" ? liveCard.nextLesson?.room : null, horizontal: 12.0,
progressMax: showMinutes ? maxTime / 60 : maxTime, vertical: 0.0,
progressCurrent: showMinutes ? elapsedTime / 60 : elapsedTime, ),
progressAccuracy: spacing: 0.0,
showMinutes ? ProgressAccuracy.minutes : ProgressAccuracy.seconds, children: [
onProgressTap: () { // LessonTile(
showDialog( // liveCard.currentLesson!,
barrierColor: Colors.black, // swapRoom: true,
context: context, // currentLessonIndicator: false,
builder: (context) => HeadsUpCountdown( // padding:
maxTime: maxTime, // const EdgeInsets.only(top: 8.0, bottom: 4.0),
elapsedTime: elapsedTime, // contentPadding: EdgeInsets.zero,
), // ),
); Padding(
}, padding:
const EdgeInsets.only(top: 8.0, bottom: 4.0),
child: Material(
color: Colors.transparent,
borderRadius: BorderRadius.circular(12.0),
child: Visibility(
visible:
liveCard.nextLesson!.subject.id != '' ||
liveCard.nextLesson!.isEmpty,
replacement: Padding(
padding: const EdgeInsets.only(top: 6.0),
child: PanelTitle(
title: Text(liveCard.nextLesson!.name)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
minVerticalPadding: 0.0,
dense: true,
// onLongPress: kDebugMode ? () => log(jsonEncode(lesson.json)) : null,
visualDensity: VisualDensity.compact,
contentPadding: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(12.0)),
title: Text(
"break".i18n,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16.5,
color: AppColors.of(context)
.text
.withOpacity(!liveCard
.nextLesson!.isEmpty
? 1.0
: 0.5),
fontStyle: liveCard.nextLesson!
.subject.isRenamed &&
settingsProvider
.renamedSubjectsItalics
? FontStyle.italic
: null),
),
subtitle: DefaultTextStyle(
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(
fontWeight: FontWeight.w400,
fontSize: 15.0,
height: 1.0,
color: AppColors.of(context)
.text
.withOpacity(.75),
),
maxLines: !(nextSubject == null &&
progressCurrent == null &&
progressMax == null)
? 1
: 2,
softWrap: false,
overflow: TextOverflow.ellipsis,
child: liveCard.nextLesson!.room !=
liveCard.prevLesson!.room
? Text("go $diff".i18n.fill([
diff != "to room"
? (liveCard.nextLesson!
.getFloor() ??
0)
: liveCard.nextLesson!.room
]))
: Text("stay".i18n),
),
// subtitle: description != ""
// ? Text(
// description,
// style: const TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 14.0,
// ),
// maxLines: 1,
// softWrap: false,
// overflow: TextOverflow.ellipsis,
// )
// : null,
minLeadingWidth: 34.0,
leading: AspectRatio(
aspectRatio: 1,
child: Center(
child: Stack(
children: [
RoundBorderIcon(
color:
AppColors.of(context).text,
width: 1.0,
icon: const SizedBox(
width: 25,
height: 25,
child: Center(
child: Icon(
Icons.local_cafe,
size: 20.0,
),
),
),
),
],
),
),
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(
width: 10,
),
Stack(
alignment: Alignment.center,
children: [
// xix alignment hack :p
const Opacity(
opacity: 0,
child: Text("EE:EE")),
Text(
"${DateFormat("H:mm").format(liveCard.prevLesson!.end)}\n${DateFormat("H:mm").format(liveCard.nextLesson!.start)}",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.w500,
color: AppColors.of(context)
.text
.withOpacity(.9),
),
),
],
),
],
),
),
],
),
),
),
),
if (!(nextSubject == null &&
progressCurrent == null &&
progressMax == null))
Row(
children: [
const SizedBox(
width: 5.0,
),
if (progressCurrent != null &&
progressMax != null)
GestureDetector(
onTap: () {
showDialog(
barrierColor: Colors.black,
context: context,
builder: (context) => HeadsUpCountdown(
maxTime: maxTime,
elapsedTime: elapsedTime),
);
},
child: Container(
color: Colors.transparent,
child: Text(
"remaining ${progressAccuracy == ProgressAccuracy.minutes ? 'min' : 'sec'}"
.plural(
(progressMax - progressCurrent)
.round()),
maxLines: 1,
style: TextStyle(
fontWeight: FontWeight.w500,
color: AppColors.of(context)
.text
.withOpacity(.75),
height: 1.1,
),
),
),
)
],
),
if (progressCurrent != null && progressMax != null)
Padding(
padding:
const EdgeInsets.only(top: 4.0, bottom: 12.0),
child: ProgressBar(
value: progressCurrent / progressMax),
)
],
),
SplittedPanel(
hasShadow: false,
isTransparent: true,
padding: EdgeInsets.zero,
cardPadding: const EdgeInsets.symmetric(
horizontal: 18.0,
vertical: 11.0,
),
spacing: 0.0,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(
liveCard.nextLesson == null
? Icons.home_outlined
: SubjectIcon.resolveVariant(
context: context,
subject:
liveCard.nextLesson!.subject,
),
size: 23.0,
),
const SizedBox(width: 12.0),
Text(
(liveCard.nextLesson?.subject
.isRenamed ??
false
? liveCard
.nextLesson?.subject.renamedTo
: liveCard
.nextLesson?.subject.name) ??
'go_home'.i18n,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontStyle: nextSubjectItalic
? FontStyle.italic
: null,
),
),
],
),
Row(
children: liveCard.nextLesson != null
? [
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,
),
),
]
: [],
),
],
),
],
),
],
),
]
: null,
); );
break; break;
case LiveCardState.afternoon: case LiveCardState.afternoon:

View File

@ -19,7 +19,7 @@ extension Localization on String {
"first_lesson_4": ".", "first_lesson_4": ".",
// segmented countdown // segmented countdown
"h": "hour(s)", "h": "hour(s)",
"m": "minute(s)", "m": "min(s)",
"s": "sec(s)", "s": "sec(s)",
// v5 // v5
"first_lesson_soon": "Your first lesson starts soon!", "first_lesson_soon": "Your first lesson starts soon!",

View File

@ -1,11 +1,9 @@
import 'package:refilc/api/providers/live_card_provider.dart';
import 'package:refilc/models/settings.dart'; import 'package:refilc/models/settings.dart';
import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc_mobile_ui/common/progress_bar.dart'; import 'package:refilc_mobile_ui/common/progress_bar.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart'; import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:refilc_mobile_ui/pages/home/live_card/live_card.dart';
import 'live_card.i18n.dart'; import 'live_card.i18n.dart';
enum ProgressAccuracy { minutes, seconds } enum ProgressAccuracy { minutes, seconds }

View File

@ -135,13 +135,19 @@ class NotesPageState extends State<NotesPage> with TickerProviderStateMixin {
title: Text('your_notes'.i18n), title: Text('your_notes'.i18n),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
isTransparent: true, isTransparent: true,
child: Center( child: selfNoteTiles.length > 1
child: Wrap( ? Center(
spacing: 18.0, child: Wrap(
runSpacing: 18.0, spacing: 18.0,
children: selfNoteTiles, runSpacing: 18.0,
), children: selfNoteTiles,
), ),
)
: Wrap(
spacing: 18.0,
runSpacing: 18.0,
children: selfNoteTiles,
),
)); ));
} }

View File

@ -122,7 +122,7 @@ class LoginScreenState extends State<LoginScreen> {
type: MaterialType.transparency, type: MaterialType.transparency,
child: showBack child: showBack
? BackButton( ? BackButton(
color: AppColors.of(context).loginPrimary) color: AppColors.of(context).text)
: const SizedBox(height: 48.0), : const SizedBox(height: 48.0),
), ),
], ],
@ -130,280 +130,284 @@ class LoginScreenState extends State<LoginScreen> {
Stack( Stack(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
children: [ children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 21),
CarouselSlider(
options: CarouselOptions(
height: MediaQuery.of(context).size.height,
viewportFraction: 1,
autoPlay: true,
autoPlayInterval: const Duration(seconds: 6),
pauseAutoPlayOnTouch: true),
items: [1, 2, 3, 4].map((i) {
return Builder(
builder: (BuildContext context) {
return Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Padding(
padding:
const EdgeInsets.only(left: 24),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"welcome_title_$i".i18n,
style: const TextStyle(
color: Color(0xFF050B15),
fontSize: 19,
fontFamily: 'Montserrat',
fontWeight:
FontWeight.w700,
height: 1.3),
),
const SizedBox(
height: 14.375), //meth
Padding(
padding:
const EdgeInsets.only(
right: 20),
child: Text(
"welcome_text_$i".i18n,
style: const TextStyle(
color:
Color(0xFF050B15),
fontFamily: 'FigTree',
fontWeight:
FontWeight.w500,
fontSize: 17,
height: 1.3),
),
),
],
)),
const SizedBox(height: 15.625),
Padding(
padding: const EdgeInsets.only(
left: 16, right: 16),
child: Image.asset(
'assets/images/showcase$i.png'))
],
);
},
);
}).toList(),
),
],
),
Container(
height: 250,
width: double.infinity,
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [Color(0x00DAE4F7), Color(0xFFDAE4F7)],
stops: [0, 0.1],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Padding(
padding: const EdgeInsets.only(top: 3),
child: Column(
children: [
SizedBox(
height: 48,
width: double.infinity,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16),
child: FilledButton(
style: ButtonStyle(
shape: MaterialStateProperty.all<
RoundedRectangleBorder>(
const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(12)),
))),
onPressed: () {},
child: Text(
"login".i18n,
style: const TextStyle(
fontFamily: 'Montserrat',
fontSize: 20,
fontWeight: FontWeight.w700),
)),
),
),
const SizedBox(height: 8),
],
),
),
)
// Column( // Column(
// //login buttons and ui starts here // mainAxisAlignment: MainAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.end, // crossAxisAlignment: CrossAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [ // children: [
// Padding( // const SizedBox(height: 21),
// padding: const EdgeInsets.only( // CarouselSlider(
// left: 22.0, // options: CarouselOptions(
// right: 22.0, // height: MediaQuery.of(context).size.height,
// top: 0.0, // viewportFraction: 1,
// ), // autoPlay: true,
// child: AutofillGroup( // autoPlayInterval: const Duration(seconds: 6),
// child: Column( // pauseAutoPlayOnTouch: true),
// crossAxisAlignment: CrossAxisAlignment.end, // items: [1, 2, 3, 4].map((i) {
// children: [ // return Builder(
// // username // builder: (BuildContext context) {
// Padding( // return Column(
// padding: // crossAxisAlignment:
// const EdgeInsets.only(bottom: 6.0), // CrossAxisAlignment.start,
// child: Row( // mainAxisAlignment:
// mainAxisAlignment: // MainAxisAlignment.start,
// MainAxisAlignment.spaceBetween, // children: [
// children: [ // Padding(
// Expanded( // padding:
// child: Text( // const EdgeInsets.only(left: 24),
// "username".i18n, // child: Column(
// maxLines: 1, // crossAxisAlignment:
// style: TextStyle( // CrossAxisAlignment.start,
// color: AppColors.of(context) // mainAxisAlignment:
// .loginPrimary, // MainAxisAlignment.start,
// fontWeight: FontWeight.w500, // children: [
// fontSize: 12.0, // Text(
// ), // "welcome_title_$i".i18n,
// ), // style: const TextStyle(
// ), // color: Color(0xFF050B15),
// Expanded( // fontSize: 19,
// child: Text( // fontFamily: 'Montserrat',
// "usernameHint".i18n, // fontWeight:
// maxLines: 1, // FontWeight.w700,
// textAlign: TextAlign.right, // height: 1.3),
// style: TextStyle( // ),
// color: AppColors.of(context) // const SizedBox(
// .loginSecondary, // height: 14.375), //meth
// fontWeight: FontWeight.w500, // Padding(
// fontSize: 12.0, // padding:
// ), // const EdgeInsets.only(
// ), // right: 20),
// ), // child: Text(
// ], // "welcome_text_$i".i18n,
// ), // style: const TextStyle(
// ), // color:
// Padding( // Color(0xFF050B15),
// padding: // fontFamily: 'FigTree',
// const EdgeInsets.only(bottom: 12.0), // fontWeight:
// child: LoginInput( // FontWeight.w500,
// style: LoginInputStyle.username, // fontSize: 17,
// controller: usernameController, // height: 1.3),
// ), // ),
// ), // ),
// ],
// // password // )),
// Padding( // const SizedBox(height: 15.625),
// padding: // Padding(
// const EdgeInsets.only(bottom: 6.0), // padding: const EdgeInsets.only(
// child: Row( // left: 16, right: 16),
// mainAxisAlignment: // child: Image.asset(
// MainAxisAlignment.spaceBetween, // 'assets/images/showcase$i.png'))
// children: [ // ],
// Expanded( // );
// child: Text( // },
// "password".i18n, // );
// maxLines: 1, // }).toList(),
// style: TextStyle(
// color: AppColors.of(context)
// .loginPrimary,
// fontWeight: FontWeight.w500,
// fontSize: 12.0,
// ),
// ),
// ),
// Expanded(
// child: Text(
// "passwordHint".i18n,
// maxLines: 1,
// textAlign: TextAlign.right,
// style: TextStyle(
// color: AppColors.of(context)
// .loginSecondary,
// fontWeight: FontWeight.w500,
// fontSize: 12.0,
// ),
// ),
// ),
// ],
// ),
// ),
// Padding(
// padding:
// const EdgeInsets.only(bottom: 12.0),
// child: LoginInput(
// style: LoginInputStyle.password,
// controller: passwordController,
// ),
// ),
// // school
// Padding(
// padding:
// const EdgeInsets.only(bottom: 6.0),
// child: Text(
// "school".i18n,
// maxLines: 1,
// style: TextStyle(
// color: AppColors.of(context)
// .loginPrimary,
// fontWeight: FontWeight.w500,
// fontSize: 12.0,
// ),
// ),
// ),
// SchoolInput(
// scroll: _scrollController,
// controller: schoolController,
// ),
// ],
// ),
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(
// top: 35.0,
// left: 22.0,
// right: 22.0,
// ),
// child: Visibility(
// visible: _loginState != LoginState.inProgress,
// replacement: const Padding(
// padding: EdgeInsets.symmetric(vertical: 6.0),
// child: CircularProgressIndicator(
// valueColor: AlwaysStoppedAnimation<Color>(
// Colors.white),
// ),
// ),
// child: LoginButton(
// child: Text("login".i18n,
// maxLines: 1,
// style: const TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 20.0,
// )),
// onPressed: () => _loginAPI(context: context),
// ),
// ),
// ), // ),
// ], // ],
// ), // ),
// Container(
// height: 250,
// width: double.infinity,
// decoration: const BoxDecoration(
// gradient: LinearGradient(
// colors: [Color(0x00DAE4F7), Color(0xFFDAE4F7)],
// stops: [0, 0.1],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// ),
// ),
// child: Padding(
// padding: const EdgeInsets.only(top: 3),
// child: Column(
// children: [
// SizedBox(
// height: 48,
// width: double.infinity,
// child: Padding(
// padding: const EdgeInsets.symmetric(
// horizontal: 16),
// child: FilledButton(
// style: ButtonStyle(
// shape: MaterialStateProperty.all<
// RoundedRectangleBorder>(
// const RoundedRectangleBorder(
// borderRadius: BorderRadius.all(
// Radius.circular(12)),
// ))),
// onPressed: () {},
// child: Text(
// "login".i18n,
// style: const TextStyle(
// fontFamily: 'Montserrat',
// fontSize: 20,
// fontWeight: FontWeight.w700),
// )),
// ),
// ),
// const SizedBox(height: 8),
// ],
// ),
// ),
// )
//
//
// TODO: OLD LOGIN FROM HERE
Column(
//login buttons and ui starts here
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.only(
left: 22.0,
right: 22.0,
top: 0.0,
),
child: AutofillGroup(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
// username
Padding(
padding:
const EdgeInsets.only(bottom: 6.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
"username".i18n,
maxLines: 1,
style: TextStyle(
color: AppColors.of(context)
.loginPrimary,
fontWeight: FontWeight.w500,
fontSize: 12.0,
),
),
),
Expanded(
child: Text(
"usernameHint".i18n,
maxLines: 1,
textAlign: TextAlign.right,
style: TextStyle(
color: AppColors.of(context)
.loginSecondary,
fontWeight: FontWeight.w500,
fontSize: 12.0,
),
),
),
],
),
),
Padding(
padding:
const EdgeInsets.only(bottom: 12.0),
child: LoginInput(
style: LoginInputStyle.username,
controller: usernameController,
),
),
// password
Padding(
padding:
const EdgeInsets.only(bottom: 6.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
"password".i18n,
maxLines: 1,
style: TextStyle(
color: AppColors.of(context)
.loginPrimary,
fontWeight: FontWeight.w500,
fontSize: 12.0,
),
),
),
Expanded(
child: Text(
"passwordHint".i18n,
maxLines: 1,
textAlign: TextAlign.right,
style: TextStyle(
color: AppColors.of(context)
.loginSecondary,
fontWeight: FontWeight.w500,
fontSize: 12.0,
),
),
),
],
),
),
Padding(
padding:
const EdgeInsets.only(bottom: 12.0),
child: LoginInput(
style: LoginInputStyle.password,
controller: passwordController,
),
),
// school
Padding(
padding:
const EdgeInsets.only(bottom: 6.0),
child: Text(
"school".i18n,
maxLines: 1,
style: TextStyle(
color: AppColors.of(context)
.loginPrimary,
fontWeight: FontWeight.w500,
fontSize: 12.0,
),
),
),
SchoolInput(
scroll: _scrollController,
controller: schoolController,
),
],
),
),
),
Padding(
padding: const EdgeInsets.only(
top: 35.0,
left: 22.0,
right: 22.0,
),
child: Visibility(
visible: _loginState != LoginState.inProgress,
replacement: const Padding(
padding: EdgeInsets.symmetric(vertical: 6.0),
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(
Colors.white),
),
),
child: LoginButton(
child: Text("login".i18n,
maxLines: 1,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
)),
onPressed: () => _loginAPI(context: context),
),
),
),
],
),
// TODO: OLD LOGIN FROM HERE
], ],
), ),