Merge pull request #19 from TMarccci/master

Fixes
This commit is contained in:
Márton Kiss 2023-06-12 20:26:48 +02:00 committed by GitHub
commit 485e85ddaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 27 deletions

View File

@ -1,3 +1,7 @@
#!/bin/sh
flutter clean
dart pub get
flutter doctor -v
flutter build ipa --release --dart-define=APPVER=$(cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1) --no-tree-shake-icons

View File

@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.security.application-groups</key>
<array>
<string>group.refilcnaplo.livecard</string>

View File

@ -57,15 +57,13 @@ Future loginApi({
String nonceStr = await Provider.of<KretaClient>(context, listen: false)
.getAPI(KretaAPI.nonce, json: false);
Nonce nonce =
getNonce(nonceStr, '${username.replaceAll(' ', '')} ', instituteCode);
headers.addAll(nonce.header());
Nonce nonce = getNonce(nonceStr, username, instituteCode);
Map? res = await Provider.of<KretaClient>(context, listen: false)
.postAPI(KretaAPI.login,
headers: headers,
body: User.loginBody(
username: '${username.replaceAll(' ', '')} ',
username: username,
password: password,
instituteCode: instituteCode,
));
@ -84,7 +82,7 @@ Future loginApi({
.getAPI(KretaAPI.student(instituteCode));
Student student = Student.fromJson(studentJson!);
var user = User(
username: '${username.replaceAll(' ', '')} ',
username: username,
password: password,
instituteCode: instituteCode,
name: student.name,

View File

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:background_fetch/background_fetch.dart';
import 'package:filcnaplo/api/providers/user_provider.dart';
import 'package:filcnaplo/api/providers/database_provider.dart';
@ -53,26 +55,32 @@ class Startup {
FlutterLocalNotificationsPlugin();
// Get permission to show notifications
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
if (Platform.isAndroid) {
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()!
.requestPermission();
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: false,
badge: true,
sound: true,
);
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
MacOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: false,
badge: true,
sound: true,
);
.requestPermission();
}
else if (Platform.isIOS) {
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: false,
badge: true,
sound: true,
);
}
else if (Platform.isMacOS) {
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
MacOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: false,
badge: true,
sound: true,
);
}
// Platform specific settings
final DarwinInitializationSettings initializationSettingsDarwin =

View File

@ -48,7 +48,7 @@ dependencies:
crypto: ^3.0.2
elegant_notification: ^1.6.1
flutter_feather_icons: ^2.0.0+1
live_activities: ^1.0.0
live_activities: ^1.7.4
animated_flip_counter: ^0.2.5
lottie: ^1.4.3
rive: ^0.9.1

View File

@ -169,7 +169,7 @@ class KretaClient {
Map? loginRes = await postAPI(KretaAPI.login,
headers: headers,
body: User.loginBody(
username: loginUser.username.replaceAll(' ', '') + ' ',
username: loginUser.username,
password: loginUser.password,
instituteCode: loginUser.instituteCode,
));

View File

@ -280,7 +280,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
void gradeCalc(BuildContext context) {
// Scroll to the top of the page
_scrollController.animateTo(75,
_scrollController.animateTo(100,
duration: const Duration(milliseconds: 500), curve: Curves.ease);
calculatorProvider.clear();