-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a terms and conditions widget
- Loading branch information
Showing
4 changed files
with
121 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class TermsAndConditions extends StatelessWidget { | ||
final VoidCallback onAcceptConditions; | ||
|
||
const TermsAndConditions({super.key, required this.onAcceptConditions}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16.0), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: <Widget>[ | ||
const Text( | ||
'The content of the app can not be shared with anyone.' | ||
'By accepting, you agree to the terms and conditions.', | ||
style: TextStyle( | ||
fontSize: 16.0, | ||
fontWeight: FontWeight.normal, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
const SizedBox(height: 16.0), | ||
ElevatedButton( | ||
onPressed: onAcceptConditions, | ||
child: const Text( | ||
'Accept', | ||
style: TextStyle( | ||
fontSize: 18.0, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:memories/services/storage_service.dart'; | ||
|
||
class TermsAndConditionsService extends ChangeNotifier { | ||
final StorageService _storageService; | ||
|
||
TermsAndConditionsService(this._storageService); | ||
|
||
Future<void> setTermsAndConditions(bool termsAndConditions) async { | ||
await _storageService.saveBool('termsAccepted', termsAndConditions); | ||
} | ||
|
||
bool? getTermsAndConditions() { | ||
return _storageService.getBool('termsAccepted'); | ||
} | ||
} |