mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-26 00:36:09 +00:00
Added add comment fallback dns
This commit is contained in:
parent
019367ca93
commit
654284b46a
1 changed files with 45 additions and 2 deletions
|
@ -113,6 +113,44 @@ class _FallbackDnsScreenState extends State<FallbackDnsScreen> {
|
|||
}
|
||||
}
|
||||
|
||||
void openAddCommentModal() {
|
||||
if (width > 900 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => CommentModal(
|
||||
onConfirm: (value) {
|
||||
setState(() {
|
||||
fallbackControllers.add({
|
||||
'comment': value
|
||||
});
|
||||
});
|
||||
},
|
||||
dialog: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
useRootNavigator: true,
|
||||
builder: (context) => CommentModal(
|
||||
onConfirm: (value) {
|
||||
setState(() {
|
||||
fallbackControllers.add({
|
||||
'comment': value
|
||||
});
|
||||
});
|
||||
},
|
||||
dialog: false,
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
isScrollControlled: true,
|
||||
isDismissible: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void openEditCommentModal(Map<String, dynamic> item, int position) {
|
||||
if (width > 900 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||
showDialog(
|
||||
|
@ -267,9 +305,14 @@ class _FallbackDnsScreenState extends State<FallbackDnsScreen> {
|
|||
),
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ElevatedButton.icon(
|
||||
onPressed: openAddCommentModal,
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(AppLocalizations.of(context)!.comment)
|
||||
),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
setState(() => fallbackControllers.add({
|
||||
|
@ -279,7 +322,7 @@ class _FallbackDnsScreenState extends State<FallbackDnsScreen> {
|
|||
checkValidValues();
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(AppLocalizations.of(context)!.addItem)
|
||||
label: Text(AppLocalizations.of(context)!.address)
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue