mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor: DCM - const border radius, constructor & switch expressions (#19515)
* enable border radius, switch exp, const constructor * regenerate provider * more formatting --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
05064f87f0
commit
5b0575b956
130 changed files with 338 additions and 264 deletions
|
|
@ -97,7 +97,7 @@ class BackgroundBackupSettings extends ConsumerWidget {
|
|||
onBatteryInfo: showBatteryOptimizationInfoToUser,
|
||||
),
|
||||
if (Platform.isIOS && iosSettings?.appRefreshEnabled != true)
|
||||
_IOSBackgroundRefreshDisabled(),
|
||||
const _IOSBackgroundRefreshDisabled(),
|
||||
if (Platform.isIOS && iosSettings != null)
|
||||
IosDebugInfoTile(settings: iosSettings),
|
||||
],
|
||||
|
|
@ -106,6 +106,8 @@ class BackgroundBackupSettings extends ConsumerWidget {
|
|||
}
|
||||
|
||||
class _IOSBackgroundRefreshDisabled extends StatelessWidget {
|
||||
const _IOSBackgroundRefreshDisabled();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SettingsButtonListTile(
|
||||
|
|
|
|||
|
|
@ -17,8 +17,9 @@ class ExternalNetworkPreference extends HookConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final entries =
|
||||
useState([AuxilaryEndpoint(url: '', status: AuxCheckStatus.unknown)]);
|
||||
final entries = useState(
|
||||
[const AuxilaryEndpoint(url: '', status: AuxCheckStatus.unknown)],
|
||||
);
|
||||
final canSave = useState(false);
|
||||
|
||||
saveEndpointList() {
|
||||
|
|
@ -169,7 +170,7 @@ class ExternalNetworkPreference extends HookConsumerWidget {
|
|||
? () {
|
||||
entries.value = [
|
||||
...entries.value,
|
||||
AuxilaryEndpoint(
|
||||
const AuxilaryEndpoint(
|
||||
url: '',
|
||||
status: AuxCheckStatus.unknown,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
|||
import 'package:immich_mobile/extensions/theme_extensions.dart';
|
||||
import 'package:immich_mobile/providers/theme.provider.dart';
|
||||
import 'package:immich_mobile/services/app_settings.service.dart';
|
||||
import 'package:immich_mobile/utils/hooks/app_settings_update_hook.dart';
|
||||
import 'package:immich_mobile/theme/color_scheme.dart';
|
||||
import 'package:immich_mobile/theme/dynamic_theme.dart';
|
||||
import 'package:immich_mobile/utils/hooks/app_settings_update_hook.dart';
|
||||
|
||||
class PrimaryColorSetting extends HookConsumerWidget {
|
||||
const PrimaryColorSetting({
|
||||
|
|
@ -136,8 +136,8 @@ class PrimaryColorSetting extends HookConsumerWidget {
|
|||
dense: true,
|
||||
activeColor: context.primaryColor,
|
||||
tileColor: context.colorScheme.surfaceContainerHigh,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(15)),
|
||||
),
|
||||
title: Text(
|
||||
'theme_setting_system_primary_color_title'.tr(),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ class SettingsRadioGroup<T> {
|
|||
final String title;
|
||||
final T value;
|
||||
|
||||
SettingsRadioGroup({required this.title, required this.value});
|
||||
const SettingsRadioGroup({required this.title, required this.value});
|
||||
}
|
||||
|
||||
class SettingsRadioListTile<T> extends StatelessWidget {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue