I am trying to make a platform specific dialog, but mine solution all the time shows android (i am working on iphone simulator). Do you have any idea what is the problem?
onTap: () => _onDeletePanel(context),
),
],
),
);
}
}
Future<void> _onDeletePanel(BuildContext context) async {
if (!Platform.isMacOS) {
await showDialog<bool>(
barrierDismissible: false,
context: context,
builder: (context) => AppConfirmationDialog(
title: 'Are you sure?',
contentText: 'Would you like to delete this?',
confirmText: I10n.of(context).reset,
),
);
} else {
await showCupertinoDialog<bool>(
context: context,
builder: (context) => CupertinoAlertDialog(
title: Text('Are you sure?'),
content: Text('Would you like to delete this?'),
actions: [],
),
);
}
}
like you've uset the
Platform.isMacOSto execute some code, do the same for the other platforms you targetPlatform.isIOS