Merge branch 'feature/PSDK-1024/alert_sheet' into 'develop'
PSDK-1024 - Правки по диалоговому окну See merge request mobile/Flutter/nut_player!43
This commit is contained in:
@@ -33,25 +33,28 @@ class OptionsView extends StatelessWidget {
|
||||
void _showAlertDialog(BuildContext context) {
|
||||
showCupertinoModalPopup<void>(
|
||||
context: context,
|
||||
barrierColor: CupertinoColors.black.withOpacity(0.5),
|
||||
builder: (BuildContext context) => CupertinoActionSheet(
|
||||
title: Text(title),
|
||||
actions: <CupertinoActionSheetAction>[...options.indexed.map((valueIndex) {
|
||||
return CupertinoActionSheetAction(
|
||||
child: Text(valueIndex.$2.title),
|
||||
onPressed: () {
|
||||
newSelection?.call(valueIndex.$1);
|
||||
Navigator.pop(context);
|
||||
}
|
||||
);
|
||||
}).toList() + [
|
||||
CupertinoActionSheetAction(
|
||||
title: Text(title, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: CupertinoColors.darkBackgroundGray)),
|
||||
actions: <Widget>[...options.indexed.map((valueIndex) {
|
||||
return Container(
|
||||
color: CupertinoColors.white.withOpacity(0.8),
|
||||
child: CupertinoActionSheetAction(
|
||||
onPressed: () {
|
||||
newSelection?.call(valueIndex.$1);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text(valueIndex.$2.title)
|
||||
),
|
||||
);
|
||||
}).toList()],
|
||||
cancelButton: CupertinoActionSheetAction(
|
||||
isDefaultAction: true,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Text('Отмена'),
|
||||
)]
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user