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:
shenlong 2025-07-29 00:34:03 +05:30 committed by GitHub
parent 9b3718120b
commit e52b9d15b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
643 changed files with 32561 additions and 35292 deletions

View file

@ -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());
}
}