lot of things idk

This commit is contained in:
Kima 2024-02-15 19:52:04 +01:00
parent 41a5f7c539
commit a055de9046
8 changed files with 135 additions and 172 deletions

View File

@ -1,12 +1,10 @@
import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_as_googleapis_auth.dart';
import 'package:filcnaplo_kreta_api/controllers/timetable_controller.dart';
import 'package:filcnaplo_kreta_api/models/lesson.dart';
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:googleapis/calendar/v3.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:provider/provider.dart';
class ThirdPartyProvider with ChangeNotifier {
late List<Event>? _googleEvents;
@ -126,8 +124,14 @@ class ThirdPartyProvider with ChangeNotifier {
start: l.start,
end: l.end,
);
// temp shit (DONT BULLY ME, ILL CUM)
if (kDebugMode) {
if (false != true) print(event);
}
}
print('finished');
return;
// print('finished');
}
}

View File

@ -1,5 +1,3 @@
import 'dart:io';
import 'package:animations/animations.dart';
import 'package:filcnaplo/api/providers/user_provider.dart';
import 'package:filcnaplo/helpers/subject.dart';

View File

@ -2,7 +2,8 @@ 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';
// TODO: gulag calendar sync
// 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';
@ -211,37 +212,38 @@ class TimetablePageState extends State<TimetablePage>
padding: const EdgeInsets.all(8.0),
child: IconButton(
splashRadius: 24.0,
onPressed: () async {
ThirdPartyProvider tpp =
Provider.of<ThirdPartyProvider>(context,
listen: false);
// tested timetable sync
// onPressed: () async {
// ThirdPartyProvider tpp =
// Provider.of<ThirdPartyProvider>(context,
// listen: false);
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);
// });
// 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),
),

View File

@ -36,7 +36,7 @@ class MenuNotifications extends StatelessWidget {
],
),
leading: Icon(
FeatherIcons.messageSquare,
FeatherIcons.messageCircle,
size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95),
),

View File

@ -751,19 +751,6 @@ class SettingsScreenState extends State<SettingsScreen>
],
),
),
// // general things
// Padding(
// padding:
// const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
// child: Panel(
// title: Text("general".i18n),
// child: Column(
// children: [
// WelcomeMessagePanelButton(settings, user),
// ],
// ),
// ),
// ),
// // icon gallery (debug mode)
if (kDebugMode)
@ -792,90 +779,6 @@ class SettingsScreenState extends State<SettingsScreen>
),
),
// // appearance things
// Padding(
// padding:
// const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
// child: Panel(
// title: Text("appearance".i18n),
// child: Column(
// children: [
// // if ios show live activity color option
// if (defaultTargetPlatform == TargetPlatform.iOS)
// PanelButton(
// onPressed: () {
// if (!Provider.of<PremiumProvider>(context,
// listen: false)
// .hasScope(PremiumScopes.liveActivityColor)) {
// PremiumLockedFeatureUpsell.show(
// context: context,
// feature: PremiumFeature.liveActivity);
// return;
// }
// SettingsHelper.liveActivityColor(context);
// setState(() {});
// },
// title: Text("live_activity_color".i18n),
// leading: const Icon(FeatherIcons.activity),
// trailing: Container(
// width: 12.0,
// height: 12.0,
// decoration: BoxDecoration(
// color: settings.liveActivityColor,
// shape: BoxShape.circle,
// ),
// ),
// ),
// ],
// ),
// ),
// ),
// // popup alerts
// Padding(
// padding:
// const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
// child: Panel(
// title: Text("popups".i18n),
// child: Material(
// type: MaterialType.transparency,
// child: SwitchListTile(
// contentPadding: const EdgeInsets.only(left: 12.0),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(12.0)),
// title: Row(
// children: [
// Icon(
// Icons.newspaper_outlined,
// color: settings.newsEnabled
// ? Theme.of(context).colorScheme.secondary
// : AppColors.of(context).text.withOpacity(.25),
// ),
// const SizedBox(width: 14.0),
// Expanded(
// child: Text(
// "news".i18n,
// style: TextStyle(
// fontWeight: FontWeight.w600,
// fontSize: 16.0,
// color: AppColors.of(context)
// .text
// .withOpacity(settings.newsEnabled ? 1.0 : .5),
// ),
// ),
// ),
// ],
// ),
// onChanged: (v) => settings.update(newsEnabled: v),
// value: settings.newsEnabled,
// activeColor: Theme.of(context).colorScheme.secondary,
// ),
// ),
// ),
// ),
// // extra settings
// Padding(
// padding:
@ -884,39 +787,6 @@ class SettingsScreenState extends State<SettingsScreen>
// title: Text("extras".i18n),
// child: Column(
// children: [
// Material(
// type: MaterialType.transparency,
// child: SwitchListTile(
// contentPadding: const EdgeInsets.only(left: 12.0),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(12.0)),
// title: Row(
// children: [
// Icon(
// FeatherIcons.gift,
// color: settings.gradeOpeningFun
// ? Theme.of(context).colorScheme.secondary
// : AppColors.of(context).text.withOpacity(.25),
// ),
// const SizedBox(width: 14.0),
// Expanded(
// child: Text(
// "surprise_grades".i18n,
// style: TextStyle(
// fontWeight: FontWeight.w600,
// fontSize: 16.0,
// color: AppColors.of(context).text.withOpacity(
// settings.gradeOpeningFun ? 1.0 : .5),
// ),
// ),
// ),
// ],
// ),
// onChanged: (v) => settings.update(gradeOpeningFun: v),
// value: settings.gradeOpeningFun,
// activeColor: Theme.of(context).colorScheme.secondary,
// ),
// ),
// PremiumCustomAppIconMenu(
// settings: settings,
// ),
@ -1113,9 +983,7 @@ class SettingsScreenState extends State<SettingsScreen>
),
PanelButton(
title: const Text('pushTimetableToCalendar'),
onPressed: () async {
},
onPressed: () async {},
),
],
),

