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

FEATURE: schedule from cache indication #78

Merged
merged 3 commits into from
Sep 6, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions lib/presentation/pages/schedule/schedule_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class _ScheduleScreenState extends State<ScheduleScreen> {
super.initState();
}

Widget _buildGroupButton(String group, String activeGroup, bool isActive,
[Schedule? schedule]) {
Widget _buildGroupButton(
String group, String activeGroup, bool isActive, Schedule schedule) {
if (isActive) {
return Padding(
padding: EdgeInsets.only(bottom: 10),
padding: const EdgeInsets.only(bottom: 10),
child: Container(
padding: EdgeInsets.only(left: 10),
padding: const EdgeInsets.only(left: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand All @@ -46,17 +46,33 @@ class _ScheduleScreenState extends State<ScheduleScreen> {
style: DarkTextTheme.buttonL,
),
Row(
mainAxisSize: MainAxisSize.min,
children: [
if (!schedule.isRemote)
Container(
alignment: Alignment.topRight,
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: DarkThemeColors.colorful06),
height: 24,
child: Text('кэш',
style: DarkTextTheme.chip
.copyWith(color: DarkThemeColors.background03)),
),
),
RawMaterialButton(
onPressed: () {
context.read<ScheduleBloc>().add(ScheduleUpdateEvent(
group: group, activeGroup: activeGroup));
},
child: Icon(Icons.refresh_rounded,
color: schedule!.isRemote
color: schedule.isRemote
? DarkThemeColors.colorful05
: DarkThemeColors.colorful06),
shape: CircleBorder(),
shape: const CircleBorder(),
constraints:
const BoxConstraints(minWidth: 36.0, minHeight: 36.0),
),
Expand Down Expand Up @@ -114,7 +130,7 @@ class _ScheduleScreenState extends State<ScheduleScreen> {
RawMaterialButton(
onPressed: () {
context.read<ScheduleBloc>().add(ScheduleDeleteEvent(
group: group, schedule: schedule!));
group: group, schedule: schedule));
},
child: const Icon(Icons.delete_rounded),
shape: CircleBorder(),
Expand Down