From dfa4619e5c314530248888ebfb2a8172b9ee1f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Bujnovsk=C3=BD?= <2659269+miakh@users.noreply.github.com> Date: Sat, 28 Dec 2024 21:11:22 +0100 Subject: [PATCH 1/5] production update --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d9bb75a3..8bfd7277 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,9 @@ Both technologies were chosen to speed up development, and they have effectively - [BISCUP](https://biscup.netlify.app) - [Celostátní setkání animátorů 2024](https://aksmcz.netlify.app) - [Festival Slunovrat](https://app.festivalslunovrat.cz) +- [Hvězda mořská](https://hvezdamorska.netlify.app) -Links to phone install are usually saved in info section. +Under similar names usually available in AppStore and Google Play Store. --- ## Latest development From bd112134b2ccb5285a151bfb1a8b1542959291b7 Mon Sep 17 00:00:00 2001 From: miakh <2659269+miakh@users.noreply.github.com> Date: Sun, 29 Dec 2024 04:21:22 +0100 Subject: [PATCH 2/5] abstract to enable uppercase --- lib/components/timeline/ScheduleTimeline.dart | 5 +++-- lib/styles/StylesConfig.dart | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/components/timeline/ScheduleTimeline.dart b/lib/components/timeline/ScheduleTimeline.dart index c3df231a..29f71661 100644 --- a/lib/components/timeline/ScheduleTimeline.dart +++ b/lib/components/timeline/ScheduleTimeline.dart @@ -1,6 +1,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:fstapp/components/timeline/ScheduleTimelineHelper.dart'; +import 'package:fstapp/services/StylesHelper.dart'; import 'package:fstapp/styles/StylesConfig.dart'; import 'package:fstapp/themeConfig.dart'; import 'package:timelines_plus/timelines_plus.dart'; @@ -45,7 +46,7 @@ class _ScheduleTimelineState extends State { child: Padding( padding: const EdgeInsets.fromLTRB(36, 18, 0, 12), child: Text( - group.title, + StylesConfig.formatTimelineSplit(group.title), style: StylesConfig.timeLineSplitTextStyle(context), ), ), @@ -124,7 +125,7 @@ class _ScheduleTimelineState extends State { alignment: Alignment.centerLeft, ), child: Text( - event.data["rightText"], + StylesConfig.formatTimelineRightText(event.data["rightText"]), style: StylesConfig.timeLineSmallTextStyle, ), ); diff --git a/lib/styles/StylesConfig.dart b/lib/styles/StylesConfig.dart index 6314f250..6610f492 100644 --- a/lib/styles/StylesConfig.dart +++ b/lib/styles/StylesConfig.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:fstapp/components/timeline/ScheduleTimelineHelper.dart'; import 'package:fstapp/services/TimeHelper.dart'; import 'package:fstapp/themeConfig.dart'; import 'package:intl/intl.dart'; @@ -38,4 +39,12 @@ class StylesConfig { static String formatDateTimeForTab(BuildContext context, DateTime time){ return time.weekdayToString(context); } + + static String formatTimelineSplit(String string){ + return string; + } + + static String formatTimelineRightText(String string){ + return string; + } } \ No newline at end of file From 52d6f0857a4ddddb60cb32128c8fb71719539301 Mon Sep 17 00:00:00 2001 From: miakh <2659269+miakh@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:23:19 +0100 Subject: [PATCH 3/5] timetable background outside --- .../timeline/ScheduleTimelineHelper.dart | 2 +- lib/components/timetable/Timetable.dart | 3 - lib/pages/TimetablePage.dart | 63 ++++++++++--------- lib/themeConfig.dart | 1 + 4 files changed, 34 insertions(+), 35 deletions(-) diff --git a/lib/components/timeline/ScheduleTimelineHelper.dart b/lib/components/timeline/ScheduleTimelineHelper.dart index 6ea99663..2cb29a26 100644 --- a/lib/components/timeline/ScheduleTimelineHelper.dart +++ b/lib/components/timeline/ScheduleTimelineHelper.dart @@ -93,7 +93,7 @@ class TimeBlockHelper { } static List splitTimeBlocksByDate( - Iterable events, BuildContext context, int splitHour) { + List events, BuildContext context, int splitHour) { List toReturn = []; if (events.isEmpty) { return toReturn; diff --git a/lib/components/timetable/Timetable.dart b/lib/components/timetable/Timetable.dart index 6985c189..357656c7 100644 --- a/lib/components/timetable/Timetable.dart +++ b/lib/components/timetable/Timetable.dart @@ -1,7 +1,4 @@ -import 'dart:ui'; - import 'package:flutter/gestures.dart'; -import 'package:fstapp/appConfig.dart'; import 'package:fstapp/components/timeline/ScheduleTimelineHelper.dart'; import 'package:fstapp/dataServices/DbEvents.dart'; import 'package:fstapp/services/TimeHelper.dart'; diff --git a/lib/pages/TimetablePage.dart b/lib/pages/TimetablePage.dart index a5b952e0..085d4b9a 100644 --- a/lib/pages/TimetablePage.dart +++ b/lib/pages/TimetablePage.dart @@ -50,35 +50,35 @@ class _TimetablePageState extends State Future loadData() async { await loadDataOffline(); - await DbEvents.updateEvents(_events).whenComplete(() async { - var placeIds = _events - .map((e) => e.place?.id) - .where((id) => id != null) - .cast() - .toSet() - .toList(); - - var places = await DbPlaces.getPlacesIn(placeIds); - - var timetablePlaces = List.from(places - .where((element) => !element.isHidden) - .map((x) => TimeBlockPlace.fromPlaceModel(x))); - _timetablePlaces.clear(); - _timetablePlaces.addAll(timetablePlaces); - - _items.clear(); - _items.addAll(_events - .timetableEventsFilter(Timetable.minimalDurationMinutes) - .map((e) => TimeBlockItem.fromEventModelForTimeTable(e))); - - timetableController.rebuild?.call(); - - _days.clear(); - _days.addAll(TimeBlockHelper.splitTimeBlocksByDate(_items, context, AppConfig.daySplitHour)); - setupTabController(_days); - await loadEventParticipants(); - await DbEvents.synchronizeMySchedule(); - }); + await DbEvents.updateEvents(_events); + + var placeIds = _events + .map((e) => e.place?.id) + .where((id) => id != null) + .cast() + .toSet() + .toList(); + + var places = await DbPlaces.getPlacesIn(placeIds); + + var timetablePlaces = List.from(places + .where((element) => !element.isHidden) + .map((x) => TimeBlockPlace.fromPlaceModel(x))); + _timetablePlaces.clear(); + _timetablePlaces.addAll(timetablePlaces); + + _items.clear(); + _items.addAll(_events + .timetableEventsFilter(Timetable.minimalDurationMinutes) + .map((e) => TimeBlockItem.fromEventModelForTimeTable(e))); + + timetableController.rebuild?.call(); + + _days.clear(); + _days.addAll(TimeBlockHelper.splitTimeBlocksByDate(_items, context, AppConfig.daySplitHour)); + setupTabController(_days); + await loadEventParticipants(); + await DbEvents.synchronizeMySchedule(); } String TimetableDateFormat(DateTime e) => @@ -145,13 +145,14 @@ class _TimetablePageState extends State @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: ThemeConfig.timetableBackgroundOutside(context), appBar: AppBar( title: Text("Schedule".tr()), leading: PopButton(), bottom: PreferredSize( preferredSize: const Size.fromHeight(40), child: Builder(builder: (context) { - if (_days.isEmpty) { + if (_days.isEmpty || _events.isEmpty) { return const SizedBox.shrink(); } return Align( @@ -195,7 +196,7 @@ class _TimetablePageState extends State ), ], ), - body: Timetable( + body: _days.isEmpty || _events.isEmpty ? SizedBox.shrink() : Timetable( controller: timetableController, items: _days[_currentIndex??0].events, timetablePlaces: _timetablePlaces)); diff --git a/lib/themeConfig.dart b/lib/themeConfig.dart index 7e45da74..d6957c49 100644 --- a/lib/themeConfig.dart +++ b/lib/themeConfig.dart @@ -99,6 +99,7 @@ class ThemeConfig { static Color timetableTimeSplitColor(BuildContext context) => Colors.red; static Color timetableBackground1(BuildContext context) => whiteColor(context); static Color timetableBackground2(BuildContext context) => whiteColorDarker(context); + static Color timetableBackgroundOutside(BuildContext context) => backgroundColor(context); static double get timetableTimeSplitOpacity => 0.15; static Color bigButtonColor(BuildContext context) => isDarkMode(context) ? Color(0xFF5A5F6B) : Color(0xFFDCE2ED); From 98bc9dcd7b7299ca81c079633c98e573700d8c5e Mon Sep 17 00:00:00 2001 From: miakh <2659269+miakh@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:44:17 +0100 Subject: [PATCH 4/5] timetable specific --- lib/components/timetable/TimetableEventWidget.dart | 4 ++-- lib/themeConfig.dart | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/components/timetable/TimetableEventWidget.dart b/lib/components/timetable/TimetableEventWidget.dart index 96bba843..df12e27f 100644 --- a/lib/components/timetable/TimetableEventWidget.dart +++ b/lib/components/timetable/TimetableEventWidget.dart @@ -53,8 +53,8 @@ class _TimetableEventWidgetState extends State { height: widget.itemHeight, decoration: BoxDecoration( color: (widget.item.timeBlockType == TimeBlockType.saved || widget.item.timeBlockType == TimeBlockType.signedIn) - ? ThemeConfig.timetableSelectedColor(context, ThemeConfig.eventTypeToColor(context, widget.item.eventType)) - : ThemeConfig.timetableUnselectedColor(context, ThemeConfig.eventTypeToColor(context, widget.item.eventType)), + ? ThemeConfig.timetableSelectedColor(context, ThemeConfig.eventTypeToColorTimetable(context, widget.item.eventType)) + : ThemeConfig.timetableUnselectedColor(context, ThemeConfig.eventTypeToColorTimetable(context, widget.item.eventType)), borderRadius: BorderRadius.circular(6), ), child: Stack( diff --git a/lib/themeConfig.dart b/lib/themeConfig.dart index d6957c49..e69761de 100644 --- a/lib/themeConfig.dart +++ b/lib/themeConfig.dart @@ -129,6 +129,10 @@ class ThemeConfig { return appBarColor(); } + static Color eventTypeToColorTimetable(BuildContext context, String? type) { + return eventTypeToColorTimetable(context, type); + } + static Color getShade(Color color, {bool darker = false, double value = .1}) { assert(value >= 0 && value <= 1, 'shade values must be between 0 and 1'); From df8ced1857be67fd97c72bb1f7e68be17a810cde Mon Sep 17 00:00:00 2001 From: miakh <2659269+miakh@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:58:54 +0100 Subject: [PATCH 5/5] pck up --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 18a1eac8..9ff08c7f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -68,7 +68,7 @@ dependencies: easy_localization: ^3.0.7 flutter_map_cancellable_tile_provider: ^3.0.2 simple_shadow: ^0.3.1 - pwa_install: ^0.0.5 + pwa_install: ^0.0.6 flutter_form_builder: ^9.5.0 form_builder_validators: ^11.0.0 qr_flutter: ^4.1.0