mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-23 23:39:12 +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) {
|
void openEditCommentModal(Map<String, dynamic> item, int position) {
|
||||||
if (width > 900 || !(Platform.isAndroid || Platform.isIOS)) {
|
if (width > 900 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||||
showDialog(
|
showDialog(
|
||||||
|
@ -267,9 +305,14 @@ class _FallbackDnsScreenState extends State<FallbackDnsScreen> {
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
ElevatedButton.icon(
|
||||||
|
onPressed: openAddCommentModal,
|
||||||
|
icon: const Icon(Icons.add),
|
||||||
|
label: Text(AppLocalizations.of(context)!.comment)
|
||||||
|
),
|
||||||
ElevatedButton.icon(
|
ElevatedButton.icon(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() => fallbackControllers.add({
|
setState(() => fallbackControllers.add({
|
||||||
|
@ -279,7 +322,7 @@ class _FallbackDnsScreenState extends State<FallbackDnsScreen> {
|
||||||
checkValidValues();
|
checkValidValues();
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.add),
|
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