updated dialogs

This commit is contained in:
Rylee Davis 2023-05-19 09:46:45 -06:00
parent d7769061c5
commit c43e182a52
3 changed files with 111 additions and 102 deletions

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:drifter/theme/app_colors.dart';
import 'ok_button_widget.dart'; import 'ok_button_widget.dart';
@ -16,72 +15,62 @@ class DeleteKeysDialog extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Dialog( return Dialog(
shape: RoundedRectangleBorder( // shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12), // borderRadius: BorderRadius.circular(12),
), // ),
child: Container( child: Container(
constraints: const BoxConstraints(maxWidth: 600), constraints: BoxConstraints(
maxWidth: 700,
maxHeight: 190,
),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white, color: Colors.white,
), ),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( const Text(
padding: const EdgeInsets.symmetric(vertical: 24), "Delete Keys",
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.redAccent,
),
child: const Center(
child: Text(
'Delete Keys!',
style: TextStyle( style: TextStyle(
fontSize: 28, fontSize: 28,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.black87,
), ),
), ),
), const SizedBox(height: 16),
),
const SizedBox(height: 24),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text( Text(
'Do you want to delete your keys?', "Are you sure you want to delete your keys?",
// textAlign: TextAlign.c,
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.grey[700], color: Colors.grey[700],
), ),
), ),
const SizedBox(height: 16), const SizedBox(height: 12),
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
TextButton( OkButton(
onPressed: onNoPressed, onPressed: onNoPressed,
child: Text( label: "No",
'On',
style: TextStyle(color: AppColors.mainDarkBlue),
), ),
const SizedBox(
width: 8,
), ),
OkButton( OkButton(
onPressed: onYesPressed, onPressed: onYesPressed,
label: 'YES', label: "Yes",
), ),
], ],
),
],
),
) )
], ],
), ),
), ),
),
); );
} }
} }

View File

@ -16,7 +16,7 @@ class DrifterDialog extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
ConstrainedBox( ConstrainedBox(
constraints: BoxConstraints( constraints: BoxConstraints(
@ -30,7 +30,7 @@ class DrifterDialog extends StatelessWidget {
), ),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Theme.of(context).extension<StackColors>()!.popupBG, color: Colors.white,
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
20, 20,
), ),

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:drifter/theme/app_colors.dart';
import 'ok_button_widget.dart'; import 'ok_button_widget.dart';
@ -31,35 +30,34 @@ class _KeysExistDialogState extends State<KeysExistDialog> {
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
child: Container( child: Container(
constraints: const BoxConstraints(maxWidth: 600), constraints: BoxConstraints(
maxWidth: 700,
maxHeight: 340,
),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white, color: Colors.white,
), ),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 15.0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Row(
padding: const EdgeInsets.symmetric(vertical: 24), mainAxisAlignment: MainAxisAlignment.center,
decoration: BoxDecoration( children: [
borderRadius: BorderRadius.circular(12), Text(
color: AppColors.mainDarkBlue, "Keys",
),
child: const Center(
child: Text(
'Keys',
style: TextStyle( style: TextStyle(
fontSize: 28, fontSize: 28,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.black,
),
), ),
), ),
],
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
Padding( Column(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
@ -96,33 +94,55 @@ class _KeysExistDialogState extends State<KeysExistDialog> {
), ),
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
Row( Padding(
mainAxisAlignment: MainAxisAlignment padding: const EdgeInsets.symmetric(horizontal: 10.0),
.spaceBetween, // Changed to space between to create space for icon buttons child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
IconButton( MaterialButton(
elevation: 3.0,
onPressed: () {
Navigator.of(context).pop();
},
color: Colors.grey[400],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
8.0,
),
),
child: Text(
"Cancel",
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
_toHex
? OkButton(
onPressed: () { onPressed: () {
setState(() { setState(() {
_toHex = !_toHex; _toHex = !_toHex;
}); });
}, },
icon: const Icon(Icons.autorenew_outlined), label: "Encoded",
color: Colors.grey[700], )
), : OkButton(
OkButton(
onPressed: () { onPressed: () {
Navigator.pop(context); setState(() {
_toHex = !_toHex;
});
}, },
label: 'OK', label: "Hex",
), ),
], ],
),
) )
], ],
), ),
),
], ],
), ),
), ),
),
); );
} }
} }