-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dialog to confirm to change group (#435)
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:awachat/store/memory.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
Future<bool?> dialogChangeGroup(BuildContext context) => (showDialog<bool>( | ||
barrierDismissible: true, | ||
context: context, | ||
builder: (BuildContext context) { | ||
final String city = Memory().boxUser.get('group-city')!; | ||
Widget contentChild = | ||
const Text('''Tu vas quitter ce groupe et en chercher un nouveau.'''); | ||
if (city != 'Je ne trouve pas ma ville') { | ||
contentChild = Text( | ||
'''Tu vas quitter ce groupe et en chercher un nouveau à $city.'''); | ||
} | ||
return AlertDialog( | ||
content: SingleChildScrollView(child: contentChild), | ||
actions: <Widget>[ | ||
TextButton( | ||
onPressed: () => (Navigator.pop(context, false)), | ||
child: const Text('Refuser')), | ||
TextButton( | ||
onPressed: () => (Navigator.pop(context, true)), | ||
child: const Text('Accepter')) | ||
]); | ||
})); |
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