extract SettingsCheckboxTile for settings toggles
This commit is contained in:
@@ -6,13 +6,13 @@ import 'package:hydrated_bloc/hydrated_bloc.dart';
|
||||
import '../../../../routing/app_routes.dart';
|
||||
import '../../../../state/app/modules/settings/bloc/settings_cubit.dart';
|
||||
import '../../../../storage/settings.dart' as model;
|
||||
import '../../../../utils/haptics.dart';
|
||||
import '../../../../widget/centered_leading.dart';
|
||||
import '../../../../widget/confirm_dialog.dart';
|
||||
import '../../../../widget/debug/cache_view.dart';
|
||||
import '../../../../widget/debug/json_viewer.dart';
|
||||
import '../../../../widget/details_bottom_sheet.dart';
|
||||
import '../widgets/endpoint_picker.dart';
|
||||
import '../widgets/settings_checkbox_tile.dart';
|
||||
|
||||
class DevToolsSection extends StatefulWidget {
|
||||
final SettingsCubit settings;
|
||||
@@ -41,49 +41,32 @@ class _DevToolsSectionState extends State<DevToolsSection> {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.auto_graph_outlined),
|
||||
title: const Text('Performance graph'),
|
||||
trailing: Checkbox(
|
||||
value: dev.showPerformanceOverlay,
|
||||
onChanged: (e) {
|
||||
Haptics.selection();
|
||||
widget.settings
|
||||
.val(write: true)
|
||||
.devToolsSettings
|
||||
.showPerformanceOverlay = e!;
|
||||
},
|
||||
),
|
||||
SettingsCheckboxTile(
|
||||
icon: Icons.auto_graph_outlined,
|
||||
title: 'Performance graph',
|
||||
value: dev.showPerformanceOverlay,
|
||||
onChanged: (e) => widget.settings
|
||||
.val(write: true)
|
||||
.devToolsSettings
|
||||
.showPerformanceOverlay = e,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(
|
||||
Icons.screen_search_desktop_outlined,
|
||||
),
|
||||
title: const Text('Indicate offscreen layers'),
|
||||
trailing: Checkbox(
|
||||
value: dev.checkerboardOffscreenLayers,
|
||||
onChanged: (e) {
|
||||
Haptics.selection();
|
||||
widget.settings
|
||||
.val(write: true)
|
||||
.devToolsSettings
|
||||
.checkerboardOffscreenLayers = e!;
|
||||
},
|
||||
),
|
||||
SettingsCheckboxTile(
|
||||
icon: Icons.screen_search_desktop_outlined,
|
||||
title: 'Indicate offscreen layers',
|
||||
value: dev.checkerboardOffscreenLayers,
|
||||
onChanged: (e) => widget.settings
|
||||
.val(write: true)
|
||||
.devToolsSettings
|
||||
.checkerboardOffscreenLayers = e,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.imagesearch_roller_outlined),
|
||||
title: const Text('Indicate raster cache images'),
|
||||
trailing: Checkbox(
|
||||
value: dev.checkerboardRasterCacheImages,
|
||||
onChanged: (e) {
|
||||
Haptics.selection();
|
||||
widget.settings
|
||||
.val(write: true)
|
||||
.devToolsSettings
|
||||
.checkerboardRasterCacheImages = e!;
|
||||
},
|
||||
),
|
||||
SettingsCheckboxTile(
|
||||
icon: Icons.imagesearch_roller_outlined,
|
||||
title: 'Indicate raster cache images',
|
||||
value: dev.checkerboardRasterCacheImages,
|
||||
onChanged: (e) => widget.settings
|
||||
.val(write: true)
|
||||
.devToolsSettings
|
||||
.checkerboardRasterCacheImages = e,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user