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 #!/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 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"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.security.application-groups</key> <key>com.apple.security.application-groups</key>
<array> <array>
<string>group.refilcnaplo.livecard</string> <string>group.refilcnaplo.livecard</string>

View File

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

View File

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

View File

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

View File

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

View File

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