Skip to content

Commit ded2c35

Browse files
committed
Resolve merge conflicts and update flutter candidate
2 parents 54b0add + 6b6397d commit ded2c35

File tree

53 files changed

+612
-7913
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+612
-7913
lines changed

flutter-candidate.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d59499988ac50c18a3d492f953c71efcc101b1a5
1+
5dff2b54f93ebbc5e711b5fc68d52cd275be9b07

packages/devtools_app/lib/initialization.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44

55
import 'package:devtools_app_shared/utils.dart';
66
import 'package:flutter/material.dart';
7-
import 'package:flutter_riverpod/flutter_riverpod.dart';
87
import 'package:flutter_web_plugins/url_strategy.dart';
98

109
import 'src/app.dart';
1110
import 'src/framework/app_error_handling.dart';
1211
import 'src/framework/framework_core.dart';
1312
import 'src/screens/debugger/syntax_highlighter.dart';
14-
import 'src/screens/provider/riverpod_error_logger_observer.dart';
1513
import 'src/shared/analytics/analytics_controller.dart';
1614
import 'src/shared/config_specific/logger/logger_helpers.dart';
1715
import 'src/shared/feature_flags.dart';
@@ -43,12 +41,9 @@ void runDevTools({
4341

4442
// Run the app.
4543
runApp(
46-
ProviderScope(
47-
observers: const [ErrorLoggerObserver()],
48-
child: DevToolsApp(
49-
screens ?? defaultScreens(sampleData: sampleData),
50-
await analyticsController,
51-
),
44+
DevToolsApp(
45+
screens ?? defaultScreens(sampleData: sampleData),
46+
await analyticsController,
5247
),
5348
);
5449
});

packages/devtools_app/lib/src/app.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ class DevToolsAppState extends State<DevToolsApp> with AutoDisposeMixin {
304304
scaffold = DevToolsScaffold.withChild(
305305
embedMode: embedMode,
306306
child: CenteredMessage(
307-
'No DevTools '
308-
'${queryParams.hideAllExceptExtensions ? 'extensions' : 'screens'} '
309-
'available for your project.',
307+
message: 'No DevTools '
308+
'${queryParams.hideAllExceptExtensions ? 'extensions' : 'screens'} '
309+
'available for your project.',
310310
),
311311
);
312312
} else {
@@ -426,7 +426,7 @@ class DevToolsAppState extends State<DevToolsApp> with AutoDisposeMixin {
426426
builder: (context, child) {
427427
if (child == null) {
428428
return const CenteredMessage(
429-
'Uh-oh, something went wrong. Please refresh the page.',
429+
message: 'Uh-oh, something went wrong. Please refresh the page.',
430430
);
431431
}
432432
return MultiProvider(

packages/devtools_app/lib/src/framework/initializer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class _InitializerState extends State<Initializer>
7979
children: [
8080
const Spacer(),
8181
CenteredMessage(
82-
_showConnectToNewAppButton
82+
message: _showConnectToNewAppButton
8383
? 'Cannot connect to VM service.'
8484
: 'Waiting for VM service connection...',
8585
),

packages/devtools_app/lib/src/screens/app_size/app_size_screen.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class _AnalysisViewState extends State<AnalysisView>
394394
valueListenable: controller.processingNotifier,
395395
builder: (context, processing, _) {
396396
return processing
397-
? const CenteredMessage(AppSizeScreen.loadingMessage)
397+
? const CenteredMessage(message: AppSizeScreen.loadingMessage)
398398
: Column(
399399
children: [
400400
Flexible(
@@ -498,7 +498,7 @@ class _DiffViewState extends State<DiffView>
498498
valueListenable: controller.processingNotifier,
499499
builder: (context, processing, _) {
500500
return processing
501-
? const CenteredMessage(AppSizeScreen.loadingMessage)
501+
? const CenteredMessage(message: AppSizeScreen.loadingMessage)
502502
: Column(
503503
crossAxisAlignment: CrossAxisAlignment.stretch,
504504
children: [

packages/devtools_app/lib/src/screens/deep_link_validation/deep_link_list_view.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class _DeepLinkListViewMainPanel extends StatelessWidget {
9797
case PagePhase.noLinks:
9898
// TODO(hangyujin): This is just a place holder to add UI.
9999
return const CenteredMessage(
100-
'Your Flutter project has no Links to verify.',
100+
message: 'Your Flutter project has no Links to verify.',
101101
);
102102
case PagePhase.analyzeErrorPage:
103103
assert(controller.currentAppLinkSettings?.error != null);
@@ -125,7 +125,7 @@ class _DeepLinkListViewMainPanel extends StatelessWidget {
125125

126126
case PagePhase.validationErrorPage:
127127
// TODO(hangyujin): This is just a place holder to add Error handling.
128-
return const CenteredMessage('Error validating domain ');
128+
return const CenteredMessage(message: 'Error validating domain ');
129129
}
130130
},
131131
);

packages/devtools_app/lib/src/screens/deep_link_validation/deep_links_controller.dart

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ class DeepLinksController extends DisposableController
220220

221221
AppLinkSettings? get currentAppLinkSettings =>
222222
androidAppLinks[selectedAndroidVariantIndex.value];
223-
223+
UniversalLinkSettings? get currentUniversalLinkSettings =>
224+
iosLinks[selectedIosConfigurationIndex.value];
224225
@visibleForTesting
225226
final androidAppLinks = <int, AppLinkSettings>{};
226227

@@ -301,6 +302,9 @@ class DeepLinksController extends DisposableController
301302
}
302303

303304
Future<void> _loadAndroidAppLinks() async {
305+
if (selectedProject.value!.androidVariants.isEmpty) {
306+
return;
307+
}
304308
final variant = selectedProject
305309
.value!.androidVariants[selectedAndroidVariantIndex.value];
306310
await ga.timeAsync(
@@ -327,6 +331,9 @@ class DeepLinksController extends DisposableController
327331

328332
Future<void> _loadIosLinks() async {
329333
final iosBuildOptions = selectedProject.value!.iosBuildOptions;
334+
if (iosBuildOptions.configurations.isEmpty) {
335+
return;
336+
}
330337
final configuration =
331338
iosBuildOptions.configurations[selectedIosConfigurationIndex.value];
332339
final target = iosBuildOptions.targets[selectedIosTargetIndex.value];
@@ -507,21 +514,22 @@ class DeepLinksController extends DisposableController
507514
.toSet()
508515
.toList();
509516

510-
late final Map<String, List<DomainError>> androidDomainErrors;
511-
Map<String, List<DomainError>> iosDomainErrors =
512-
<String, List<DomainError>>{};
513-
514-
late final Map<String, List<Path>> iosDomainPaths;
517+
Map<String, List<DomainError>> androidDomainErrors = {};
518+
Map<String, List<DomainError>> iosDomainErrors = {};
519+
Map<String, List<Path>> iosDomainPaths = {};
515520
try {
516-
final androidResult = await deepLinksService.validateAndroidDomain(
517-
domains: domains,
518-
applicationId: applicationId,
519-
localFingerprint: localFingerprint.value,
520-
);
521-
androidDomainErrors = androidResult.domainErrors;
522-
googlePlayFingerprintsAvailability.value =
523-
androidResult.googlePlayFingerprintsAvailability;
524-
if (FeatureFlags.deepLinkIosCheck) {
521+
if (currentAppLinkSettings != null) {
522+
final androidResult = await deepLinksService.validateAndroidDomain(
523+
domains: domains,
524+
applicationId: applicationId,
525+
localFingerprint: localFingerprint.value,
526+
);
527+
androidDomainErrors = androidResult.domainErrors;
528+
googlePlayFingerprintsAvailability.value =
529+
androidResult.googlePlayFingerprintsAvailability;
530+
}
531+
if (FeatureFlags.deepLinkIosCheck &&
532+
currentUniversalLinkSettings != null) {
525533
final iosResult = await deepLinksService.validateIosDomain(
526534
bundleId: bundleId,
527535
teamId: teamId,
@@ -607,11 +615,7 @@ class DeepLinksController extends DisposableController
607615

608616
Future<void> validateLinks() async {
609617
final appLinkSettings = currentAppLinkSettings;
610-
if (appLinkSettings == null) {
611-
pagePhase.value = PagePhase.noLinks;
612-
return;
613-
}
614-
if (appLinkSettings.error != null) {
618+
if (appLinkSettings?.error != null) {
615619
pagePhase.value = PagePhase.analyzeErrorPage;
616620
ga.select(
617621
gac.deeplink,

packages/devtools_app/lib/src/screens/deep_link_validation/deep_links_model.dart

Lines changed: 159 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ class AndroidDomainError extends DomainError {
120120
}
121121

122122
class IosDomainError extends DomainError {
123-
const IosDomainError(super.title, super.explanation, super.fixDetails);
123+
const IosDomainError(
124+
super.title,
125+
super.explanation,
126+
super.fixDetails, {
127+
this.subcheckErrors = const [],
128+
});
124129
// TODO(hangyujin): Finalize strings for these domain errors.
125130

126131
/// Existence of an Apple-App-Site-Association file.
@@ -163,13 +168,159 @@ class IosDomainError extends DomainError {
163168
'Ensure your domain is accessible without any redirects.',
164169
);
165170

166-
/// TODO(hangyujin): There are sub checkes of this check, add them and add links when finalized.
167-
/// AASA file format follows guidelines.
168-
static const fileFormat = IosDomainError(
169-
'Apple-App-Site-Association file format is incorrect',
170-
'This test checks that your Apple-App-Site-Association file '
171-
'follows the correct format guidelines.',
172-
'Ensure your Apple-App-Site-Association file follows the correct format guidelines.',
171+
static IosDomainError iosFileFormatDomainError({
172+
required List<AASAfileFormatSubCheck> subcheckErrors,
173+
}) =>
174+
IosDomainError(
175+
'Apple-App-Site-Association file format is incorrect',
176+
'This test checks that your Apple-App-Site-Association file '
177+
'follows the correct format guidelines.',
178+
'Ensure your Apple-App-Site-Association file follows the correct format guidelines.',
179+
subcheckErrors: subcheckErrors,
180+
);
181+
182+
final List<AASAfileFormatSubCheck> subcheckErrors;
183+
}
184+
185+
String propertyTypeMessage({
186+
required String property,
187+
required String expectedType,
188+
}) {
189+
return 'This test checks that the `$property` property only holds a $expectedType.';
190+
}
191+
192+
class AASAfileFormatSubCheck extends CommonError {
193+
const AASAfileFormatSubCheck(String title, String explanation)
194+
: super(title, explanation, '');
195+
196+
static final appLinksFormat = AASAfileFormatSubCheck(
197+
'Applinks format',
198+
propertyTypeMessage(property: 'applinks', expectedType: 'object'),
199+
);
200+
201+
static const appLinksSubstitutionVariablesFormat = AASAfileFormatSubCheck(
202+
'Applinks substitution variables format',
203+
'This test checks that the `applinks.SubstitutionVariables` property has a valid '
204+
'substitution variable format. Ref - '
205+
'https://developer.apple.com/documentation/bundleresources/applinks/substitutionvariables',
206+
);
207+
208+
static const defaultsFormat = AASAfileFormatSubCheck(
209+
'Applinks defaults format',
210+
'This test checks that the `applinks.defaults` property only holds '
211+
'the keys caseSensitive and percentEncoded. Ref - '
212+
'https://developer.apple.com/documentation/bundleresources/applinks/defaults',
213+
);
214+
215+
static final defaultsPercentEncodedFormat = AASAfileFormatSubCheck(
216+
'Applinks defaults percent encoded format',
217+
propertyTypeMessage(
218+
property: 'applinks.defaults.percentEncoded',
219+
expectedType: 'boolean',
220+
),
221+
);
222+
223+
static final defaultsCaseSensitiveFormat = AASAfileFormatSubCheck(
224+
'Applinks defaults case sensitive format',
225+
propertyTypeMessage(
226+
property: 'applinks.defaults.caseSensitive',
227+
expectedType: 'boolean',
228+
),
229+
);
230+
231+
static const detailsFormat = AASAfileFormatSubCheck(
232+
'Applinks details format',
233+
'This test checks that the `applinks.details` property is formatted properly. Ref - '
234+
'https://developer.apple.com/documentation/bundleresources/applinks/details',
235+
);
236+
237+
static const detailsAppIdFormat = AASAfileFormatSubCheck(
238+
'Applinks details appIDs format',
239+
'This test checks that the `applinks.details.appID` property is an array of strings.',
240+
);
241+
242+
static const detailsPathsFormat = AASAfileFormatSubCheck(
243+
'Applinks details paths format',
244+
'This test checks that the `applinks.details.paths` property is an array of strings.',
245+
);
246+
247+
static const detailsDefaultsFormat = AASAfileFormatSubCheck(
248+
'Applinks details default format',
249+
'This test checks that the `applinks.details.defaults` property only holds '
250+
'the keys caseSensitive and percentEncoded. Ref - '
251+
'https://developer.apple.com/documentation/bundleresources/applinks/details/default',
252+
);
253+
254+
static final detailsDefaultsPercentEncodedFormat = AASAfileFormatSubCheck(
255+
'Applinks defaults percent encoded format',
256+
propertyTypeMessage(
257+
property: 'applinks.details.defaults.percentEncoded',
258+
expectedType: 'boolean',
259+
),
260+
);
261+
262+
static final detailsDefaultsCaseSensitiveFormat = AASAfileFormatSubCheck(
263+
'Applinks defaults case sensitive format',
264+
propertyTypeMessage(
265+
property: 'applinks.details.defaults.caseSensitive',
266+
expectedType: 'boolean',
267+
),
268+
);
269+
270+
static const componentFormat = AASAfileFormatSubCheck(
271+
'Applinks details components format',
272+
'This test checks that the `applinks.details.components` property is formatted properly. Ref - '
273+
'https://developer.apple.com/documentation/bundleresources/applinks/details/components',
274+
);
275+
276+
static final componentPathFormat = AASAfileFormatSubCheck(
277+
'Applinks details components path format',
278+
propertyTypeMessage(
279+
property: 'applinks.details.components.path',
280+
expectedType: 'string',
281+
),
282+
);
283+
284+
static const componentQueryFormat = AASAfileFormatSubCheck(
285+
'Applinks details components query format',
286+
'This test checks that the `applinks.details.components.query` property only holds either a string or object of type `applinks.Details.Components.Query`.',
287+
);
288+
289+
static final componentFragmentFormat = AASAfileFormatSubCheck(
290+
'Applinks details components fragment format',
291+
propertyTypeMessage(
292+
property: 'applinks.details.components.fragment',
293+
expectedType: 'string',
294+
),
295+
);
296+
297+
static final componentExcludeFormat = AASAfileFormatSubCheck(
298+
'Applinks details components exclude format',
299+
propertyTypeMessage(
300+
property: 'applinks.details.components.exclude',
301+
expectedType: 'boolean',
302+
),
303+
);
304+
static final componentPercentEncodedFormat = AASAfileFormatSubCheck(
305+
'Applinks details components percent encoded format',
306+
propertyTypeMessage(
307+
property: 'applinks.details.components.percentEncoded',
308+
expectedType: 'boolean',
309+
),
310+
);
311+
static final componentCaseSensitiveFormat = AASAfileFormatSubCheck(
312+
'Applinks details components case sensitive format',
313+
propertyTypeMessage(
314+
property: 'applinks.details.components.caseSensitive',
315+
expectedType: 'boolean',
316+
),
317+
);
318+
static final componentCommentFormat = AASAfileFormatSubCheck(
319+
'Applinks details components comment format',
320+
propertyTypeMessage(
321+
property: 'applinks.details.components.comment',
322+
expectedType: 'string',
323+
),
173324
);
174325
}
175326

0 commit comments

Comments
 (0)