-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the Mature Content Warning (#52)
* bloc & repo bits for storing the shouldBypass preference * put a toggle in the settings screen * component with the warning on * hijack the ChannelBloc to show the mature warning * Show the warning on the channel page when told to
- Loading branch information
Showing
7 changed files
with
152 additions
and
6 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
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,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:gettext_i18n/gettext_i18n.dart'; | ||
|
||
class MatureWarning extends StatelessWidget { | ||
final void Function() onAccept; | ||
|
||
MatureWarning({required this.onAccept}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Center( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Text( | ||
context.t("Mature Content Warning"), | ||
style: Theme.of(context).textTheme.headline4, | ||
), | ||
Text( | ||
context.t( | ||
"The streamer has flagged this channel as only appropriate for Mature Audiences."), | ||
style: Theme.of(context).textTheme.subtitle1, | ||
), | ||
Text( | ||
context.t("Do you wish to continue?"), | ||
style: Theme.of(context).textTheme.subtitle1, | ||
), | ||
Padding( | ||
child: OutlinedButton( | ||
child: Text(context.t("Agree & View Channel")), | ||
onPressed: onAccept, | ||
), | ||
padding: EdgeInsets.symmetric(vertical: 8), | ||
), | ||
ElevatedButton( | ||
child: Text(context.t("Go Back")), | ||
onPressed: () => Navigator.pop(context), | ||
) | ||
], | ||
)); | ||
} | ||
} |
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
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