forked from flutter/devtools
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Remove live vs offline data from chart memory timeline. 2. Factor out chart data to separate class. No functional changes.
- Loading branch information
Showing
10 changed files
with
159 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/devtools_app/lib/src/screens/memory/panes/chart/controller/chart_data.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2024 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:flutter/foundation.dart'; | ||
|
||
import '../../../../../shared/primitives/simple_items.dart'; | ||
import '../../../shared/primitives/memory_timeline.dart'; | ||
import '../data/primitives.dart'; | ||
|
||
/// Chart data, that should be saved when transferred to offline data mode. | ||
class ChartData { | ||
ChartData({required this.isDeviceAndroid}); | ||
|
||
/// Wether device is android, if [mode] is not [DevToolsMode.connected]. | ||
/// | ||
/// If [mode] is [DevToolsMode.connected], this value is null | ||
/// and chart visibility should be detected based on connected app. | ||
final bool? isDeviceAndroid; | ||
|
||
final MemoryTimeline timeline = MemoryTimeline(); | ||
|
||
/// Default is to display default tick width based on width of chart of the collected | ||
/// data in the chart. | ||
ChartInterval get displayInterval => _displayInterval.value; | ||
final _displayInterval = | ||
ValueNotifier<ChartInterval>(ChartInterval.theDefault); | ||
set displayInterval(ChartInterval interval) { | ||
_displayInterval.value = interval; | ||
} | ||
|
||
ValueListenable<bool> get isLegendVisible => _legendVisibleNotifier; | ||
final _legendVisibleNotifier = ValueNotifier<bool>(true); | ||
bool toggleLegendVisibility() => | ||
_legendVisibleNotifier.value = !_legendVisibleNotifier.value; | ||
|
||
void dispose() { | ||
_displayInterval.dispose(); | ||
_legendVisibleNotifier.dispose(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.