updated project style guidelines

This commit is contained in:
2024-04-03 19:18:17 +02:00
parent 27618f4404
commit 4c7f53e309
185 changed files with 505 additions and 873 deletions

View File

@ -13,15 +13,12 @@ class DebugTile {
bool devConditionFulfilled() => Provider.of<SettingsProvider>(context, listen: false).val().devToolsEnabled && (onlyInDebug ? kDebugMode : true);
Widget jsonData(Map<String, dynamic> data, {bool ignoreConfig = false}) {
return callback(
Widget jsonData(Map<String, dynamic> data, {bool ignoreConfig = false}) => callback(
title: 'JSON daten anzeigen',
onTab: () => JsonViewer.asDialog(context, data)
);
}
Widget callback({String title = 'Debugaktion', required void Function() onTab}) {
return child(
Widget callback({String title = 'Debugaktion', required void Function() onTab}) => child(
ListTile(
leading: const CenteredLeading(Icon(Icons.developer_mode_outlined)),
title: Text(title),
@ -29,17 +26,14 @@ class DebugTile {
onTap: onTab,
)
);
}
Widget child(Widget child) {
return Visibility(
Widget child(Widget child) => Visibility(
visible: devConditionFulfilled(),
child: child,
);
}
void run(void Function() callback) {
if(!devConditionFulfilled()) return;
callback();
}
}
}