Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into prod/festapp
Browse files Browse the repository at this point in the history
  • Loading branch information
miakh committed Dec 29, 2024
2 parents c14771e + df8ced1 commit 0441646
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 41 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions lib/components/timeline/ScheduleTimeline.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -45,7 +46,7 @@ class _ScheduleTimelineState extends State<ScheduleTimeline> {
child: Padding(
padding: const EdgeInsets.fromLTRB(36, 18, 0, 12),
child: Text(
group.title,
StylesConfig.formatTimelineSplit(group.title),
style: StylesConfig.timeLineSplitTextStyle(context),
),
),
Expand Down Expand Up @@ -124,7 +125,7 @@ class _ScheduleTimelineState extends State<ScheduleTimeline> {
alignment: Alignment.centerLeft,
),
child: Text(
event.data["rightText"],
StylesConfig.formatTimelineRightText(event.data["rightText"]),
style: StylesConfig.timeLineSmallTextStyle,
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/components/timeline/ScheduleTimelineHelper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class TimeBlockHelper {
}

static List<TimeBlockGroup> splitTimeBlocksByDate(
Iterable<TimeBlockItem> events, BuildContext context, int splitHour) {
List<TimeBlockItem> events, BuildContext context, int splitHour) {
List<TimeBlockGroup> toReturn = [];
if (events.isEmpty) {
return toReturn;
Expand Down
3 changes: 0 additions & 3 deletions lib/components/timetable/Timetable.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/timetable/TimetableEventWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class _TimetableEventWidgetState extends State<TimetableEventWidget> {
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(
Expand Down
63 changes: 32 additions & 31 deletions lib/pages/TimetablePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,35 @@ class _TimetablePageState extends State<TimetablePage>
Future<void> loadData() async {
await loadDataOffline();

await DbEvents.updateEvents(_events).whenComplete(() async {
var placeIds = _events
.map((e) => e.place?.id)
.where((id) => id != null)
.cast<int>()
.toSet()
.toList();

var places = await DbPlaces.getPlacesIn(placeIds);

var timetablePlaces = List<TimeBlockPlace>.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<int>()
.toSet()
.toList();

var places = await DbPlaces.getPlacesIn(placeIds);

var timetablePlaces = List<TimeBlockPlace>.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) =>
Expand Down Expand Up @@ -145,13 +145,14 @@ class _TimetablePageState extends State<TimetablePage>
@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(
Expand Down Expand Up @@ -195,7 +196,7 @@ class _TimetablePageState extends State<TimetablePage>
),
],
),
body: Timetable(
body: _days.isEmpty || _events.isEmpty ? SizedBox.shrink() : Timetable(
controller: timetableController,
items: _days[_currentIndex??0].events,
timetablePlaces: _timetablePlaces));
Expand Down
9 changes: 9 additions & 0 deletions lib/styles/StylesConfig.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
}
}
5 changes: 5 additions & 0 deletions lib/themeConfig.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -128,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');

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0441646

Please sign in to comment.