-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Connection wifi and permission popup
- Loading branch information
Showing
6 changed files
with
65 additions
and
11 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
47 changes: 47 additions & 0 deletions
47
lib/presentation/molecules/permissions_dialog_molecule.dart
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,47 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:cybearjinni/presentation/atoms/button_atom.dart'; | ||
import 'package:cybearjinni/presentation/atoms/separator_atom.dart'; | ||
import 'package:easy_localization/easy_localization.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
void permsissionsDialog(BuildContext context) => showDialog( | ||
context: context, | ||
barrierDismissible: false, | ||
builder: (_) => const PermsissionsDialogMolecule(), | ||
); | ||
|
||
class PermsissionsDialogMolecule extends StatelessWidget { | ||
const PermsissionsDialogMolecule({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final ThemeData themeData = Theme.of(context); | ||
final TextTheme textTheme = themeData.textTheme; | ||
|
||
return AlertDialog( | ||
content: SizedBox( | ||
width: MediaQuery.of(context).size.width, | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: <Widget>[ | ||
Text( | ||
'1. Make sure you are connected to home WiFi\n' | ||
'2. Please make sure location is on and permission grented.', | ||
style: textTheme.labelLarge, | ||
textAlign: TextAlign.center, | ||
).tr(), | ||
const SeparatorAtom(), | ||
ButtonWidgetAtom( | ||
variant: ButtonVariant.primary, | ||
onPressed: () async { | ||
exit(0); | ||
}, | ||
text: 'exit', | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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