flutter-3.19.6

This commit is contained in:
wanghongenpin
2026-01-26 18:21:03 +08:00
parent bf04f4467c
commit 861be99546
10 changed files with 31 additions and 35 deletions

View File

@@ -132,7 +132,7 @@ class _HeadersWidgetState extends State<HeadersWidget> {
return [
CodeTheme(
data: CodeThemeData(
styles: Theme.brightnessOf(context) == Brightness.light ? atomOneLightTheme : atomOneDarkTheme),
styles: Theme.of(context).brightness == Brightness.light ? atomOneLightTheme : atomOneDarkTheme),
child: CodeField(
background: Colors.transparent,
readOnly: Platforms.isMobile(),

View File

@@ -47,7 +47,7 @@ class DesktopHomePage extends StatefulWidget {
final Configuration configuration;
final AppConfiguration appConfiguration;
const DesktopHomePage(this.configuration, this.appConfiguration, {super.key, required});
const DesktopHomePage(this.configuration, this.appConfiguration, {super.key});
@override
State<DesktopHomePage> createState() => _DesktopHomePagePageState();
@@ -120,7 +120,7 @@ class _DesktopHomePagePageState extends State<DesktopHomePage> implements EventL
// color: Theme.of(context).brightness == Brightness.dark ? null : Color(0xFFF9F9F9),
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor.withValues(alpha: 0.3),
color: Theme.of(context).dividerColor.withOpacity(0.3),
width: Platform.isMacOS ? 0.2 : 0.55))),
child: Platform.isMacOS
? Toolbar(proxyServer, requestListStateKey)

View File

@@ -215,7 +215,7 @@ class _CryptoRuleListState extends State<CryptoRuleList> {
child: Container(
padding: const EdgeInsets.only(top: 10),
constraints: const BoxConstraints(minHeight: 200, maxHeight: 600),
decoration: BoxDecoration(border: Border.all(color: Colors.grey.withAlpha((0.2 * 255).round()))),
decoration: BoxDecoration(border: Border.all(color: Colors.grey.withOpacity(0.2))),
child: Column(
children: [
Padding(
@@ -508,10 +508,10 @@ class _CryptoRuleDialogState extends State<CryptoRuleDialog> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Card(
color: Theme.of(context).colorScheme.surfaceContainerLow.withAlpha((0.5 * 255).round()),
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor.withAlpha((0.2 * 255).round())),
side: BorderSide(color: Theme.of(context).dividerColor.withOpacity(0.2)),
borderRadius: BorderRadius.circular(8),
),
child: Padding(
@@ -544,10 +544,10 @@ class _CryptoRuleDialogState extends State<CryptoRuleDialog> {
),
const SizedBox(height: 12),
Card(
color: Theme.of(context).colorScheme.surfaceContainerLow.withAlpha((0.5 * 255).round()),
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor.withAlpha((0.2 * 255).round())),
side: BorderSide(color: Theme.of(context).dividerColor.withOpacity(0.2)),
borderRadius: BorderRadius.circular(8),
),
child: Padding(
@@ -562,7 +562,7 @@ class _CryptoRuleDialogState extends State<CryptoRuleDialog> {
height: 42,
padding: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).dividerColor.withAlpha((0.12 * 255).round())),
border: Border.all(color: Theme.of(context).dividerColor.withOpacity(0.12)),
borderRadius: BorderRadius.circular(6),
),
child: DropdownButtonHideUnderline(
@@ -584,7 +584,7 @@ class _CryptoRuleDialogState extends State<CryptoRuleDialog> {
height: 42,
padding: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).dividerColor.withAlpha((0.12 * 255).round())),
border: Border.all(color: Theme.of(context).dividerColor.withOpacity(0.12)),
borderRadius: BorderRadius.circular(6),
),
child: DropdownButtonHideUnderline(
@@ -606,7 +606,7 @@ class _CryptoRuleDialogState extends State<CryptoRuleDialog> {
height: 42,
padding: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).dividerColor.withAlpha((0.12 * 255).round())),
border: Border.all(color: Theme.of(context).dividerColor.withOpacity(0.12)),
borderRadius: BorderRadius.circular(6),
),
child: DropdownButtonHideUnderline(
@@ -631,7 +631,7 @@ class _CryptoRuleDialogState extends State<CryptoRuleDialog> {
width: 92,
padding: const EdgeInsets.symmetric(horizontal: 6),
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).dividerColor.withAlpha((0.12 * 255).round())),
border: Border.all(color: Theme.of(context).dividerColor.withOpacity(0.12)),
borderRadius: BorderRadius.circular(6),
),
child: DropdownButtonHideUnderline(
@@ -668,7 +668,7 @@ class _CryptoRuleDialogState extends State<CryptoRuleDialog> {
constraints: const BoxConstraints(minWidth: 92),
padding: const EdgeInsets.symmetric(horizontal: 6),
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).dividerColor.withAlpha((0.12 * 255).round())),
border: Border.all(color: Theme.of(context).dividerColor.withOpacity(0.12)),
borderRadius: BorderRadius.circular(6),
),
child: DropdownButtonHideUnderline(
@@ -710,7 +710,7 @@ class _CryptoRuleDialogState extends State<CryptoRuleDialog> {
if (ivSource == 'prefix')
Container(
decoration: BoxDecoration(
border: Border.all(color: theme.dividerColor.withAlpha(0x40)),
border: Border.all(color: theme.dividerColor.withOpacity(0.25)),
borderRadius: BorderRadius.circular(4)),
child: Row(children: [
IconButton(

View File

@@ -616,8 +616,6 @@ class _RewriteRuleEditState extends State<RewriteRuleEdit> {
child: Text(isCN ? e.label : e.name, style: const TextStyle(fontSize: 14))))
.toList(),
onChanged: onChangeType,
// older Flutter versions expect `value` instead of `initialValue`
value: ruleType,
)),
const SizedBox(width: 10),
]),

View File

@@ -583,7 +583,7 @@ class _ScriptEditState extends State<ScriptEdit> {
width: 155,
height: 34,
child: DropdownButtonFormField<bool>(
initialValue: _useRemote,
value: _useRemote,
items: [
DropdownMenuItem(value: false, child: Text(localizations.local)),
DropdownMenuItem(value: true, child: Text(localizations.remoteUrl)),

View File

@@ -149,7 +149,7 @@ class _ConfigPageState extends State<ConfigPage> {
leading: Icon(Icons.lock_outline, color: color),
trailing: arrow,
onTap: () => navigator(context, const MobileRequestCryptoPage())),
Divider(height: 0, thickness: 0.3, color: Theme.of(context).dividerColor.withValues(alpha: 0.22)),
Divider(height: 0, thickness: 0.3, color: Theme.of(context).dividerColor.withOpacity(0.22)),
ListTile(
title: Text(localizations.script),
leading: Icon(Icons.javascript_outlined, color: color),

View File

@@ -494,10 +494,10 @@ class _MobileCryptoRuleEditPageState extends State<MobileCryptoRuleEditPage> {
padding: const EdgeInsets.all(12),
children: [
Card(
color: Theme.of(context).colorScheme.surfaceContainerLow.withAlpha((0.5 * 255).round()),
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor.withAlpha((0.2 * 255).round())),
side: BorderSide(color: Theme.of(context).dividerColor.withOpacity(0.2)),
borderRadius: BorderRadius.circular(8),
),
child: Padding(
@@ -536,10 +536,10 @@ class _MobileCryptoRuleEditPageState extends State<MobileCryptoRuleEditPage> {
),
const SizedBox(height: 12),
Card(
color: Theme.of(context).colorScheme.surfaceContainerLow.withAlpha((0.5 * 255).round()),
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor.withAlpha((0.2 * 255).round())),
side: BorderSide(color: Theme.of(context).dividerColor.withOpacity(0.2)),
borderRadius: BorderRadius.circular(8),
),
child: Padding(
@@ -667,7 +667,7 @@ class _MobileCryptoRuleEditPageState extends State<MobileCryptoRuleEditPage> {
height: 40,
padding: const EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).dividerColor.withValues(alpha: 0.25)),
border: Border.all(color: Theme.of(context).dividerColor.withOpacity(0.25)),
borderRadius: BorderRadius.circular(8),
),
child: DropdownButtonHideUnderline(child: child),
@@ -686,7 +686,7 @@ class _MobileCryptoRuleEditPageState extends State<MobileCryptoRuleEditPage> {
constraints: const BoxConstraints(minWidth: 95),
padding: const EdgeInsets.symmetric(horizontal: 6),
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).dividerColor.withValues(alpha: 0.25)),
border: Border.all(color: Theme.of(context).dividerColor.withOpacity(0.25)),
borderRadius: BorderRadius.circular(6)),
child: DropdownButtonHideUnderline(
child: DropdownButton<T>(
@@ -703,7 +703,7 @@ class _MobileCryptoRuleEditPageState extends State<MobileCryptoRuleEditPage> {
height: 40,
padding: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).dividerColor.withValues(alpha: 0.25)),
border: Border.all(color: Theme.of(context).dividerColor.withOpacity(0.25)),
borderRadius: BorderRadius.circular(8),
),
child: Row(

View File

@@ -574,8 +574,6 @@ class _RewriteRuleState extends State<RewriteRule> {
rule.type = val!;
});
},
// use `value` for compatibility with older SDKs
value: rule.type,
)),
const SizedBox(width: 10),
]),

