first google calendar timetable sync demo done
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:math';
|
||||
import 'package:animations/animations.dart';
|
||||
import 'package:filcnaplo/api/providers/update_provider.dart';
|
||||
import 'package:filcnaplo/models/settings.dart';
|
||||
import 'package:filcnaplo/providers/third_party_provider.dart';
|
||||
import 'package:filcnaplo/utils/format.dart';
|
||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
||||
import 'package:filcnaplo_kreta_api/models/week.dart';
|
||||
@@ -210,30 +211,37 @@ class TimetablePageState extends State<TimetablePage>
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: IconButton(
|
||||
splashRadius: 24.0,
|
||||
onPressed: () {
|
||||
// If timetable empty, show empty
|
||||
if (_tabController.length == 0) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text("empty_timetable".i18n),
|
||||
duration: const Duration(seconds: 2),
|
||||
));
|
||||
return;
|
||||
}
|
||||
onPressed: () async {
|
||||
ThirdPartyProvider tpp =
|
||||
Provider.of<ThirdPartyProvider>(context,
|
||||
listen: false);
|
||||
|
||||
Navigator.of(context, rootNavigator: true)
|
||||
.push(PageRouteBuilder(
|
||||
pageBuilder:
|
||||
(context, animation, secondaryAnimation) =>
|
||||
FSTimetable(
|
||||
controller: _controller,
|
||||
),
|
||||
))
|
||||
.then((_) {
|
||||
SystemChrome.setPreferredOrientations(
|
||||
[DeviceOrientation.portraitUp]);
|
||||
setSystemChrome(context);
|
||||
});
|
||||
await tpp.pushTimetable(context, _controller);
|
||||
},
|
||||
// onPressed: () {
|
||||
// // If timetable empty, show empty
|
||||
// if (_tabController.length == 0) {
|
||||
// ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
// content: Text("empty_timetable".i18n),
|
||||
// duration: const Duration(seconds: 2),
|
||||
// ));
|
||||
// return;
|
||||
// }
|
||||
|
||||
// Navigator.of(context, rootNavigator: true)
|
||||
// .push(PageRouteBuilder(
|
||||
// pageBuilder:
|
||||
// (context, animation, secondaryAnimation) =>
|
||||
// FSTimetable(
|
||||
// controller: _controller,
|
||||
// ),
|
||||
// ))
|
||||
// .then((_) {
|
||||
// SystemChrome.setPreferredOrientations(
|
||||
// [DeviceOrientation.portraitUp]);
|
||||
// setSystemChrome(context);
|
||||
// });
|
||||
// },
|
||||
icon: Icon(FeatherIcons.trello,
|
||||
color: AppColors.of(context).text),
|
||||
),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// ignore_for_file: no_leading_underscores_for_local_identifiers, use_build_context_synchronously, deprecated_member_use
|
||||
|
||||
import 'package:filcnaplo/api/providers/update_provider.dart';
|
||||
import 'package:filcnaplo/providers/third_party_provider.dart';
|
||||
import 'package:filcnaplo/theme/colors/accent.dart';
|
||||
import 'package:filcnaplo/theme/observer.dart';
|
||||
import 'package:filcnaplo_kreta_api/providers/absence_provider.dart';
|
||||
@@ -1095,6 +1096,30 @@ class SettingsScreenState extends State<SettingsScreen>
|
||||
],
|
||||
),
|
||||
|
||||
if (kDebugMode)
|
||||
SplittedPanel(
|
||||
title: const Text("debug_settings"),
|
||||
cardPadding: const EdgeInsets.all(4.0),
|
||||
children: [
|
||||
PanelButton(
|
||||
title: const Text('loginToGoogle'),
|
||||
onPressed: () async {
|
||||
ThirdPartyProvider tpp = Provider.of<ThirdPartyProvider>(
|
||||
context,
|
||||
listen: false);
|
||||
|
||||
await tpp.googleSignIn();
|
||||
},
|
||||
),
|
||||
PanelButton(
|
||||
title: const Text('pushTimetableToCalendar'),
|
||||
onPressed: () async {
|
||||
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// developer options
|
||||
if (settings.developerMode)
|
||||
SplittedPanel(
|
||||
|
||||
Reference in New Issue
Block a user