diff --git a/lib/ui/mobile/settings/submenu/grade_exporting.dart b/lib/ui/mobile/settings/submenu/grade_exporting.dart index f060efb..9882e17 100644 --- a/lib/ui/mobile/settings/submenu/grade_exporting.dart +++ b/lib/ui/mobile/settings/submenu/grade_exporting.dart @@ -1,5 +1,6 @@ // ignore_for_file: use_build_context_synchronously +import 'dart:convert'; import 'dart:io'; import 'package:refilc/api/providers/user_provider.dart'; @@ -68,12 +69,12 @@ class MenuGradeExporting extends StatelessWidget { onPressed: () { Navigator.of(context).pop(); - if (!Provider.of(context, listen: false) - .hasScope(PremiumScopes.gradeExporting)) { - return PlusLockedFeaturePopup.show( - context: context, - feature: PremiumFeature.gradeExporting); - } + // if (!Provider.of(context, listen: false) + // .hasScope(PremiumScopes.gradeExporting)) { + // return PlusLockedFeaturePopup.show( + // context: context, + // feature: PremiumFeature.gradeExporting); + // } Navigator.of(context, rootNavigator: true).push( CupertinoPageRoute( @@ -174,20 +175,21 @@ class CalendarSyncScreenState extends State .grades; // gmake a list of grades in json format - List> gradesList = [ + List> gradesList = [ for (Grade grade in grades) - { - '"subject"': '"${grade.subject.name}"', - '"value"': grade.value.value, - '"value_name"': - '"${grade.value.valueName}"', - '"date"': - '"${grade.date.toIso8601String()}"', - '"weight"': grade.value.weight, - '"type"': '"${grade.type.name}"', - '"description"': '"${grade.description}"', - '"teacher"': '"${grade.teacher.name}"', - } + // { + // '"subject"': '"${grade.subject.name}"', + // '"value"': grade.value.value, + // '"value_name"': + // '"${grade.value.valueName}"', + // '"date"': + // '"${grade.date.toIso8601String()}"', + // '"weight"': grade.value.weight, + // '"type"': '"${grade.type.name}"', + // '"description"': '"${grade.description}"', + // '"teacher"': '"${grade.teacher.name}"', + // } + grade.json ?? {}, ]; // convert list to json file @@ -195,7 +197,7 @@ class CalendarSyncScreenState extends State File file = File('${directory.path}/grades.json'); file.writeAsStringSync( - gradesList.toString(), + jsonEncode(gradesList), ); // convert json to bytes diff --git a/pubspec.yaml b/pubspec.yaml index a4496eb..82df8d2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,6 +40,7 @@ dependencies: flutter_dynamic_icon_plus: ^1.1.2 share_plus: ^7.2.2 path_provider: ^2.1.3 + file_picker: ^6.2.1 dev_dependencies: flutter_lints: ^3.0.1