Fixed light mode style discrepancies (#5062)
fix: https://github.com/flutter/flutter/issues/187964
diff --git a/app_dart/lib/src/request_handling/dashboard_authentication.dart b/app_dart/lib/src/request_handling/dashboard_authentication.dart
index 38f8e04..73aad0a 100644
--- a/app_dart/lib/src/request_handling/dashboard_authentication.dart
+++ b/app_dart/lib/src/request_handling/dashboard_authentication.dart
@@ -109,7 +109,7 @@
if (request.header('X-Flutter-IdToken') case final idTokenFromHeader?) {
final token = await _validator.decodeAndVerify(idTokenFromHeader);
log.info('authed with firebase: ${token.email}');
- return authenticateFirebase(
+ return await authenticateFirebase(
token,
clientContext: _clientContextProvider(),
);
diff --git a/app_dart/lib/src/request_handling/presubmit_authentication.dart b/app_dart/lib/src/request_handling/presubmit_authentication.dart
index 2e28e1b..a7a1692 100644
--- a/app_dart/lib/src/request_handling/presubmit_authentication.dart
+++ b/app_dart/lib/src/request_handling/presubmit_authentication.dart
@@ -49,7 +49,7 @@
if (request.header('X-Flutter-IdToken') case final idTokenFromHeader?) {
final token = await _validator.decodeAndVerify(idTokenFromHeader);
log.info('authing with github.com');
- return authenticateGithub(
+ return await authenticateGithub(
token,
clientContext: _clientContextProvider(),
);
diff --git a/app_dart/lib/src/service/cache_service.dart b/app_dart/lib/src/service/cache_service.dart
index 282e986..c9d409d 100644
--- a/app_dart/lib/src/service/cache_service.dart
+++ b/app_dart/lib/src/service/cache_service.dart
@@ -145,7 +145,7 @@
}) async {
await m.acquire();
try {
- return set(subcacheName, key, value, ttl: ttl);
+ return await set(subcacheName, key, value, ttl: ttl);
} finally {
m.release();
}
@@ -161,7 +161,7 @@
await m.acquire();
try {
final subcache = cache.withPrefix(subcacheName);
- return subcache[key].purge(retries: maxCacheGetAttempts);
+ await subcache[key].purge(retries: maxCacheGetAttempts);
} finally {
m.release();
}
diff --git a/app_dart/lib/src/service/content_aware_hash_service.dart b/app_dart/lib/src/service/content_aware_hash_service.dart
index f096535..cda062e 100644
--- a/app_dart/lib/src/service/content_aware_hash_service.dart
+++ b/app_dart/lib/src/service/content_aware_hash_service.dart
@@ -146,7 +146,7 @@
final transaction = await _firestore.beginTransaction();
try {
- return _updateFirestore(transaction, hash, headSha);
+ return await _updateFirestore(transaction, hash, headSha);
} catch (e, s) {
log.warn(
'CAHS(headSha: $headSha, hash: $hash): failure to read/modify to firestore',
diff --git a/auto_submit/lib/service/pull_request_validation_service.dart b/auto_submit/lib/service/pull_request_validation_service.dart
index be4204e..63a3c91 100644
--- a/auto_submit/lib/service/pull_request_validation_service.dart
+++ b/auto_submit/lib/service/pull_request_validation_service.dart
@@ -4,7 +4,6 @@
import 'package:cocoon_server/logging.dart';
import 'package:github/github.dart' as github;
-import 'package:retry/retry.dart';
import '../model/auto_submit_query_result.dart';
import '../model/pull_request_data_types.dart';
@@ -20,9 +19,9 @@
class PullRequestValidationService extends ValidationService {
PullRequestValidationService(
Config config, {
- RetryOptions? retryOptions,
+ super.retryOptions,
required this.subscription,
- }) : super(config, retryOptions: retryOptions) {
+ }) : super(config) {
/// Validates a PR marked with the reverts label.
approverService = ApproverService(config);
}
diff --git a/auto_submit/lib/service/revert_request_validation_service.dart b/auto_submit/lib/service/revert_request_validation_service.dart
index 58910db..cfd7050 100644
--- a/auto_submit/lib/service/revert_request_validation_service.dart
+++ b/auto_submit/lib/service/revert_request_validation_service.dart
@@ -7,7 +7,6 @@
import 'package:cocoon_server/logging.dart';
import 'package:github/github.dart' as github;
import 'package:meta/meta.dart';
-import 'package:retry/retry.dart';
import '../action/git_cli_revert_method.dart';
import '../action/revert_method.dart';
@@ -32,10 +31,10 @@
class RevertRequestValidationService extends ValidationService {
RevertRequestValidationService(
Config config, {
- RetryOptions? retryOptions,
+ super.retryOptions,
RevertMethod? revertMethod,
}) : revertMethod = revertMethod ?? GitCliRevertMethod(),
- super(config, retryOptions: retryOptions) {
+ super(config) {
/// Validates a PR marked with the reverts label.
approverService = ApproverService(config);
}
diff --git a/dashboard/lib/views/presubmit_view.dart b/dashboard/lib/views/presubmit_view.dart
index 4cfe4a9..4b99035 100644
--- a/dashboard/lib/views/presubmit_view.dart
+++ b/dashboard/lib/views/presubmit_view.dart
@@ -151,8 +151,7 @@
@override
Widget build(BuildContext context) {
- final theme = Theme.of(context);
- final isDark = theme.brightness == Brightness.dark;
+ Theme.of(context);
final presubmitState = Provider.of<PresubmitState>(context);
return AnimatedBuilder(
@@ -258,20 +257,20 @@
},
icon: const Icon(Icons.refresh, size: 18),
label: const Text('Re-run failed'),
- style: TextButton.styleFrom(
- foregroundColor: isDark ? Colors.white : Colors.black87,
- ),
+ style: TextButton.styleFrom(foregroundColor: Colors.white),
),
const SizedBox(width: 8),
],
- SizedBox(
- width: 300,
- child: ShaSelector(
- availableShas: availableSummaries,
- selectedSha: sha,
- onShaSelected: (newSha) {
- presubmitState.update(repo: repo, pr: pr, sha: newSha);
- },
+ Center(
+ child: SizedBox(
+ width: 300,
+ child: ShaSelector(
+ availableShas: availableSummaries,
+ selectedSha: sha,
+ onShaSelected: (newSha) {
+ presubmitState.update(repo: repo, pr: pr, sha: newSha);
+ },
+ ),
),
),
const SizedBox(width: 8),
diff --git a/dashboard/lib/widgets/sha_selector.dart b/dashboard/lib/widgets/sha_selector.dart
index ce86cec..3f8ff5b 100644
--- a/dashboard/lib/widgets/sha_selector.dart
+++ b/dashboard/lib/widgets/sha_selector.dart
@@ -25,9 +25,7 @@
Widget build(BuildContext context) {
final theme = Theme.of(context);
final isDark = theme.brightness == Brightness.dark;
- final borderColor = isDark
- ? const Color(0xFF333333)
- : const Color(0xFFD1D5DB);
+ final borderColor = isDark ? const Color(0xFF333333) : Colors.white54;
return Container(
height: 32,
@@ -35,7 +33,7 @@
decoration: BoxDecoration(
border: Border.all(color: borderColor),
borderRadius: BorderRadius.circular(6),
- color: theme.scaffoldBackgroundColor,
+ color: theme.appBarTheme.backgroundColor,
),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
@@ -43,11 +41,29 @@
isDense: true,
value: selectedSha,
icon: const Icon(Icons.expand_more, size: 16),
+ iconEnabledColor: Colors.white,
style: TextStyle(
fontFamily: 'monospace',
fontSize: 13,
- color: isDark ? Colors.white : Colors.black,
+ color: isDark ? Colors.white : Colors.black87,
),
+ selectedItemBuilder: (BuildContext context) {
+ return availableShas.map<Widget>((summary) {
+ final sha = summary.headSha;
+ final shortSha = sha.length > 7 ? sha.substring(0, 7) : sha;
+ return Align(
+ alignment: Alignment.centerLeft,
+ child: Text(
+ shortSha,
+ style: const TextStyle(
+ fontFamily: 'monospace',
+ fontSize: 13,
+ color: Colors.white,
+ ),
+ ),
+ );
+ }).toList();
+ },
onChanged: (value) {
if (value != null) {
onShaSelected(value);