@@ -36,7 +36,7 @@ const defaultRefreshRate = 60.0;
36
36
37
37
class ServiceConnectionManager {
38
38
ServiceConnectionManager () {
39
- serviceManager = ServiceManager ()
39
+ _serviceManager = ServiceManager ()
40
40
..registerLifecycleCallback (
41
41
ServiceManagerLifecycle .beforeOpenVmService,
42
42
_beforeOpenVmService,
@@ -61,7 +61,8 @@ class ServiceConnectionManager {
61
61
);
62
62
}
63
63
64
- late final ServiceManager <VmServiceWrapper > serviceManager;
64
+ ServiceManager <VmServiceWrapper > get serviceManager => _serviceManager;
65
+ late final ServiceManager <VmServiceWrapper > _serviceManager;
65
66
66
67
final vmFlagManager = VmFlagManager ();
67
68
@@ -72,8 +73,7 @@ class ServiceConnectionManager {
72
73
InspectorServiceBase ? get inspectorService => _inspectorService;
73
74
InspectorServiceBase ? _inspectorService;
74
75
75
- ErrorBadgeManager get errorBadgeManager => _errorBadgeManager;
76
- final _errorBadgeManager = ErrorBadgeManager ();
76
+ final errorBadgeManager = ErrorBadgeManager ();
77
77
78
78
VmServiceTrafficLogger ? serviceTrafficLogger;
79
79
@@ -189,7 +189,7 @@ class ServiceConnectionManager {
189
189
/// Returns the view id for the selected isolate's 'FlutterView'.
190
190
///
191
191
/// Throws an Exception if no 'FlutterView' is present in this isolate.
192
- Future <String > get flutterViewId async {
192
+ Future <String > get _flutterViewId async {
193
193
final flutterViewListResponse = await serviceManager
194
194
.callServiceExtensionOnMainIsolate (registrations.flutterListViews);
195
195
final views = (flutterViewListResponse.json! ['views' ] as List )
@@ -210,8 +210,8 @@ class ServiceConnectionManager {
210
210
return flutterView['id' ] as String ;
211
211
}
212
212
213
- /// Flutter engine returns estimate how much memory is used by layer/picture raster
214
- /// cache entries in bytes.
213
+ /// Flutter engine returns estimate how much memory is used by layer/picture
214
+ /// raster cache entries in bytes.
215
215
///
216
216
/// Call to returns JSON payload 'EstimateRasterCacheMemory' with two entries:
217
217
/// layerBytes - layer raster cache entries in bytes
@@ -222,28 +222,17 @@ class ServiceConnectionManager {
222
222
return null ;
223
223
}
224
224
225
- final viewId = await flutterViewId ;
225
+ final viewId = await _flutterViewId ;
226
226
227
227
return await serviceManager.callServiceExtensionOnMainIsolate (
228
228
registrations.flutterEngineEstimateRasterCache,
229
229
args: {'viewId' : viewId},
230
230
);
231
231
}
232
232
233
- Future <Response ?> get renderFrameWithRasterStats async {
234
- if (serviceManager.connectedApp == null ||
235
- ! await serviceManager.connectedApp! .isFlutterApp) {
236
- return null ;
237
- }
238
-
239
- final viewId = await flutterViewId;
240
-
241
- return await serviceManager.callServiceExtensionOnMainIsolate (
242
- registrations.renderFrameWithRasterStats,
243
- args: {'viewId' : viewId},
244
- );
245
- }
246
-
233
+ /// Returns the Flutter refresh rate.
234
+ ///
235
+ /// If not connected to a Flutter app, returns `null` .
247
236
Future <double ?> get queryDisplayRefreshRate async {
248
237
if (serviceManager.connectedApp == null ||
249
238
! await serviceManager.connectedApp! .isFlutterApp) {
@@ -252,7 +241,7 @@ class ServiceConnectionManager {
252
241
253
242
const unknownRefreshRate = 0.0 ;
254
243
255
- final viewId = await flutterViewId ;
244
+ final viewId = await _flutterViewId ;
256
245
final displayRefreshRateResponse = await serviceManager
257
246
.callServiceExtensionOnMainIsolate (
258
247
registrations.displayRefreshRate,
0 commit comments