View File

@ -305,7 +305,9 @@ class GeneralSettingsScreenState extends State<GeneralSettingsScreen> {
),
),
leading: Icon(
FeatherIcons.eye,
settingsProvider.showBreaks
? FeatherIcons.eye
: FeatherIcons.eyeOff,
size: 22.0,
color: AppColors.of(context)
.text
@ -323,6 +325,43 @@ class GeneralSettingsScreenState extends State<GeneralSettingsScreen> {
),
],
),
SplittedPanel(
padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.0),
isSeparated: true,
children: [
PanelButton(
padding: const EdgeInsets.only(left: 14.0, right: 6.0),
onPressed: () {
settingsProvider.update(
newsEnabled: !settingsProvider.newsEnabled);
setState(() {});
},
title: Text(
"news".i18n,
style: TextStyle(
color: AppColors.of(context).text.withOpacity(
settingsProvider.newsEnabled ? .95 : .25),
),
),
leading: Icon(
Icons.newspaper_outlined,
size: 22.0,
color: AppColors.of(context).text.withOpacity(
settingsProvider.newsEnabled ? .95 : .25),
),
trailing: Switch(
onChanged: (v) => settingsProvider.update(newsEnabled: v),
value: settingsProvider.newsEnabled,
activeColor: Theme.of(context).colorScheme.secondary,
),
borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0),
bottom: Radius.circular(12.0),
),
),
],
),
],
),
),

View File

@ -20,6 +20,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'package:provider/provider.dart';
import 'package:filcnaplo_mobile_ui/screens/settings/settings_screen.i18n.dart';
import 'package:refilc_plus/models/premium_scopes.dart';
import 'package:refilc_plus/providers/premium_provider.dart';
import 'package:refilc_plus/ui/mobile/premium/upsell.dart';
class MenuPersonalizeSettings extends StatelessWidget {
const MenuPersonalizeSettings({
@ -39,7 +42,7 @@ class MenuPersonalizeSettings extends StatelessWidget {
),
title: Text("personalization".i18n),
leading: Icon(
FeatherIcons.droplet,
Icons.palette_outlined,
size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95),
),
@ -440,7 +443,7 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
),
),
leading: Icon(
FeatherIcons.penTool,
Icons.school_outlined,
size: 22.0,
color: AppColors.of(context).text.withOpacity(
settingsProvider.renamedSubjectsEnabled
@ -531,6 +534,54 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
),
],
),
// live activity color
SplittedPanel(
padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.0),
isSeparated: true,
children: [
PanelButton(
onPressed: () {
if (!Provider.of<PremiumProvider>(context,
listen: false)
.hasScope(PremiumScopes.liveActivityColor)) {
PremiumLockedFeatureUpsell.show(
context: context,
feature: PremiumFeature.liveActivity,
);
return;
}
SettingsHelper.liveActivityColor(context);
setState(() {});
},
title: Text(
"live_activity_color".i18n,
style: TextStyle(
color: AppColors.of(context).text.withOpacity(.95),
),
),
leading: Icon(
FeatherIcons.activity,
size: 22.0,
color: AppColors.of(context).text.withOpacity(.95),
),
trailing: Container(
margin: const EdgeInsets.only(left: 2.0),
width: 12.0,
height: 12.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: settingsProvider.liveActivityColor,
),
),
borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0),
bottom: Radius.circular(12.0),
),
),
],
),
// SplittedPanel(
// padding: const EdgeInsets.only(top: 9.0),

View File

@ -62,6 +62,7 @@ dependencies:
git:
url: https://github.com/kimaah/image_crop.git
uuid: ^4.2.2
maps_launcher: ^2.2.0
dev_dependencies:
flutter_lints: ^3.0.1