mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore: bump line length to 120 (#20191)
This commit is contained in:
parent
977c9b96ba
commit
ad65e9011a
517 changed files with 4520 additions and 9514 deletions
|
|
@ -61,8 +61,7 @@ class EndpointInputState extends ConsumerState<EndpointInput> {
|
|||
final url = controller.text;
|
||||
setState(() => auxCheckStatus = AuxCheckStatus.loading);
|
||||
|
||||
final isValid =
|
||||
await ref.read(authProvider.notifier).validateAuxilaryServerUrl(url);
|
||||
final isValid = await ref.read(authProvider.notifier).validateAuxilaryServerUrl(url);
|
||||
|
||||
setState(() {
|
||||
if (mounted) {
|
||||
|
|
@ -140,8 +139,7 @@ class EndpointInputState extends ConsumerState<EndpointInput> {
|
|||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
context.isDarkTheme ? Colors.grey[900]! : Colors.grey[300]!,
|
||||
color: context.isDarkTheme ? Colors.grey[900]! : Colors.grey[300]!,
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -23,12 +23,9 @@ class ExternalNetworkPreference extends HookConsumerWidget {
|
|||
final canSave = useState(false);
|
||||
|
||||
saveEndpointList() {
|
||||
canSave.value =
|
||||
entries.value.every((e) => e.status == AuxCheckStatus.valid);
|
||||
canSave.value = entries.value.every((e) => e.status == AuxCheckStatus.valid);
|
||||
|
||||
final endpointList = entries.value
|
||||
.where((url) => url.status == AuxCheckStatus.valid)
|
||||
.toList();
|
||||
final endpointList = entries.value.where((url) => url.status == AuxCheckStatus.valid).toList();
|
||||
|
||||
final jsonString = jsonEncode(endpointList);
|
||||
|
||||
|
|
@ -39,8 +36,7 @@ class ExternalNetworkPreference extends HookConsumerWidget {
|
|||
}
|
||||
|
||||
updateValidationStatus(String url, int index, AuxCheckStatus status) {
|
||||
entries.value[index] =
|
||||
entries.value[index].copyWith(url: url, status: status);
|
||||
entries.value[index] = entries.value[index].copyWith(url: url, status: status);
|
||||
|
||||
saveEndpointList();
|
||||
}
|
||||
|
|
@ -90,8 +86,7 @@ class ExternalNetworkPreference extends HookConsumerWidget {
|
|||
}
|
||||
|
||||
final List<dynamic> jsonList = jsonDecode(jsonString);
|
||||
entries.value =
|
||||
jsonList.map((e) => AuxilaryEndpoint.fromJson(e)).toList();
|
||||
entries.value = jsonList.map((e) => AuxilaryEndpoint.fromJson(e)).toList();
|
||||
return null;
|
||||
},
|
||||
const [],
|
||||
|
|
|
|||
|
|
@ -59,8 +59,7 @@ class LocalNetworkPreference extends HookConsumerWidget {
|
|||
useEffect(
|
||||
() {
|
||||
final wifiName = ref.read(authProvider.notifier).getSavedWifiName();
|
||||
final localEndpoint =
|
||||
ref.read(authProvider.notifier).getSavedLocalEndpoint();
|
||||
final localEndpoint = ref.read(authProvider.notifier).getSavedLocalEndpoint();
|
||||
|
||||
if (wifiName != null) {
|
||||
wifiNameText.value = wifiName;
|
||||
|
|
@ -131,8 +130,7 @@ class LocalNetworkPreference extends HookConsumerWidget {
|
|||
saveWifiName(wifiName);
|
||||
}
|
||||
|
||||
final serverEndpoint =
|
||||
ref.read(authProvider.notifier).getServerEndpoint();
|
||||
final serverEndpoint = ref.read(authProvider.notifier).getServerEndpoint();
|
||||
|
||||
if (serverEndpoint != null) {
|
||||
saveLocalEndpoint(serverEndpoint);
|
||||
|
|
@ -194,10 +192,7 @@ class LocalNetworkPreference extends HookConsumerWidget {
|
|||
wifiNameText.value,
|
||||
style: context.textTheme.labelLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: enabled
|
||||
? context.primaryColor
|
||||
: context.colorScheme.onSurface
|
||||
.withAlpha(100),
|
||||
color: enabled ? context.primaryColor : context.colorScheme.onSurface.withAlpha(100),
|
||||
fontFamily: 'Inconsolata',
|
||||
),
|
||||
),
|
||||
|
|
@ -217,10 +212,7 @@ class LocalNetworkPreference extends HookConsumerWidget {
|
|||
localEndpointText.value,
|
||||
style: context.textTheme.labelLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: enabled
|
||||
? context.primaryColor
|
||||
: context.colorScheme.onSurface
|
||||
.withAlpha(100),
|
||||
color: enabled ? context.primaryColor : context.colorScheme.onSurface.withAlpha(100),
|
||||
fontFamily: 'Inconsolata',
|
||||
),
|
||||
),
|
||||
|
|
@ -238,8 +230,7 @@ class LocalNetworkPreference extends HookConsumerWidget {
|
|||
height: 48,
|
||||
child: OutlinedButton.icon(
|
||||
icon: const Icon(Icons.wifi_find_rounded),
|
||||
label:
|
||||
Text('use_current_connection'.tr().toUpperCase()),
|
||||
label: Text('use_current_connection'.tr().toUpperCase()),
|
||||
onPressed: enabled ? autofillCurrentNetwork : null,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ class NetworkingSettings extends HookConsumerWidget {
|
|||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final currentEndpoint = getServerUrl();
|
||||
final featureEnabled =
|
||||
useAppSettingsState(AppSettingsEnum.autoEndpointSwitching);
|
||||
final featureEnabled = useAppSettingsState(AppSettingsEnum.autoEndpointSwitching);
|
||||
|
||||
Future<void> checkWifiReadPermission() async {
|
||||
final [hasLocationInUse, hasLocationAlways] = await Future.wait([
|
||||
|
|
@ -39,9 +38,7 @@ class NetworkingSettings extends HookConsumerWidget {
|
|||
actions: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
final isGrant = await ref
|
||||
.read(networkProvider.notifier)
|
||||
.requestWifiReadPermission();
|
||||
final isGrant = await ref.read(networkProvider.notifier).requestWifiReadPermission();
|
||||
|
||||
Navigator.pop(context, isGrant);
|
||||
},
|
||||
|
|
@ -63,9 +60,7 @@ class NetworkingSettings extends HookConsumerWidget {
|
|||
actions: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
final isGrant = await ref
|
||||
.read(networkProvider.notifier)
|
||||
.requestWifiReadBackgroundPermission();
|
||||
final isGrant = await ref.read(networkProvider.notifier).requestWifiReadBackgroundPermission();
|
||||
|
||||
Navigator.pop(context, isGrant);
|
||||
},
|
||||
|
|
@ -77,8 +72,7 @@ class NetworkingSettings extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
if (isGrantLocationAlwaysPermission != null &&
|
||||
!isGrantLocationAlwaysPermission) {
|
||||
if (isGrantLocationAlwaysPermission != null && !isGrantLocationAlwaysPermission) {
|
||||
await ref.read(networkProvider.notifier).openSettings();
|
||||
}
|
||||
}
|
||||
|
|
@ -101,9 +95,7 @@ class NetworkingSettings extends HookConsumerWidget {
|
|||
padding: const EdgeInsets.only(top: 8, left: 16, bottom: 8),
|
||||
child: NetworkPreferenceTitle(
|
||||
title: "current_server_address".tr().toUpperCase(),
|
||||
icon: (currentEndpoint?.startsWith('https') ?? false)
|
||||
? Icons.https_outlined
|
||||
: Icons.http_outlined,
|
||||
icon: (currentEndpoint?.startsWith('https') ?? false) ? Icons.https_outlined : Icons.http_outlined,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue