Skip to content

Commit

Permalink
confirm deletion widget improved UI
Browse files Browse the repository at this point in the history
  • Loading branch information
josancamon19 committed Jun 15, 2024
1 parent 100f6a4 commit 65da938
Showing 1 changed file with 61 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,86 +27,71 @@ class _ConfirmDeletionWidgetState extends State<ConfirmDeletionWidget> {

@override
Widget build(BuildContext context) {
return Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 12.0),
child: Container(
width: double.infinity,
height: 500.0,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
boxShadow: const [
BoxShadow(
blurRadius: 3.0,
color: Color(0x33000000),
offset: Offset(0.0, 1.0),
)
],
borderRadius: BorderRadius.circular(24.0),
border: Border.all(
color: const Color(0x00F1F4F8),
),
return Container(
height: 130,
margin: const EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primary,
borderRadius: BorderRadius.circular(20),
shape: BoxShape.rectangle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 8),
const Text(
'Are you sure you want to delete this memory?',
textAlign: TextAlign.center,
),
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
'Are you sure you want to delete this memory?',
textAlign: TextAlign.center,
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 12.0, 24.0, 0.0),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 12.0, 0.0),
child: MaterialButton(
onPressed: () async {
Navigator.pop(context);
},
height: 40.0,
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
color: Theme.of(context).colorScheme.surface,
textColor: Theme.of(context).primaryColor,
elevation: 0.0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(40)),
child: const Text('Cancel'),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 12.0, 0.0),
child: MaterialButton(
onPressed: () async {
deleteVector(widget.memory.id.toString());
await MemoryProvider().deleteMemory(widget.memory);
Navigator.pop(context);
widget.onDelete?.call();
MixpanelManager().memoryDeleted(widget.memory);
},
height: 40.0,
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
color: const Color(0xFF780000),
textColor: Colors.white,
// STYLE ME
elevation: 0.0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(40)),
child: const Text('Delete'),
),
),
],
const SizedBox(height: 16),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 12.0, 0.0),
child: MaterialButton(
onPressed: () async {
Navigator.pop(context);
},
height: 40.0,
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
color: Theme.of(context).colorScheme.surface,
textColor: Theme.of(context).primaryColor,
elevation: 0.0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(40)),
child: const Text(
'Cancel',
style: TextStyle(color: Colors.grey),
),
),
],
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 12.0, 0.0),
child: MaterialButton(
onPressed: () async {
deleteVector(widget.memory.id.toString());
await MemoryProvider().deleteMemory(widget.memory);
Navigator.pop(context);
widget.onDelete?.call();
MixpanelManager().memoryDeleted(widget.memory);
},
height: 40.0,
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
color: const Color(0xFF780000),
textColor: Colors.white,
// STYLE ME
elevation: 0.0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(40)),
child: const Text('Delete'),
),
),
],
),
),
],
),
);
}
Expand Down

0 comments on commit 65da938

Please sign in to comment.