Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparation v0.6 #12

Merged
merged 11 commits into from
Apr 7, 2023
12 changes: 6 additions & 6 deletions lib/features/landing_page/ui/widgets/landing_features_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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(
Expand All @@ -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: 'Просматривайте расписание с различных устройств',
),
Expand Down
10 changes: 7 additions & 3 deletions lib/features/landing_page/ui/widgets/landing_welcome_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,19 @@ class _LandingWelcomePageState extends ConsumerState<LandingWelcomePage>
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,
),
),
),
),

Positioned.fill(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 100, sigmaY: 100),
filter: ImageFilter.blur(sigmaX: 110, sigmaY: 110),
child: const SizedBox(),
),
),
Expand Down
11 changes: 6 additions & 5 deletions lib/features/navigation/router/app_router.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -88,10 +87,12 @@ final routerProvider = Provider<GoRouter>((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(
Expand Down
27 changes: 24 additions & 3 deletions lib/features/timetable_page/ui/widgets/timetable_page_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,35 @@ 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: 20,
height: 0.95,
),
),
),
],
),
const SizedBox(height: 1),
Text(
timetable?.type.label ?? 'Не выбрано',
style: context.textStyles.smallSubTitle.copyWith(
fontSize: 10,
color: context.colors.subduedText,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,20 @@ class TimetableSearchPageManager {
await timetablePageManager.selectTimetable(timetable);
}

Future<void> search(String querry) async {
Future<void> instantSearch(String querry) =>
search(querry, delayBeforeRequest: false);

Future<void> 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<void> _search(String querry) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ class TimetableSearchPageTextField extends ConsumerWidget {
controller: contoller,
focusNode: focus,
onChanged: manager.search,
onSubmitted: (value) => manager.instantSearch,
onEditingComplete: () => manager.instantSearch(contoller.text),
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,
Expand Down
12 changes: 12 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}

Expand Down
4 changes: 2 additions & 2 deletions lib/ui/widgets/app_back_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -19,6 +18,7 @@ class AppBackButton extends StatelessWidget {
onPressed: context.pop,
icon: Icon(
Icons.arrow_back_rounded,
size: 24,
color: context.colors.text,
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/widgets/short_fade_animated_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _ShortFadeAnimatedWidgetState extends State<ShortFadeAnimatedWidget>
super.initState();
animatedController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 300),
duration: const Duration(milliseconds: 400),
);
}

Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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'
Expand Down