From 01cd1a33e2ff28ed5734651df42fa8943b8db880 Mon Sep 17 00:00:00 2001 From: StarProxima Date: Fri, 7 Apr 2023 23:26:39 +0300 Subject: [PATCH 01/11] Fix and disable redirect on /timetable --- lib/features/navigation/router/app_router.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/features/navigation/router/app_router.dart b/lib/features/navigation/router/app_router.dart index 78c6fda..7d91bed 100644 --- a/lib/features/navigation/router/app_router.dart +++ b/lib/features/navigation/router/app_router.dart @@ -1,5 +1,4 @@ import 'package:cube_system/features/landing_page/ui/landing_page.dart'; -import 'package:cube_system/features/timetable_page/state_holders/selected_timetable.dart'; import 'package:cube_system/features/timetable_page/ui/timetable_page.dart'; import 'package:cube_system/features/timetable_search_page/ui/timetable_search_page.dart'; import 'package:cube_system/models/timetable/timetable_info.dart'; @@ -88,10 +87,12 @@ final routerProvider = Provider((ref) { path: '/timetable', redirect: (context, state) { //TODO: refactor - final timetable = ref.read(selectedTimetable); - if (timetable != null) { - return '/timetable/${timetable.type.name}-${timetable.id}'; - } + // if (state.fullpath == '/timetable') { + // final timetable = ref.read(selectedTimetable); + // if (timetable != null) { + // return '/timetable/${timetable.type.name}-${timetable.id}'; + // } + // } return null; }, pageBuilder: (context, state) => AppCustomTransitionPage( From 579d68adfeccb1c422be3d7b811534794192aad3 Mon Sep 17 00:00:00 2001 From: StarProxima Date: Fri, 7 Apr 2023 23:36:39 +0300 Subject: [PATCH 02/11] Change fontSize in TimetablePageHeader --- .../timetable_page/ui/widgets/timetable_page_header.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/features/timetable_page/ui/widgets/timetable_page_header.dart b/lib/features/timetable_page/ui/widgets/timetable_page_header.dart index d695118..7b10116 100644 --- a/lib/features/timetable_page/ui/widgets/timetable_page_header.dart +++ b/lib/features/timetable_page/ui/widgets/timetable_page_header.dart @@ -71,6 +71,7 @@ class TimetablePageHeader extends ConsumerWidget { Text( timetable?.type.label ?? 'Не выбрано', style: context.textStyles.smallSubTitle.copyWith( + fontSize: 10, color: context.colors.subduedText, ), ), From e5591c14c8b3a382b72da6d1a5ddb2d0aa72be66 Mon Sep 17 00:00:00 2001 From: StarProxima Date: Fri, 7 Apr 2023 23:50:52 +0300 Subject: [PATCH 03/11] Fix blink animation on LandingWelcomePage --- .../landing_page/ui/widgets/landing_welcome_page.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/features/landing_page/ui/widgets/landing_welcome_page.dart b/lib/features/landing_page/ui/widgets/landing_welcome_page.dart index c5429d4..d14ea63 100644 --- a/lib/features/landing_page/ui/widgets/landing_welcome_page.dart +++ b/lib/features/landing_page/ui/widgets/landing_welcome_page.dart @@ -67,8 +67,12 @@ class _LandingWelcomePageState extends ConsumerState parent: _controller, curve: Curves.easeInOut, ), - child: Assets.rive.shapes.rive( - fit: BoxFit.contain, + child: Padding( + padding: const EdgeInsets.all(32), + child: Assets.rive.shapes.rive( + antialiasing: false, + fit: BoxFit.cover, + ), ), ), ), From 813b6c0251667d73368b03c53c17a9c6d64dd058 Mon Sep 17 00:00:00 2001 From: StarProxima Date: Fri, 7 Apr 2023 23:54:36 +0300 Subject: [PATCH 04/11] Fix layout in TimetableSearchPageHeader --- .../ui/widgets/timetable_search_page_header.dart | 12 ++++++++---- .../ui/widgets/timetable_search_page_text_field.dart | 3 ++- lib/ui/widgets/app_back_button.dart | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/features/timetable_search_page/ui/widgets/timetable_search_page_header.dart b/lib/features/timetable_search_page/ui/widgets/timetable_search_page_header.dart index 29ec84d..5894986 100644 --- a/lib/features/timetable_search_page/ui/widgets/timetable_search_page_header.dart +++ b/lib/features/timetable_search_page/ui/widgets/timetable_search_page_header.dart @@ -20,14 +20,18 @@ class TimetableSearchPageHeader extends ConsumerWidget child: Column( children: [ Padding( - padding: - const EdgeInsets.only(left: 8, top: 8, bottom: 8, right: 4), + padding: const EdgeInsets.symmetric( + vertical: 12, + horizontal: 16, + ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: const [ AppBackButton(), - SizedBox(width: 6), - Flexible(child: TimetableSearchPageTextField()), + SizedBox(width: 12), + Flexible( + child: TimetableSearchPageTextField(), + ), ], ), ), diff --git a/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart b/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart index 2cacf74..c20ffb8 100644 --- a/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart +++ b/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart @@ -21,13 +21,14 @@ class TimetableSearchPageTextField extends ConsumerWidget { focusNode: focus, onChanged: manager.search, style: context.textStyles.smallLabel.copyWith( - fontSize: 14, + fontSize: 16, ), decoration: InputDecoration( contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 12), isDense: true, hintText: 'Найти расписание', hintStyle: context.textStyles.subTitle.copyWith( + fontSize: 16, color: context.colors.hintText, ), border: InputBorder.none, diff --git a/lib/ui/widgets/app_back_button.dart b/lib/ui/widgets/app_back_button.dart index a365852..1cea34b 100644 --- a/lib/ui/widgets/app_back_button.dart +++ b/lib/ui/widgets/app_back_button.dart @@ -8,8 +8,7 @@ class AppBackButton extends StatelessWidget { @override Widget build(BuildContext context) { return IconButton( - iconSize: 20, - splashRadius: 18, + splashRadius: 22, constraints: const BoxConstraints( minWidth: 36, minHeight: 36, @@ -19,6 +18,7 @@ class AppBackButton extends StatelessWidget { onPressed: context.pop, icon: Icon( Icons.arrow_back_rounded, + size: 24, color: context.colors.text, ), ); From 391bfd332babe31bda80fff9eafe74b2a78de9ec Mon Sep 17 00:00:00 2001 From: StarProxima Date: Sat, 8 Apr 2023 00:06:07 +0300 Subject: [PATCH 05/11] Remove delay before request on submitted in TimetableSearchPage --- .../managers/timetable_search_page_manager.dart | 10 +++++++--- .../ui/widgets/timetable_search_page_text_field.dart | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/features/timetable_search_page/managers/timetable_search_page_manager.dart b/lib/features/timetable_search_page/managers/timetable_search_page_manager.dart index cc9b4a0..7687ae2 100644 --- a/lib/features/timetable_search_page/managers/timetable_search_page_manager.dart +++ b/lib/features/timetable_search_page/managers/timetable_search_page_manager.dart @@ -72,13 +72,17 @@ class TimetableSearchPageManager { await timetablePageManager.selectTimetable(timetable); } - Future search(String querry) async { + Future search(String querry, {bool delayBeforeRequest = true}) async { await Future(() {}); timer.state.cancel(); event.state = TimetableSearchEventType.loading; - timer.state = Timer(const Duration(milliseconds: 700), () { + if (delayBeforeRequest) { + timer.state = Timer(const Duration(milliseconds: 800), () { + _search(querry); + }); + } else { _search(querry); - }); + } } Future _search(String querry) async { diff --git a/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart b/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart index c20ffb8..56ab975 100644 --- a/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart +++ b/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart @@ -20,6 +20,9 @@ class TimetableSearchPageTextField extends ConsumerWidget { controller: contoller, focusNode: focus, onChanged: manager.search, + onSubmitted: (value) => manager.search(value, delayBeforeRequest: false), + onEditingComplete: () => + manager.search(contoller.text, delayBeforeRequest: false), style: context.textStyles.smallLabel.copyWith( fontSize: 16, ), From dd2e00d81ef2046377eb0cdc1f9eae0bc6db322a Mon Sep 17 00:00:00 2001 From: StarProxima Date: Sat, 8 Apr 2023 00:51:20 +0300 Subject: [PATCH 06/11] Arrow next to timetable name --- .../ui/widgets/timetable_page_header.dart | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/features/timetable_page/ui/widgets/timetable_page_header.dart b/lib/features/timetable_page/ui/widgets/timetable_page_header.dart index 7b10116..74c7383 100644 --- a/lib/features/timetable_page/ui/widgets/timetable_page_header.dart +++ b/lib/features/timetable_page/ui/widgets/timetable_page_header.dart @@ -63,9 +63,29 @@ class TimetablePageHeader extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - timetable?.label ?? 'Расписание', - style: labelTextStyle, + Row( + children: [ + Text( + timetable?.label ?? 'Расписание', + style: labelTextStyle, + ), + SizedBox( + height: 16, + child: Text( + String.fromCharCode( + Icons.arrow_drop_down_rounded.codePoint, + ), + style: labelTextStyle.copyWith( + fontFamily: + Icons.arrow_drop_down_rounded.fontFamily, + package: + Icons.arrow_drop_down_rounded.fontPackage, + fontSize: 22, + height: 0.85, + ), + ), + ), + ], ), const SizedBox(height: 1), Text( From 4ea8033836328d416f12418930b3fa61ec8374f2 Mon Sep 17 00:00:00 2001 From: StarProxima Date: Sat, 8 Apr 2023 00:57:21 +0300 Subject: [PATCH 07/11] Edit features in LandingFeaturesPage --- .../ui/widgets/landing_features_page.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/features/landing_page/ui/widgets/landing_features_page.dart b/lib/features/landing_page/ui/widgets/landing_features_page.dart index e680dbf..9d22f0d 100644 --- a/lib/features/landing_page/ui/widgets/landing_features_page.dart +++ b/lib/features/landing_page/ui/widgets/landing_features_page.dart @@ -24,9 +24,9 @@ class LandingFeaturesPage extends ConsumerWidget { Center( child: Column( children: [ - const SizedBox(height: 5), + const SizedBox(height: 10), ShortFadeAnimatedWidget( - size: 190, + size: 185, child: Assets.brooklyn.virtualReality4.svg(), ), const SizedBox(height: 5), @@ -43,10 +43,10 @@ class LandingFeaturesPage extends ConsumerWidget { const SizedBox(height: 24), LandingFeatureCard( icon: const Icon(Icons.calendar_today_outlined), - color: const Color(0xFF488aff).withOpacity(0.65), - title: 'Расписание по неделям', + color: const Color(0xFF1aaf5c).withOpacity(0.5), + title: 'Расписание по дням', description: - 'Переключайтесь между неделями от начала и до конца семестра', + 'Переключайтесь между днями или неделями от начала и до конца семестра', ), const SizedBox(height: 16), LandingFeatureCard( @@ -67,7 +67,7 @@ class LandingFeaturesPage extends ConsumerWidget { const SizedBox(height: 16), LandingFeatureCard( icon: const Icon(Icons.devices_rounded), - color: const Color(0xFF1aaf5c).withOpacity(0.5), + color: const Color(0xFF488aff).withOpacity(0.65), title: 'Мобильность', description: 'Просматривайте расписание с различных устройств', ), From 98fb483a2a8e4c4571c98fad3363b4020a1c49cc Mon Sep 17 00:00:00 2001 From: StarProxima Date: Sat, 8 Apr 2023 01:09:26 +0300 Subject: [PATCH 08/11] Fix status bar brightness --- lib/main.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 654d47a..59f23cb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -12,13 +12,25 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:window_size/window_size.dart'; import 'package:device_preview/device_preview.dart'; +import 'package:flutter/services.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); + if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) { setWindowTitle('Куб.Расписание'); setWindowMinSize(const Size(460, 380)); } + + // TODO: iOS support + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle( + statusBarColor: Colors.transparent, + statusBarBrightness: Brightness.light, + statusBarIconBrightness: Brightness.dark, + ), + ); + runApp(const ProviderScope(child: MainApp())); } From 79449962a4a4afbffa5c372c96e0bc3c25360de7 Mon Sep 17 00:00:00 2001 From: StarProxima Date: Sat, 8 Apr 2023 01:16:05 +0300 Subject: [PATCH 09/11] Method instantSearch in TimetableSearchPageManager --- .../managers/timetable_search_page_manager.dart | 3 +++ .../ui/widgets/timetable_search_page_text_field.dart | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/features/timetable_search_page/managers/timetable_search_page_manager.dart b/lib/features/timetable_search_page/managers/timetable_search_page_manager.dart index 7687ae2..f1c6425 100644 --- a/lib/features/timetable_search_page/managers/timetable_search_page_manager.dart +++ b/lib/features/timetable_search_page/managers/timetable_search_page_manager.dart @@ -72,6 +72,9 @@ class TimetableSearchPageManager { await timetablePageManager.selectTimetable(timetable); } + Future instantSearch(String querry) => + search(querry, delayBeforeRequest: false); + Future search(String querry, {bool delayBeforeRequest = true}) async { await Future(() {}); timer.state.cancel(); diff --git a/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart b/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart index 56ab975..8b30c57 100644 --- a/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart +++ b/lib/features/timetable_search_page/ui/widgets/timetable_search_page_text_field.dart @@ -20,9 +20,8 @@ class TimetableSearchPageTextField extends ConsumerWidget { controller: contoller, focusNode: focus, onChanged: manager.search, - onSubmitted: (value) => manager.search(value, delayBeforeRequest: false), - onEditingComplete: () => - manager.search(contoller.text, delayBeforeRequest: false), + onSubmitted: (value) => manager.instantSearch, + onEditingComplete: () => manager.instantSearch(contoller.text), style: context.textStyles.smallLabel.copyWith( fontSize: 16, ), From 6604041da72693b7585d317deb4290d4c60969d8 Mon Sep 17 00:00:00 2001 From: StarProxima Date: Sat, 8 Apr 2023 01:28:51 +0300 Subject: [PATCH 10/11] Few minor edits in layout --- .../landing_page/ui/widgets/landing_welcome_page.dart | 2 +- .../timetable_page/ui/widgets/timetable_page_header.dart | 4 ++-- lib/ui/widgets/short_fade_animated_widget.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/features/landing_page/ui/widgets/landing_welcome_page.dart b/lib/features/landing_page/ui/widgets/landing_welcome_page.dart index d14ea63..659a985 100644 --- a/lib/features/landing_page/ui/widgets/landing_welcome_page.dart +++ b/lib/features/landing_page/ui/widgets/landing_welcome_page.dart @@ -79,7 +79,7 @@ class _LandingWelcomePageState extends ConsumerState Positioned.fill( child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 100, sigmaY: 100), + filter: ImageFilter.blur(sigmaX: 110, sigmaY: 110), child: const SizedBox(), ), ), diff --git a/lib/features/timetable_page/ui/widgets/timetable_page_header.dart b/lib/features/timetable_page/ui/widgets/timetable_page_header.dart index 74c7383..a7c2a6b 100644 --- a/lib/features/timetable_page/ui/widgets/timetable_page_header.dart +++ b/lib/features/timetable_page/ui/widgets/timetable_page_header.dart @@ -80,8 +80,8 @@ class TimetablePageHeader extends ConsumerWidget { Icons.arrow_drop_down_rounded.fontFamily, package: Icons.arrow_drop_down_rounded.fontPackage, - fontSize: 22, - height: 0.85, + fontSize: 20, + height: 0.95, ), ), ), diff --git a/lib/ui/widgets/short_fade_animated_widget.dart b/lib/ui/widgets/short_fade_animated_widget.dart index 9f9d035..78bdede 100644 --- a/lib/ui/widgets/short_fade_animated_widget.dart +++ b/lib/ui/widgets/short_fade_animated_widget.dart @@ -19,7 +19,7 @@ class _ShortFadeAnimatedWidgetState extends State super.initState(); animatedController = AnimationController( vsync: this, - duration: const Duration(milliseconds: 300), + duration: const Duration(milliseconds: 400), ); } From f991789e7885291be7d5f7096743687d94c3e5f8 Mon Sep 17 00:00:00 2001 From: StarProxima Date: Sat, 8 Apr 2023 01:29:10 +0300 Subject: [PATCH 11/11] Bump version to 0.6.0 --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 3062f04..1e6794d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: cube_system -description: A new Flutter project. +description: Modern electronic timetable publish_to: 'none' -version: 0.5.0 +version: 0.6.0 environment: sdk: '>=2.19.2 <3.0.0'