Merge branch 'dev' of https://github.com/refilc/naplo into dev
This commit is contained in:
commit
ab56de53eb
@ -83,7 +83,8 @@ class AppTheme {
|
||||
accentColor == AccentColor.ogfilc) ||
|
||||
!settings.newColors
|
||||
? accent
|
||||
: ColorsUtils().darken(accent, amount: 0.5);
|
||||
: ColorsUtils().darken(accent,
|
||||
amount: 0.4); // white mode: same tertiary as secondary
|
||||
|
||||
return ThemeData(
|
||||
brightness: Brightness.light,
|
||||
@ -186,14 +187,15 @@ class AppTheme {
|
||||
accentColor == AccentColor.ogfilc) ||
|
||||
!settings.newColors
|
||||
? accent
|
||||
: ColorsUtils().lighten(accent, amount: 0.1);
|
||||
: ColorsUtils().lighten(accent, amount: 0.3);
|
||||
// Color newScaffoldBg = ColorsUtils().lighten(accent, amount: 0.4);
|
||||
Color newTertiary = (accentColor == AccentColor.adaptive ||
|
||||
accentColor == AccentColor.custom ||
|
||||
accentColor == AccentColor.ogfilc) ||
|
||||
!settings.newColors
|
||||
? accent
|
||||
: ColorsUtils().lighten(accent, amount: 0.4);
|
||||
: ColorsUtils().darken(accent,
|
||||
amount: 0.1); // dark mode: tertiary is way darker than secondary
|
||||
|
||||
return ThemeData(
|
||||
brightness: Brightness.dark,
|
||||
|
@ -17,16 +17,26 @@ import 'package:provider/provider.dart';
|
||||
import 'lesson_tile.i18n.dart';
|
||||
|
||||
class LessonTile extends StatelessWidget {
|
||||
const LessonTile(this.lesson,
|
||||
{super.key,
|
||||
const LessonTile(
|
||||
this.lesson, {
|
||||
super.key,
|
||||
this.onTap,
|
||||
this.swapDesc = false,
|
||||
this.subjectPageView = false});
|
||||
this.subjectPageView = false,
|
||||
this.swapRoom = false,
|
||||
this.currentLessonIndicator = true,
|
||||
this.padding,
|
||||
this.contentPadding,
|
||||
});
|
||||
|
||||
final Lesson lesson;
|
||||
final bool swapDesc;
|
||||
final void Function()? onTap;
|
||||
final bool subjectPageView;
|
||||
final bool swapRoom;
|
||||
final bool currentLessonIndicator;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final EdgeInsetsGeometry? contentPadding;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -128,7 +138,7 @@ class LessonTile extends StatelessWidget {
|
||||
// }
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 4.0, top: 7.0),
|
||||
padding: padding ?? const EdgeInsets.only(bottom: 4.0, top: 7.0),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
@ -149,7 +159,8 @@ class LessonTile extends StatelessWidget {
|
||||
onTap: onTap,
|
||||
// onLongPress: kDebugMode ? () => log(jsonEncode(lesson.json)) : null,
|
||||
visualDensity: VisualDensity.compact,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 4.0),
|
||||
contentPadding: contentPadding ??
|
||||
const EdgeInsets.symmetric(horizontal: 4.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0)),
|
||||
title: !subjectPageView
|
||||
@ -222,7 +233,37 @@ class LessonTile extends StatelessWidget {
|
||||
// const SizedBox(
|
||||
// height: 10.0,
|
||||
// ),
|
||||
if (cleanDesc != '')
|
||||
if (swapRoom)
|
||||
Container(
|
||||
width: lesson.room.length > 20 ? 111 : null,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5.5, vertical: 3.0),
|
||||
decoration: BoxDecoration(
|
||||
color: fill
|
||||
? accent.withOpacity(.15)
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.15),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Text(
|
||||
lesson.room,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
height: 1.1,
|
||||
fontSize: 12.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: fill
|
||||
? accent.withOpacity(0.9)
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.9),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (cleanDesc != '' && !swapRoom)
|
||||
Text(
|
||||
cleanDesc,
|
||||
maxLines: 1,
|
||||
@ -288,6 +329,7 @@ class LessonTile extends StatelessWidget {
|
||||
// ),
|
||||
|
||||
// Current lesson indicator
|
||||
if (currentLessonIndicator)
|
||||
Transform.translate(
|
||||
offset: const Offset(-22.0, -1.0),
|
||||
child: Container(
|
||||
@ -310,7 +352,8 @@ class LessonTile extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
margin: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
margin:
|
||||
const EdgeInsets.symmetric(vertical: 4.0),
|
||||
width: 4.0,
|
||||
height: double.infinity,
|
||||
),
|
||||
@ -342,6 +385,7 @@ class LessonTile extends StatelessWidget {
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
if (!swapRoom)
|
||||
Container(
|
||||
width: lesson.room.length > 20 ? 111 : null,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
@ -61,7 +61,7 @@ class _FilterBarState extends State<FilterBar> {
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
indicatorPadding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
indicator: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondary.withOpacity(.2),
|
||||
color: Theme.of(context).colorScheme.tertiary.withOpacity(.2),
|
||||
borderRadius: BorderRadius.circular(45.0),
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(const Color(0x00000000)),
|
||||
|
@ -58,7 +58,7 @@ class ProfileButton extends StatelessWidget {
|
||||
return ProfileImage(
|
||||
backgroundColor: !pMode
|
||||
? child.backgroundColor
|
||||
: Theme.of(context).colorScheme.secondary,
|
||||
: Theme.of(context).colorScheme.tertiary,
|
||||
heroTag: child.heroTag,
|
||||
key: child.key,
|
||||
name: !pMode ? child.name : "János",
|
||||
|
@ -89,7 +89,7 @@ class _ProfileImageState extends State<ProfileImage> {
|
||||
clipBehavior: Clip.hardEdge,
|
||||
shape: const CircleBorder(),
|
||||
color: widget.name != null && widget.name! == 'Rendszerüzenet'
|
||||
? widget.backgroundColor?.withOpacity(0.5) ??
|
||||
? widget.backgroundColor?.withOpacity(0.8) ??
|
||||
AppColors.of(context).text.withOpacity(0.5)
|
||||
: widget.backgroundColor ??
|
||||
AppColors.of(context).text.withOpacity(.15),
|
||||
|
@ -165,7 +165,7 @@ class AbsencesPageState extends State<AbsencesPage>
|
||||
name: firstName,
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
.tertiary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
badge: updateProvider.available,
|
||||
role: user.role,
|
||||
profilePictureString: user.picture,
|
||||
|
@ -147,8 +147,8 @@ class _GradeSubjectViewState extends State<GradeSubjectView>
|
||||
),
|
||||
));
|
||||
|
||||
tiles.addAll(
|
||||
[
|
||||
if (!gradeCalcMode) {
|
||||
tiles.addAll([
|
||||
const SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
@ -162,8 +162,8 @@ class _GradeSubjectViewState extends State<GradeSubjectView>
|
||||
controller: _tabController,
|
||||
disableFading: true,
|
||||
),
|
||||
],
|
||||
);
|
||||
]);
|
||||
}
|
||||
|
||||
if (showGraph(subjectGrades) && _tabController.index == 0) {
|
||||
tiles.add(gradeGraph);
|
||||
@ -380,13 +380,31 @@ class _GradeSubjectViewState extends State<GradeSubjectView>
|
||||
.where((e) => e.type == GradeType.midYear)
|
||||
.isNotEmpty,
|
||||
child: ExpandableFab(
|
||||
openButtonBuilder: FloatingActionButtonBuilder(
|
||||
size: 20.0,
|
||||
builder: (context, onPressed, progress) =>
|
||||
FloatingActionButton.small(
|
||||
onPressed: onPressed,
|
||||
backgroundColor: Theme.of(context).colorScheme.tertiary,
|
||||
child: const Icon(Icons.more_horiz_outlined),
|
||||
),
|
||||
),
|
||||
closeButtonBuilder: FloatingActionButtonBuilder(
|
||||
size: 20.0,
|
||||
builder: (context, onPressed, progress) =>
|
||||
FloatingActionButton.small(
|
||||
onPressed: onPressed,
|
||||
backgroundColor: Theme.of(context).colorScheme.tertiary,
|
||||
child: const Icon(Icons.close),
|
||||
),
|
||||
),
|
||||
type: ExpandableFabType.up,
|
||||
distance: 50,
|
||||
childrenOffset: const Offset(-3.8, 0.0),
|
||||
// childrenOffset: const Offset(-8.8, 0.0),
|
||||
children: [
|
||||
FloatingActionButton.small(
|
||||
heroTag: "btn_ghost_grades",
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor: Theme.of(context).colorScheme.tertiary,
|
||||
onPressed: () {
|
||||
gradeCalc(context);
|
||||
},
|
||||
@ -394,7 +412,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView>
|
||||
),
|
||||
FloatingActionButton.small(
|
||||
heroTag: "btn_goal_planner",
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor: Theme.of(context).colorScheme.tertiary,
|
||||
onPressed: () {
|
||||
// if (!Provider.of<PlusProvider>(context, listen: false)
|
||||
// .hasScope(PremiumScopes.goalPlanner)) {
|
||||
@ -533,6 +551,10 @@ class _GradeSubjectViewState extends State<GradeSubjectView>
|
||||
elevation: 12.0,
|
||||
);
|
||||
|
||||
// set tab
|
||||
int tabIndex = _tabController.index;
|
||||
_tabController.animateTo(0);
|
||||
|
||||
// Hide the fab and grades
|
||||
setState(() {
|
||||
gradeCalcMode = true;
|
||||
@ -541,6 +563,9 @@ class _GradeSubjectViewState extends State<GradeSubjectView>
|
||||
_sheetController!.closed.then((value) {
|
||||
// Show fab and grades
|
||||
if (mounted) {
|
||||
// set tab
|
||||
_tabController.animateTo(tabIndex);
|
||||
|
||||
setState(() {
|
||||
gradeCalcMode = false;
|
||||
});
|
||||
|
@ -546,7 +546,7 @@ class GradesPageState extends State<GradesPage> {
|
||||
name: firstName,
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
.tertiary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
badge: updateProvider.available,
|
||||
role: user.role,
|
||||
profilePictureString: user.picture,
|
||||
|
@ -212,6 +212,10 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
// currentState = LiveCardState.empty;
|
||||
// }
|
||||
|
||||
// TODO: REMOVE IN PRODUCTION BUILD!!!
|
||||
print(_liveCard.currentState);
|
||||
_liveCard.currentState = LiveCardState.morning;
|
||||
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
@ -307,7 +311,7 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
name: firstName,
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary, //!settings.presentationMode
|
||||
.tertiary, //!settings.presentationMode
|
||||
//? ColorUtils.stringToColor(user.displayName ?? "?")
|
||||
//: Theme.of(context).colorScheme.secondary,
|
||||
badge: updateProvider.available,
|
||||
@ -321,8 +325,11 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
// expandedHeight: _liveCardAnimation.value * 238.0,
|
||||
expandedHeight: _liveCardAnimation.value *
|
||||
(_liveCard.currentState == LiveCardState.morning
|
||||
? 280.0
|
||||
: 238.0),
|
||||
? 274.0
|
||||
: (_liveCard.currentState ==
|
||||
LiveCardState.duringLesson
|
||||
? 288.0
|
||||
: 238.0)),
|
||||
|
||||
// Live Card
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
@ -330,12 +337,17 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
padding: EdgeInsets.only(
|
||||
left: 24.0,
|
||||
right: 24.0,
|
||||
top: (_liveCard.currentState ==
|
||||
LiveCardState.morning
|
||||
top: ((_liveCard.currentState ==
|
||||
LiveCardState.morning ||
|
||||
_liveCard.currentState ==
|
||||
LiveCardState.duringLesson)
|
||||
? 0.0
|
||||
: 62.0) +
|
||||
MediaQuery.of(context).padding.top,
|
||||
bottom: 52.0,
|
||||
bottom: _liveCard.currentState ==
|
||||
LiveCardState.morning
|
||||
? 44.0
|
||||
: 52.0,
|
||||
),
|
||||
child: Transform.scale(
|
||||
scale: _liveCardAnimation.value,
|
||||
|
@ -1,8 +1,17 @@
|
||||
// ignore_for_file: unnecessary_null_comparison
|
||||
|
||||
import 'package:animations/animations.dart';
|
||||
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/theme/colors/colors.dart';
|
||||
import 'package:refilc/ui/widgets/lesson/lesson_tile.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/progress_bar.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';
|
||||
@ -60,28 +69,31 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
Duration bellDelay = liveCard.delay;
|
||||
|
||||
// test
|
||||
// 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',
|
||||
// );
|
||||
// TODO: REMOVE IN PRODUCTION BUILD!!!
|
||||
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: '1',
|
||||
teacher: Teacher(id: 'id', name: 'name'),
|
||||
start: DateTime.now().subtract(Duration(
|
||||
minutes: 30,
|
||||
)),
|
||||
end: DateTime.now().add(Duration(
|
||||
minutes: 15,
|
||||
)),
|
||||
homeworkId: 'homeworkId',
|
||||
id: 'id',
|
||||
description: 'description',
|
||||
room: 'ABC69',
|
||||
groupName: 'groupName',
|
||||
name: 'name',
|
||||
);
|
||||
|
||||
// liveCard.nextLesson = liveCard.currentLesson;
|
||||
|
||||
// final dt = DateTime(2024, 3, 22, 17, 12, 1, 1, 1);
|
||||
|
||||
@ -323,41 +335,234 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
|
||||
final showMinutes = maxTime - elapsedTime > 60;
|
||||
|
||||
// child = LiveCardWidget(
|
||||
// key: const Key('livecard.duringLesson'),
|
||||
// liveCardState: liveCard.currentState,
|
||||
// leading: liveCard.currentLesson!.lessonIndex +
|
||||
// (RegExp(r'\d').hasMatch(liveCard.currentLesson!.lessonIndex)
|
||||
// ? "."
|
||||
// : ""),
|
||||
// title: liveCard.currentLesson!.subject.renamedTo ??
|
||||
// liveCard.currentLesson!.subject.name.capital(),
|
||||
// titleItalic: liveCard.currentLesson!.subject.isRenamed &&
|
||||
// settingsProvider.renamedSubjectsEnabled &&
|
||||
// settingsProvider.renamedSubjectsItalics,
|
||||
// subtitle: liveCard.currentLesson!.room,
|
||||
// icon: SubjectIcon.resolveVariant(
|
||||
// subject: liveCard.currentLesson!.subject, context: context),
|
||||
// description: liveCard.currentLesson!.description != ""
|
||||
// ? Text(liveCard.currentLesson!.description)
|
||||
// : null,
|
||||
// nextSubject: liveCard.nextLesson?.subject.renamedTo ??
|
||||
// liveCard.nextLesson?.subject.name.capital(),
|
||||
// nextSubjectItalic: liveCard.nextLesson?.subject.isRenamed == true &&
|
||||
// settingsProvider.renamedSubjectsEnabled &&
|
||||
// settingsProvider.renamedSubjectsItalics,
|
||||
// nextRoom: liveCard.nextLesson?.room,
|
||||
// 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 titleItalic = liveCard.currentLesson!.subject.isRenamed &&
|
||||
// settingsProvider.renamedSubjectsEnabled &&
|
||||
// settingsProvider.renamedSubjectsItalics;
|
||||
var nextSubject = liveCard.nextLesson?.subject.renamedTo ??
|
||||
liveCard.nextLesson?.subject.name.capital();
|
||||
var nextSubjectItalic =
|
||||
liveCard.nextLesson?.subject.isRenamed == true &&
|
||||
settingsProvider.renamedSubjectsEnabled &&
|
||||
settingsProvider.renamedSubjectsItalics;
|
||||
var progressMax = showMinutes ? maxTime / 60 : maxTime;
|
||||
var progressCurrent = showMinutes ? elapsedTime / 60 : elapsedTime;
|
||||
var progressAccuracy =
|
||||
showMinutes ? ProgressAccuracy.minutes : ProgressAccuracy.seconds;
|
||||
|
||||
child = LiveCardWidget(
|
||||
key: const Key('livecard.duringLesson'),
|
||||
leading: liveCard.currentLesson!.lessonIndex +
|
||||
(RegExp(r'\d').hasMatch(liveCard.currentLesson!.lessonIndex)
|
||||
? "."
|
||||
: ""),
|
||||
title: liveCard.currentLesson!.subject.renamedTo ??
|
||||
liveCard.currentLesson!.subject.name.capital(),
|
||||
titleItalic: liveCard.currentLesson!.subject.isRenamed &&
|
||||
settingsProvider.renamedSubjectsEnabled &&
|
||||
settingsProvider.renamedSubjectsItalics,
|
||||
subtitle: liveCard.currentLesson!.room,
|
||||
icon: SubjectIcon.resolveVariant(
|
||||
subject: liveCard.currentLesson!.subject, context: context),
|
||||
description: liveCard.currentLesson!.description != ""
|
||||
? Text(liveCard.currentLesson!.description)
|
||||
: null,
|
||||
nextSubject: liveCard.nextLesson?.subject.renamedTo ??
|
||||
liveCard.nextLesson?.subject.name.capital(),
|
||||
nextSubjectItalic: liveCard.nextLesson?.subject.isRenamed == true &&
|
||||
settingsProvider.renamedSubjectsEnabled &&
|
||||
settingsProvider.renamedSubjectsItalics,
|
||||
nextRoom: liveCard.nextLesson?.room,
|
||||
progressMax: showMinutes ? maxTime / 60 : maxTime,
|
||||
progressCurrent: showMinutes ? elapsedTime / 60 : elapsedTime,
|
||||
progressAccuracy:
|
||||
showMinutes ? ProgressAccuracy.minutes : ProgressAccuracy.seconds,
|
||||
onProgressTap: () {
|
||||
children: liveCard.currentLesson != null
|
||||
? [
|
||||
SplittedPanel(
|
||||
hasShadow: false,
|
||||
padding: EdgeInsets.zero,
|
||||
cardPadding: EdgeInsets.zero,
|
||||
spacing: 8.0,
|
||||
children: [
|
||||
SplittedPanel(
|
||||
hasShadow: false,
|
||||
isTransparent: true,
|
||||
padding: EdgeInsets.zero,
|
||||
cardPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 12.0,
|
||||
vertical: 0.0,
|
||||
),
|
||||
spacing: 0.0,
|
||||
children: [
|
||||
LessonTile(
|
||||
liveCard.currentLesson!,
|
||||
swapRoom: true,
|
||||
currentLessonIndicator: false,
|
||||
padding:
|
||||
const EdgeInsets.only(top: 8.0, bottom: 4.0),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
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),
|
||||
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
|
||||
? [
|
||||
Container(
|
||||
width: (liveCard.nextLesson?.room
|
||||
.length ??
|
||||
0) >
|
||||
20
|
||||
? 111
|
||||
: null,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5.5, vertical: 3.0),
|
||||
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(
|
||||
height: 1.1,
|
||||
fontSize: 12.0,
|
||||
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,
|
||||
),
|
||||
),
|
||||
]
|
||||
: [],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
||||
: null,
|
||||
);
|
||||
break;
|
||||
case LiveCardState.duringBreak:
|
||||
|
@ -23,6 +23,7 @@ extension Localization on String {
|
||||
"s": "sec(s)",
|
||||
// v5
|
||||
"first_lesson_soon": "Your first lesson starts soon!",
|
||||
"go_home": "You've no more lessons today",
|
||||
},
|
||||
"hu_hu": {
|
||||
"next": "Következő",
|
||||
@ -44,6 +45,7 @@ extension Localization on String {
|
||||
"s": "másodperc",
|
||||
// v5
|
||||
"first_lesson_soon": "Hamarosan kezdődik az első órád!",
|
||||
"go_home": "Ma már nincs több órád",
|
||||
},
|
||||
"de_de": {
|
||||
"next": "Nächste",
|
||||
@ -65,6 +67,7 @@ extension Localization on String {
|
||||
"s": "Sekunde",
|
||||
// v5
|
||||
"first_lesson_soon": "Ihre erste Unterrichtsstunde beginnt bald!",
|
||||
"go_home": "Sie haben heute keinen Unterricht mehr",
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
import 'package:refilc/api/providers/live_card_provider.dart';
|
||||
import 'package:refilc/models/settings.dart';
|
||||
import 'package:refilc/theme/colors/colors.dart';
|
||||
import 'package:refilc_mobile_ui/common/progress_bar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:refilc_mobile_ui/pages/home/live_card/live_card.dart';
|
||||
import 'live_card.i18n.dart';
|
||||
|
||||
enum ProgressAccuracy { minutes, seconds }
|
||||
|
@ -105,7 +105,7 @@ class MessagesPageState extends State<MessagesPage>
|
||||
name: firstName,
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
.tertiary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
badge: updateProvider.available,
|
||||
role: user.role,
|
||||
profilePictureString: user.picture,
|
||||
|
@ -251,7 +251,7 @@ class NotesPageState extends State<NotesPage> with TickerProviderStateMixin {
|
||||
name: firstName,
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
.tertiary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
badge: updateProvider.available,
|
||||
role: user.role,
|
||||
profilePictureString: user.picture,
|
||||
|
@ -283,7 +283,7 @@ class TimetablePageState extends State<TimetablePage>
|
||||
name: firstName,
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
.tertiary, //ColorUtils.stringToColor(user.displayName ?? "?"),
|
||||
badge: updateProvider.available,
|
||||
role: user.role,
|
||||
profilePictureString: user.picture,
|
||||
|
@ -18,6 +18,7 @@ class PlusPlanCard extends StatelessWidget {
|
||||
this.active = false,
|
||||
this.borderRadius,
|
||||
this.features = const [],
|
||||
required this.docsAccepted,
|
||||
});
|
||||
|
||||
final String iconPath;
|
||||
@ -30,11 +31,25 @@ class PlusPlanCard extends StatelessWidget {
|
||||
final bool active;
|
||||
final BorderRadiusGeometry? borderRadius;
|
||||
final List<List<String>> features;
|
||||
final bool docsAccepted;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (!docsAccepted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content: Text(
|
||||
"El kell fogadnod az ÁSZF-et és az Adatkezelési Tájékoztatót!",
|
||||
style:
|
||||
TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (Provider.of<PlusProvider>(context, listen: false).hasPremium) {
|
||||
if (!active) {
|
||||
launchUrl(
|
||||
|
@ -25,6 +25,7 @@ class PlusScreenState extends State<PlusScreen> {
|
||||
}
|
||||
|
||||
bool showLifetime = false;
|
||||
bool docsAccepted = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -226,6 +227,7 @@ class PlusScreenState extends State<PlusScreen> {
|
||||
['👑', 'rfp_15'.i18n],
|
||||
['🔜', 'more_soon'.i18n],
|
||||
],
|
||||
docsAccepted: docsAccepted,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12.0,
|
||||
@ -259,6 +261,7 @@ class PlusScreenState extends State<PlusScreen> {
|
||||
const ['🖋️', 'cap_tier_benefits'],
|
||||
['🔜', 'more_soon'.i18n],
|
||||
],
|
||||
docsAccepted: docsAccepted,
|
||||
),
|
||||
// const SizedBox(
|
||||
// height: 8.0,
|
||||
@ -373,6 +376,50 @@ class PlusScreenState extends State<PlusScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
// aszf warning
|
||||
const SizedBox(
|
||||
height: 18.0,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
border: Border.all(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
),
|
||||
),
|
||||
child: CheckboxListTile(
|
||||
contentPadding:
|
||||
const EdgeInsets.only(left: 15.0, right: 10.0),
|
||||
value: docsAccepted,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
docsAccepted = !docsAccepted;
|
||||
});
|
||||
},
|
||||
// title: Text(
|
||||
// 'show_lifetime'.i18n,
|
||||
// style: const TextStyle(
|
||||
// color: Colors.black,
|
||||
// fontWeight: FontWeight.w500,
|
||||
// ),
|
||||
// ),
|
||||
subtitle: const Text(
|
||||
'Elfogadod a reFilc előfizetésekkel kapcsolatos Általános Szerződési Feltételeit (elérhető az alábbi link-en: filc.one/pay-terms), valamint Adatkezelési Tájékoztatónkat (elérhető az alábbi link-en: filc.one/pay-privacy)?',
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
),
|
||||
),
|
||||
// CheckboxListTile(value: false, onChanged: onChanged)
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
||||
// child: Text(
|
||||
// 'A szolgáltatási csomag kiválasztásával (megérintés) elfogadod a reFilc előfizetésekkel kapcsolatos Általános Szerződési Feltételeit (elérhető az alábbi link-en: filc.one/pay-terms), valamint Adatkezelési Tájékoztatónkat (elérhető az alábbi link-en: filc.one/pay-privacy).',
|
||||
// textAlign: TextAlign.justify,
|
||||
// style:
|
||||
// TextStyle(color: Colors.black.withOpacity(0.9)),
|
||||
// ),
|
||||
// ),
|
||||
// faq section
|
||||
const SizedBox(
|
||||
height: 30.0,
|
||||
|
@ -34,7 +34,7 @@ class NavbarItem extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
decoration: BoxDecoration(
|
||||
color: active
|
||||
? Theme.of(context).colorScheme.secondary.withOpacity(.2)
|
||||
? Theme.of(context).colorScheme.tertiary.withOpacity(.2)
|
||||
: null,
|
||||
borderRadius: BorderRadius.circular(14.0),
|
||||
),
|
||||
|
@ -30,7 +30,7 @@ class AccountView extends StatelessWidget {
|
||||
AccountTile(
|
||||
profileImage: ProfileImage(
|
||||
name: _firstName,
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor: Theme.of(context).colorScheme.tertiary,
|
||||
role: user.role,
|
||||
),
|
||||
name: SelectableText(
|
||||
|
@ -136,7 +136,7 @@ class SettingsScreenState extends State<SettingsScreen>
|
||||
profilePictureString: account.picture,
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary, //!settings.presentationMode
|
||||
.tertiary, //!settings.presentationMode
|
||||
//? ColorUtils.stringToColor(account.name)
|
||||
//: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
@ -322,7 +322,7 @@ class SettingsScreenState extends State<SettingsScreen>
|
||||
profilePictureString: user.picture,
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary, //!settings.presentationMode
|
||||
.tertiary, //!settings.presentationMode
|
||||
//? ColorUtils.stringToColor(user.displayName ?? "?")
|
||||
//: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user