removed enabled param from settings section

This commit is contained in:
Vadim 2023-03-23 23:15:54 +03:00
parent ce4af92b4d
commit 96b7ec0440

View file

@ -4,12 +4,10 @@ import 'package:lightmeter/res/dimens.dart';
class SettingsSection extends StatelessWidget { class SettingsSection extends StatelessWidget {
final String title; final String title;
final List<Widget> children; final List<Widget> children;
final bool enabled;
const SettingsSection({ const SettingsSection({
required this.title, required this.title,
required this.children, required this.children,
this.enabled = true,
super.key, super.key,
}); });
@ -25,35 +23,22 @@ class SettingsSection extends StatelessWidget {
child: Card( child: Card(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: Dimens.paddingM), padding: const EdgeInsets.symmetric(vertical: Dimens.paddingM),
child: Opacity( child: Column(
opacity: enabled ? Dimens.enabledOpacity : Dimens.disabledOpacity, crossAxisAlignment: CrossAxisAlignment.start,
child: Column( mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, children: [
mainAxisSize: MainAxisSize.min, Padding(
children: [ padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
Padding( child: Text(
padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM), title,
child: Row( style: Theme.of(context)
children: [ .textTheme
Text( .labelLarge
title, ?.copyWith(color: Theme.of(context).colorScheme.onSurface),
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(color: Theme.of(context).colorScheme.onSurface),
),
const Spacer(),
if (!enabled)
const Icon(
Icons.lock,
size: Dimens.grid16,
),
],
),
), ),
...children, ),
], ...children,
), ],
), ),
), ),
), ),