-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51a1bcb
commit 752f513
Showing
5 changed files
with
188 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import 'package:calendar_view/calendar_view.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class DeleteEventDialog extends StatefulWidget { | ||
@override | ||
_RadioDialogState createState() => _RadioDialogState(); | ||
} | ||
|
||
class _RadioDialogState extends State<DeleteEventDialog> { | ||
DeleteEvent _selectedOption = DeleteEvent.current; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return AlertDialog( | ||
title: Text('Delete recurring event '), | ||
content: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
RadioListTile<DeleteEvent>( | ||
title: Text('This event'), | ||
value: DeleteEvent.current, | ||
groupValue: _selectedOption, | ||
onChanged: (deleteType) { | ||
if (deleteType != null) { | ||
setState(() => _selectedOption = deleteType); | ||
} | ||
}, | ||
), | ||
RadioListTile<DeleteEvent>( | ||
title: Text('This and following events'), | ||
value: DeleteEvent.following, | ||
groupValue: _selectedOption, | ||
onChanged: (deleteType) { | ||
if (deleteType != null) { | ||
setState(() => _selectedOption = deleteType); | ||
} | ||
}, | ||
), | ||
RadioListTile<DeleteEvent>( | ||
title: Text('All events'), | ||
value: DeleteEvent.all, | ||
groupValue: _selectedOption, | ||
onChanged: (deleteType) { | ||
if (deleteType != null) { | ||
setState(() => _selectedOption = deleteType); | ||
} | ||
}, | ||
), | ||
], | ||
), | ||
actions: [ | ||
TextButton( | ||
onPressed: () => Navigator.of(context).pop(), | ||
child: Text('Cancel'), | ||
), | ||
TextButton( | ||
onPressed: () => Navigator.of(context).pop(_selectedOption), | ||
child: Text('Done'), | ||
), | ||
], | ||
); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -67,3 +67,10 @@ enum RecurrenceEnd { | |
on, | ||
after, | ||
} | ||
|
||
// TODO(Shubham): Add docs | ||
enum DeleteEvent { | ||
all, | ||
current, | ||
following, | ||
} |
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