Skip to content

Commit

Permalink
feat: Add sponsors button
Browse files Browse the repository at this point in the history
  • Loading branch information
0niel committed Dec 30, 2023
1 parent a0d98cf commit 657961d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
21 changes: 20 additions & 1 deletion lib/presentation/pages/profile/about_app_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,26 @@ class AboutAppPage extends StatelessWidget {
const SizedBox(height: 24),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text('Спонсоры 💜', style: AppTextStyle.h6),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Спонсоры 💜', style: AppTextStyle.h6),
TextButton(
onPressed: () {
launchUrlString(
'https://boosty.to/oniel',
mode: LaunchMode.externalApplication,
);
},
child: Text(
'Стать спонсором',
style: AppTextStyle.buttonS.copyWith(
color: AppTheme.colors.primary,
),
),
),
],
),
),
const SizedBox(height: 16),
const Padding(
Expand Down
8 changes: 7 additions & 1 deletion lib/schedule/view/schedule_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ class _SchedulePageState extends State<SchedulePage> {
body: EventsPageView(
controller: _schedulePageController,
itemBuilder: (context, index) {
final day =
Calendar.firstCalendarDay.add(Duration(days: index));
final schedules = Calendar.getSchedulePartsByDay(
schedule: state.selectedSchedule?.schedule ?? [],
day: Calendar.firstCalendarDay.add(Duration(days: index)),
day: day,
);

final holiday = schedules.firstWhereOrNull(
Expand All @@ -113,6 +115,10 @@ class _SchedulePageState extends State<SchedulePage> {
title: (holiday as HolidaySchedulePart).title);
}

if (day.weekday == DateTime.sunday) {
return const HolidayPage(title: 'Выходной');
}

final lessons =
schedules.whereType<LessonSchedulePart>().toList();

Expand Down
6 changes: 3 additions & 3 deletions lib/schedule/widgets/calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ class _CalendarState extends State<Calendar> {
_selectedWeek = currentNewWeek;
_selectedDay = selectedDay;
_focusedDay = Calendar.getDayInAvailableRange(focusedDay);
_selectedPage = Calendar.getPageIndex(_selectedDay);
});
_selectedPage = Calendar.getPageIndex(_selectedDay);
if (widget.pageViewController.hasClients) {
widget.pageViewController.jumpToPage(_selectedPage);
}
Expand All @@ -235,10 +235,10 @@ class _CalendarState extends State<Calendar> {
_selectedDay = currentDate;
_selectedWeek = CalendarUtils.getCurrentWeek(
mCurrentDate: _selectedDay);
_selectedPage = Calendar.getPageIndex(_selectedDay);
});
_selectedPage = Calendar.getPageIndex(_selectedDay);
if (widget.pageViewController.hasClients) {
widget.pageViewController.jumpToPage(_selectedPage);
widget.pageViewController.jumpToPage(_selectedPage - 1);
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions lib/sponsors/view/sponsors_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import 'package:community_repository/community_repository.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:rtu_mirea_app/sponsors/sponsors.dart';

Expand Down Expand Up @@ -52,7 +52,7 @@ class _SponsorsView extends StatelessWidget {

return SponsorCard(sponsor: sponsor);
},
),
).animate(interval: 80.ms).fade(duration: 200.ms),
);
} else {
return const SizedBox.shrink();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ publish_to: 'none'
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.4.1+44
version: 1.4.1+45

environment:
sdk: ">=3.1.1"
Expand Down

0 comments on commit 657961d

Please sign in to comment.