updated project style guidelines
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user