mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 15:30:59 +00:00
removed enabled
param from settings section
This commit is contained in:
parent
ce4af92b4d
commit
96b7ec0440
1 changed files with 15 additions and 30 deletions
|
@ -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,38 +23,25 @@ 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(
|
|
||||||
opacity: enabled ? Dimens.enabledOpacity : Dimens.disabledOpacity,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
|
padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
|
||||||
child: Row(
|
child: Text(
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
title,
|
title,
|
||||||
style: Theme.of(context)
|
style: Theme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.labelLarge
|
.labelLarge
|
||||||
?.copyWith(color: Theme.of(context).colorScheme.onSurface),
|
?.copyWith(color: Theme.of(context).colorScheme.onSurface),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
|
||||||
if (!enabled)
|
|
||||||
const Icon(
|
|
||||||
Icons.lock,
|
|
||||||
size: Dimens.grid16,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
...children,
|
...children,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue