anyway/frontend/lib/structs/agreement.dart
Remy Moll 02133a4abe
Some checks failed
Run testing on the backend code / Build (pull_request) Failing after 4m43s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 25s
Build and release debug APK / Build APK (pull_request) Failing after 4m39s
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 3m30s
Run linting on the backend code / Build (pull_request) Successful in 28s
quite a few UX improvements
2025-03-23 20:00:24 +01:00

18 lines
506 B
Dart

import 'package:shared_preferences/shared_preferences.dart';
final class Agreement{
bool agreed;
Agreement({required this.agreed});
}
void saveAgreement(bool agreed) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setBool('agreed_to_terms_and_conditions', agreed);
}
Future<Agreement> getAgreement() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return Agreement(agreed: prefs.getBool('agreed_to_terms_and_conditions') ?? false);
}