mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
9b3718120b
commit
e52b9d15b5
643 changed files with 32561 additions and 35292 deletions
|
|
@ -30,24 +30,15 @@ class _SslClientCertSettingsState extends State<SslClientCertSettings> {
|
|||
contentPadding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
horizontalTitleGap: 20,
|
||||
isThreeLine: true,
|
||||
title: Text(
|
||||
"client_cert_title".tr(),
|
||||
style: context.textTheme.bodyLarge?.copyWith(
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
title: Text("client_cert_title".tr(), style: context.textTheme.bodyLarge?.copyWith(fontWeight: FontWeight.w500)),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"client_cert_subtitle".tr(),
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: context.colorScheme.onSurfaceSecondary,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 6,
|
||||
style: context.textTheme.bodyMedium?.copyWith(color: context.colorScheme.onSurfaceSecondary),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
|
@ -57,9 +48,7 @@ class _SslClientCertSettingsState extends State<SslClientCertSettings> {
|
|||
onPressed: widget.isLoggedIn ? null : () => importCert(context),
|
||||
child: Text("client_cert_import".tr()),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
ElevatedButton(
|
||||
onPressed: widget.isLoggedIn || !isCertExist ? null : () async => await removeCert(context),
|
||||
child: Text("remove".tr()),
|
||||
|
|
@ -76,39 +65,25 @@ class _SslClientCertSettingsState extends State<SslClientCertSettings> {
|
|||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text(message),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => ctx.pop(),
|
||||
child: Text("client_cert_dialog_msg_confirm".tr()),
|
||||
),
|
||||
],
|
||||
actions: [TextButton(onPressed: () => ctx.pop(), child: Text("client_cert_dialog_msg_confirm".tr()))],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> storeCert(
|
||||
BuildContext context,
|
||||
Uint8List data,
|
||||
String? password,
|
||||
) async {
|
||||
Future<void> storeCert(BuildContext context, Uint8List data, String? password) async {
|
||||
if (password != null && password.isEmpty) {
|
||||
password = null;
|
||||
}
|
||||
final cert = SSLClientCertStoreVal(data, password);
|
||||
// Test whether the certificate is valid
|
||||
final isCertValid = HttpSSLCertOverride.setClientCert(
|
||||
SecurityContext(withTrustedRoots: true),
|
||||
cert,
|
||||
);
|
||||
final isCertValid = HttpSSLCertOverride.setClientCert(SecurityContext(withTrustedRoots: true), cert);
|
||||
if (!isCertValid) {
|
||||
showMessage(context, "client_cert_invalid_msg".tr());
|
||||
return;
|
||||
}
|
||||
await cert.save();
|
||||
HttpSSLOptions.apply();
|
||||
setState(
|
||||
() => isCertExist = true,
|
||||
);
|
||||
setState(() => isCertExist = true);
|
||||
showMessage(context, "client_cert_import_success_msg".tr());
|
||||
}
|
||||
|
||||
|
|
@ -122,9 +97,7 @@ class _SslClientCertSettingsState extends State<SslClientCertSettings> {
|
|||
controller: password,
|
||||
obscureText: true,
|
||||
obscuringCharacter: "*",
|
||||
decoration: InputDecoration(
|
||||
hintText: "client_cert_enter_password".tr(),
|
||||
),
|
||||
decoration: InputDecoration(hintText: "client_cert_enter_password".tr()),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
|
|
@ -139,10 +112,7 @@ class _SslClientCertSettingsState extends State<SslClientCertSettings> {
|
|||
Future<void> importCert(BuildContext ctx) async {
|
||||
FilePickerResult? res = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: [
|
||||
'p12',
|
||||
'pfx',
|
||||
],
|
||||
allowedExtensions: ['p12', 'pfx'],
|
||||
);
|
||||
if (res != null) {
|
||||
File file = File(res.files.single.path!);
|
||||
|
|
@ -154,9 +124,7 @@ class _SslClientCertSettingsState extends State<SslClientCertSettings> {
|
|||
Future<void> removeCert(BuildContext context) async {
|
||||
await SSLClientCertStoreVal.delete();
|
||||
HttpSSLOptions.apply();
|
||||
setState(
|
||||
() => isCertExist = false,
|
||||
);
|
||||
setState(() => isCertExist = false);
|
||||
showMessage(context, "client_cert_remove_msg".tr());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue