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 all 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
29 changes: 17 additions & 12 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,22 @@ class _ScheduleScreenState extends State<ScheduleScreen> {
style: DarkTextTheme.buttonL,
),
Row(
mainAxisSize: MainAxisSize.min,
children: [
if (!schedule.isRemote)
Text('кэш',
style: DarkTextTheme.buttonS
.copyWith(color: DarkThemeColors.colorful06)),
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 All @@ -77,9 +82,9 @@ class _ScheduleScreenState extends State<ScheduleScreen> {
);
} else {
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 @@ -97,7 +102,7 @@ class _ScheduleScreenState extends State<ScheduleScreen> {
.add(ScheduleSetActiveGroupEvent(group));
},
child: const Icon(Icons.check_rounded),
shape: CircleBorder(),
shape: const CircleBorder(),
constraints:
const BoxConstraints(minWidth: 36.0, minHeight: 36.0),
),
Expand All @@ -107,17 +112,17 @@ class _ScheduleScreenState extends State<ScheduleScreen> {
group: group, activeGroup: activeGroup));
},
child: const Icon(Icons.refresh_rounded),
shape: CircleBorder(),
shape: const CircleBorder(),
constraints:
const BoxConstraints(minWidth: 36.0, minHeight: 36.0),
),
RawMaterialButton(
onPressed: () {
context.read<ScheduleBloc>().add(ScheduleDeleteEvent(
group: group, schedule: schedule!));
group: group, schedule: schedule));
},
child: const Icon(Icons.delete_rounded),
shape: CircleBorder(),
shape: const CircleBorder(),
constraints:
const BoxConstraints(minWidth: 36.0, minHeight: 36.0),
),
Expand Down