mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-22 14:59:12 +00:00
Added no items to reorder message
This commit is contained in:
parent
5ca3c04c89
commit
11dd6b23bd
4 changed files with 25 additions and 9 deletions
|
@ -771,5 +771,6 @@
|
||||||
"customRulesUpdatedSuccessfully": "Custom rules updated successfully",
|
"customRulesUpdatedSuccessfully": "Custom rules updated successfully",
|
||||||
"customRulesNotUpdated": "Custom rules could not be updated",
|
"customRulesNotUpdated": "Custom rules could not be updated",
|
||||||
"reorder": "Reorder",
|
"reorder": "Reorder",
|
||||||
"showHide": "Show/hide"
|
"showHide": "Show/hide",
|
||||||
|
"noElementsReorderMessage": "Enable some elements on the show/hide tab to reorder them here."
|
||||||
}
|
}
|
|
@ -771,5 +771,6 @@
|
||||||
"customRulesUpdatedSuccessfully": "Reglas personalizadas actualizadas correctamente",
|
"customRulesUpdatedSuccessfully": "Reglas personalizadas actualizadas correctamente",
|
||||||
"customRulesNotUpdated": "Las reglas personalizadas no pudieron ser actualizadas",
|
"customRulesNotUpdated": "Las reglas personalizadas no pudieron ser actualizadas",
|
||||||
"reorder": "Reordenar",
|
"reorder": "Reordenar",
|
||||||
"showHide": "Mostrar/ocultar"
|
"showHide": "Mostrar/ocultar",
|
||||||
|
"noElementsReorderMessage": "Activa algunos elementos en la pestaña de mostrar/ocultar para reordenarlos aquí."
|
||||||
}
|
}
|
|
@ -370,7 +370,7 @@ class AppConfigProvider with ChangeNotifier {
|
||||||
_hideServerAddress = sharedPreferencesInstance.getBool('hideServerAddress') ?? false;
|
_hideServerAddress = sharedPreferencesInstance.getBool('hideServerAddress') ?? false;
|
||||||
if (sharedPreferencesInstance.getStringList('homeTopItemsOrder') != null) {
|
if (sharedPreferencesInstance.getStringList('homeTopItemsOrder') != null) {
|
||||||
try {
|
try {
|
||||||
final itemsOrder = List<HomeTopItems>.from(
|
_homeTopItemsOrder = List<HomeTopItems>.from(
|
||||||
List<String>.from(sharedPreferencesInstance.getStringList('homeTopItemsOrder')!).map((e) {
|
List<String>.from(sharedPreferencesInstance.getStringList('homeTopItemsOrder')!).map((e) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case 'queriedDomains':
|
case 'queriedDomains':
|
||||||
|
@ -393,11 +393,6 @@ class AppConfigProvider with ChangeNotifier {
|
||||||
}
|
}
|
||||||
}).where((e) => e != null).toList()
|
}).where((e) => e != null).toList()
|
||||||
);
|
);
|
||||||
final missingItems = homeTopItemsDefaultOrder.where((e) => !itemsOrder.contains(e));
|
|
||||||
_homeTopItemsOrder = [
|
|
||||||
...itemsOrder,
|
|
||||||
...missingItems
|
|
||||||
];
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Sentry.captureException(e);
|
Sentry.captureException(e);
|
||||||
_homeTopItemsOrder = homeTopItemsDefaultOrder;
|
_homeTopItemsOrder = homeTopItemsDefaultOrder;
|
||||||
|
|
|
@ -122,7 +122,26 @@ class _ReorderableTopItemsHomeState extends State<ReorderableTopItemsHome> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
reorderable_list.ReorderableList(
|
if (homeTopItemsList.isEmpty) Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context)!.noElementsReorderMessage,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (homeTopItemsList.isNotEmpty) reorderable_list.ReorderableList(
|
||||||
onReorder: _reorderCallback,
|
onReorder: _reorderCallback,
|
||||||
onReorderDone: _reorderDone,
|
onReorderDone: _reorderDone,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
|
Loading…
Add table
Reference in a new issue