View File

@@ -550,7 +550,7 @@ class _ScriptEditState extends State<ScriptEdit> {
children: [
// Name section
Card(
color: Theme.of(context).colorScheme.surfaceContainerLow.withOpacity(0.5),
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor.withOpacity(0.4)),
@@ -561,7 +561,7 @@ class _ScriptEditState extends State<ScriptEdit> {
// URLs section
Card(
color: Theme.of(context).colorScheme.surfaceContainerLow.withOpacity(0.5),
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor.withOpacity(0.4)),
@@ -615,7 +615,7 @@ class _ScriptEditState extends State<ScriptEdit> {
// Source section
Card(
color: Theme.of(context).colorScheme.surfaceContainerLow.withOpacity(0.5),
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor.withOpacity(0.4)),
@@ -626,7 +626,7 @@ class _ScriptEditState extends State<ScriptEdit> {
SizedBox(width: 55, child: Text('${localizations.type}:')),
Expanded(
child: DropdownButtonFormField<bool>(
initialValue: _useRemote,
value: _useRemote,
items: [
DropdownMenuItem(value: false, child: Text(localizations.local)),
DropdownMenuItem(value: true, child: Text(localizations.remoteUrl)),
@@ -649,7 +649,7 @@ class _ScriptEditState extends State<ScriptEdit> {
// Remote URL section
if (_useRemote)
Card(
color: Theme.of(context).colorScheme.surfaceContainerLow.withOpacity(0.5),
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor.withOpacity(0.4)),
@@ -702,7 +702,7 @@ class _ScriptEditState extends State<ScriptEdit> {
// Script section
Card(
color: Theme.of(context).colorScheme.surfaceContainerLow.withOpacity(0.5),
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).dividerColor.withOpacity(0.4)),

View File

@@ -94,7 +94,7 @@ class _AboutState extends State<About> {
final url = "$gitHub/releases";
_safeLaunch(Uri.parse(url));
}),
Divider(height: 0, thickness: 0.4, color: Theme.of(context).dividerColor.withValues(alpha: 0.22)),
Divider(height: 0, thickness: 0.4, color: Theme.of(context).dividerColor.withOpacity(0.22)),
ListTile(
title: Text(localizations.privacyPolicy),
trailing: const Icon(Icons.privacy_tip_outlined, size: 22),
@@ -113,7 +113,7 @@ class _AboutState extends State<About> {
),
);
}),
Divider(height: 0, thickness: 0.4, color: Theme.of(context).dividerColor.withValues(alpha: 0.22)),
Divider(height: 0, thickness: 0.4, color: Theme.of(context).dividerColor.withOpacity(0.22)),
// Sponsor / Donate entry
ListTile(
title: Text(localizations.sponsorDonate),