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

Fix #184, fix modal with deleting timetable #193

Merged
merged 3 commits into from
Sep 14, 2024
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
63 changes: 35 additions & 28 deletions lib/pages/timetable_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,39 +251,46 @@
},
onDeleteTap: (i) {
if (i == 0) {
OTLNavigator.pushDialog(
context: context,
builder: (_) => OTLDialog(
type: OTLDialogType.accountDeleted,
WidgetsBinding.instance.addPostFrameCallback((_) {
OTLNavigator.pushDialog(

Check warning on line 255 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L254-L255

Added lines #L254 - L255 were not covered by tests
context: context,
builder: (_) => OTLDialog(

Check warning on line 257 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L257

Added line #L257 was not covered by tests
type: OTLDialogType.accountDeleted,
namedArgs: {

Check warning on line 259 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L259

Added line #L259 was not covered by tests
'timetable': 'timetable.tab'
.tr(args: [timetableModel.selectedIndex.toString()])

Check warning on line 261 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L261

Added line #L261 was not covered by tests
},
onTapPos: () {}),

Check warning on line 263 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L263

Added line #L263 was not covered by tests
);
});
} else if (timetableModel.timetables.length <= 2) {
WidgetsBinding.instance.addPostFrameCallback((_) {
OTLNavigator.pushDialog(

Check warning on line 268 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L266-L268

Added lines #L266 - L268 were not covered by tests
context: context,
builder: (_) => OTLDialog(

Check warning on line 270 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L270

Added line #L270 was not covered by tests
type: OTLDialogType.disabledDeleteLastTab,
namedArgs: {
'timetable': 'timetable.tab'
.tr(args: [timetableModel.selectedIndex.toString()])
},
onTapPos: () {}),
);
} else if (timetableModel.timetables.length <= 2) {
OTLNavigator.pushDialog(
context: context,
builder: (_) => OTLDialog(
type: OTLDialogType.disabledDeleteLastTab,
namedArgs: {
'timetable': 'timetable.tab'
.tr(args: [timetableModel.selectedIndex.toString()])
},
),
);
),
);
});
} else {
OTLNavigator.pushDialog(
context: context,
builder: (_) => OTLDialog(
type: OTLDialogType.deleteTab,
namedArgs: {
'timetable': 'timetable.tab'
.tr(args: [timetableModel.selectedIndex.toString()])
},
onTapPos: () => context.read<TimetableModel>().deleteTimetable(),
),
);
WidgetsBinding.instance.addPostFrameCallback((_) {
OTLNavigator.pushDialog(

Check warning on line 281 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L280-L281

Added lines #L280 - L281 were not covered by tests
context: context,
builder: (_) => OTLDialog(

Check warning on line 283 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L283

Added line #L283 was not covered by tests
type: OTLDialogType.deleteTab,
namedArgs: {

Check warning on line 285 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L285

Added line #L285 was not covered by tests
'timetable': 'timetable.tab'
.tr(args: [timetableModel.selectedIndex.toString()])

Check warning on line 287 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L287

Added line #L287 was not covered by tests
},
onTapPos: () =>
context.read<TimetableModel>().deleteTimetable(),

Check warning on line 290 in lib/pages/timetable_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/timetable_page.dart#L289-L290

Added lines #L289 - L290 were not covered by tests
),
);
});
}
},
onExportTap: (type) {
Expand Down
Loading