sort_constructors_first (#22575)
This commit is contained in:
parent
a68b03e9ce
commit
2ea1d81cdc
@ -281,8 +281,6 @@ Future<ProcessResult> _resultOfGradleTask({String workingDirectory, String task,
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _Dependencies {
|
class _Dependencies {
|
||||||
String target;
|
|
||||||
Set<String> dependencies;
|
|
||||||
_Dependencies(String depfilePath) {
|
_Dependencies(String depfilePath) {
|
||||||
final RegExp _separatorExpr = RegExp(r'([^\\]) ');
|
final RegExp _separatorExpr = RegExp(r'([^\\]) ');
|
||||||
final RegExp _escapeExpr = RegExp(r'\\(.)');
|
final RegExp _escapeExpr = RegExp(r'\\(.)');
|
||||||
@ -301,6 +299,9 @@ class _Dependencies {
|
|||||||
.where((String path) => path.isNotEmpty)
|
.where((String path) => path.isNotEmpty)
|
||||||
.toSet();
|
.toSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String target;
|
||||||
|
Set<String> dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns [null] if target matches [expectedTarget], otherwise returns an error message.
|
/// Returns [null] if target matches [expectedTarget], otherwise returns an error message.
|
||||||
|
@ -100,6 +100,12 @@ abstract class Device {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class AndroidDeviceDiscovery implements DeviceDiscovery {
|
class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||||
|
factory AndroidDeviceDiscovery() {
|
||||||
|
return _instance ??= AndroidDeviceDiscovery._();
|
||||||
|
}
|
||||||
|
|
||||||
|
AndroidDeviceDiscovery._();
|
||||||
|
|
||||||
// Parses information about a device. Example:
|
// Parses information about a device. Example:
|
||||||
//
|
//
|
||||||
// 015d172c98400a03 device usb:340787200X product:nakasi model:Nexus_7 device:grouper
|
// 015d172c98400a03 device usb:340787200X product:nakasi model:Nexus_7 device:grouper
|
||||||
@ -107,12 +113,6 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
|
|||||||
|
|
||||||
static AndroidDeviceDiscovery _instance;
|
static AndroidDeviceDiscovery _instance;
|
||||||
|
|
||||||
factory AndroidDeviceDiscovery() {
|
|
||||||
return _instance ??= AndroidDeviceDiscovery._();
|
|
||||||
}
|
|
||||||
|
|
||||||
AndroidDeviceDiscovery._();
|
|
||||||
|
|
||||||
AndroidDevice _workingDevice;
|
AndroidDevice _workingDevice;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -349,15 +349,14 @@ class AndroidDevice implements Device {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class IosDeviceDiscovery implements DeviceDiscovery {
|
class IosDeviceDiscovery implements DeviceDiscovery {
|
||||||
|
|
||||||
static IosDeviceDiscovery _instance;
|
|
||||||
|
|
||||||
factory IosDeviceDiscovery() {
|
factory IosDeviceDiscovery() {
|
||||||
return _instance ??= IosDeviceDiscovery._();
|
return _instance ??= IosDeviceDiscovery._();
|
||||||
}
|
}
|
||||||
|
|
||||||
IosDeviceDiscovery._();
|
IosDeviceDiscovery._();
|
||||||
|
|
||||||
|
static IosDeviceDiscovery _instance;
|
||||||
|
|
||||||
IosDevice _workingDevice;
|
IosDevice _workingDevice;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -49,17 +49,6 @@ Future<TaskResult> task(TaskFunction task) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _TaskRunner {
|
class _TaskRunner {
|
||||||
static final Logger logger = Logger('TaskRunner');
|
|
||||||
|
|
||||||
final TaskFunction task;
|
|
||||||
|
|
||||||
// TODO(ianh): workaround for https://github.com/dart-lang/sdk/issues/23797
|
|
||||||
RawReceivePort _keepAlivePort;
|
|
||||||
Timer _startTaskTimeout;
|
|
||||||
bool _taskStarted = false;
|
|
||||||
|
|
||||||
final Completer<TaskResult> _completer = Completer<TaskResult>();
|
|
||||||
|
|
||||||
_TaskRunner(this.task) {
|
_TaskRunner(this.task) {
|
||||||
registerExtension('ext.cocoonRunTask',
|
registerExtension('ext.cocoonRunTask',
|
||||||
(String method, Map<String, String> parameters) async {
|
(String method, Map<String, String> parameters) async {
|
||||||
@ -75,6 +64,17 @@ class _TaskRunner {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final TaskFunction task;
|
||||||
|
|
||||||
|
// TODO(ianh): workaround for https://github.com/dart-lang/sdk/issues/23797
|
||||||
|
RawReceivePort _keepAlivePort;
|
||||||
|
Timer _startTaskTimeout;
|
||||||
|
bool _taskStarted = false;
|
||||||
|
|
||||||
|
final Completer<TaskResult> _completer = Completer<TaskResult>();
|
||||||
|
|
||||||
|
static final Logger logger = Logger('TaskRunner');
|
||||||
|
|
||||||
/// Signals that this task runner finished running the task.
|
/// Signals that this task runner finished running the task.
|
||||||
Future<TaskResult> get whenDone => _completer.future;
|
Future<TaskResult> get whenDone => _completer.future;
|
||||||
|
|
||||||
|
@ -26,11 +26,11 @@ TaskFunction combine(List<TaskFunction> tasks) {
|
|||||||
/// Defines task that creates new Flutter project, adds a plugin, and then
|
/// Defines task that creates new Flutter project, adds a plugin, and then
|
||||||
/// builds the specified [buildTarget].
|
/// builds the specified [buildTarget].
|
||||||
class PluginTest {
|
class PluginTest {
|
||||||
|
PluginTest(this.buildTarget, this.options);
|
||||||
|
|
||||||
final String buildTarget;
|
final String buildTarget;
|
||||||
final List<String> options;
|
final List<String> options;
|
||||||
|
|
||||||
PluginTest(this.buildTarget, this.options);
|
|
||||||
|
|
||||||
Future<TaskResult> call() async {
|
Future<TaskResult> call() async {
|
||||||
section('Create Flutter project');
|
section('Create Flutter project');
|
||||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_plugin_test.');
|
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_plugin_test.');
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
/// A pair of values. Used for testing custom codecs.
|
/// A pair of values. Used for testing custom codecs.
|
||||||
class Pair {
|
class Pair {
|
||||||
|
Pair(this.left, this.right);
|
||||||
|
|
||||||
final dynamic left;
|
final dynamic left;
|
||||||
final dynamic right;
|
final dynamic right;
|
||||||
|
|
||||||
Pair(this.left, this.right);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'Pair[$left, $right]';
|
String toString() => 'Pair[$left, $right]';
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,6 @@ const String nothing = '-';
|
|||||||
/// - The Flutter app records the incoming reply echo.
|
/// - The Flutter app records the incoming reply echo.
|
||||||
/// - The platform finally replies to the original message with another echo.
|
/// - The platform finally replies to the original message with another echo.
|
||||||
class TestStepResult {
|
class TestStepResult {
|
||||||
static const TextStyle bold = TextStyle(fontWeight: FontWeight.bold);
|
|
||||||
static const TestStepResult complete = TestStepResult(
|
|
||||||
'Test complete',
|
|
||||||
nothing,
|
|
||||||
TestStatus.complete,
|
|
||||||
);
|
|
||||||
|
|
||||||
const TestStepResult(
|
const TestStepResult(
|
||||||
this.name,
|
this.name,
|
||||||
this.description,
|
this.description,
|
||||||
@ -71,6 +64,13 @@ class TestStepResult {
|
|||||||
final dynamic replyEcho;
|
final dynamic replyEcho;
|
||||||
final dynamic error;
|
final dynamic error;
|
||||||
|
|
||||||
|
static const TextStyle bold = TextStyle(fontWeight: FontWeight.bold);
|
||||||
|
static const TestStepResult complete = TestStepResult(
|
||||||
|
'Test complete',
|
||||||
|
nothing,
|
||||||
|
TestStatus.complete,
|
||||||
|
);
|
||||||
|
|
||||||
Widget asWidget(BuildContext context) {
|
Widget asWidget(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -13,13 +13,6 @@ typedef TestStep = Future<TestStepResult> Function();
|
|||||||
const String nothing = '-';
|
const String nothing = '-';
|
||||||
|
|
||||||
class TestStepResult {
|
class TestStepResult {
|
||||||
static const TextStyle bold = TextStyle(fontWeight: FontWeight.bold);
|
|
||||||
static const TestStepResult complete = TestStepResult(
|
|
||||||
'Test complete',
|
|
||||||
nothing,
|
|
||||||
TestStatus.complete,
|
|
||||||
);
|
|
||||||
|
|
||||||
const TestStepResult(this.name, this.description, this.status);
|
const TestStepResult(this.name, this.description, this.status);
|
||||||
|
|
||||||
factory TestStepResult.fromSnapshot(AsyncSnapshot<TestStepResult> snapshot) {
|
factory TestStepResult.fromSnapshot(AsyncSnapshot<TestStepResult> snapshot) {
|
||||||
@ -45,6 +38,13 @@ class TestStepResult {
|
|||||||
final String description;
|
final String description;
|
||||||
final TestStatus status;
|
final TestStatus status;
|
||||||
|
|
||||||
|
static const TextStyle bold = TextStyle(fontWeight: FontWeight.bold);
|
||||||
|
static const TestStepResult complete = TestStepResult(
|
||||||
|
'Test complete',
|
||||||
|
nothing,
|
||||||
|
TestStatus.complete,
|
||||||
|
);
|
||||||
|
|
||||||
Widget asWidget(BuildContext context) {
|
Widget asWidget(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -47,19 +47,6 @@ class SectionCard extends StatelessWidget {
|
|||||||
// The title is rendered with two overlapping text widgets that are vertically
|
// The title is rendered with two overlapping text widgets that are vertically
|
||||||
// offset a little. It's supposed to look sort-of 3D.
|
// offset a little. It's supposed to look sort-of 3D.
|
||||||
class SectionTitle extends StatelessWidget {
|
class SectionTitle extends StatelessWidget {
|
||||||
static const TextStyle sectionTitleStyle = TextStyle(
|
|
||||||
fontFamily: 'Raleway',
|
|
||||||
inherit: false,
|
|
||||||
fontSize: 24.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Colors.white,
|
|
||||||
textBaseline: TextBaseline.alphabetic,
|
|
||||||
);
|
|
||||||
|
|
||||||
static final TextStyle sectionTitleShadowStyle = sectionTitleStyle.copyWith(
|
|
||||||
color: const Color(0x19000000),
|
|
||||||
);
|
|
||||||
|
|
||||||
const SectionTitle({
|
const SectionTitle({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.section,
|
@required this.section,
|
||||||
@ -74,6 +61,19 @@ class SectionTitle extends StatelessWidget {
|
|||||||
final double scale;
|
final double scale;
|
||||||
final double opacity;
|
final double opacity;
|
||||||
|
|
||||||
|
static const TextStyle sectionTitleStyle = TextStyle(
|
||||||
|
fontFamily: 'Raleway',
|
||||||
|
inherit: false,
|
||||||
|
fontSize: 24.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white,
|
||||||
|
textBaseline: TextBaseline.alphabetic,
|
||||||
|
);
|
||||||
|
|
||||||
|
static final TextStyle sectionTitleShadowStyle = sectionTitleStyle.copyWith(
|
||||||
|
color: const Color(0x19000000),
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return IgnorePointer(
|
return IgnorePointer(
|
||||||
|
@ -83,9 +83,6 @@ class ColorItem extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PaletteTabView extends StatelessWidget {
|
class PaletteTabView extends StatelessWidget {
|
||||||
static const List<int> primaryKeys = <int>[50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
||||||
static const List<int> accentKeys = <int>[100, 200, 400, 700];
|
|
||||||
|
|
||||||
PaletteTabView({
|
PaletteTabView({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.colors,
|
@required this.colors,
|
||||||
@ -94,6 +91,9 @@ class PaletteTabView extends StatelessWidget {
|
|||||||
|
|
||||||
final Palette colors;
|
final Palette colors;
|
||||||
|
|
||||||
|
static const List<int> primaryKeys = <int>[50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
||||||
|
static const List<int> accentKeys = <int>[100, 200, 400, 700];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final TextTheme textTheme = Theme.of(context).textTheme;
|
final TextTheme textTheme = Theme.of(context).textTheme;
|
||||||
|
@ -432,14 +432,14 @@ class _RecipePageState extends State<RecipePage> {
|
|||||||
|
|
||||||
/// Displays the recipe's name and instructions.
|
/// Displays the recipe's name and instructions.
|
||||||
class RecipeSheet extends StatelessWidget {
|
class RecipeSheet extends StatelessWidget {
|
||||||
|
RecipeSheet({ Key key, this.recipe }) : super(key: key);
|
||||||
|
|
||||||
final TextStyle titleStyle = const PestoStyle(fontSize: 34.0);
|
final TextStyle titleStyle = const PestoStyle(fontSize: 34.0);
|
||||||
final TextStyle descriptionStyle = const PestoStyle(fontSize: 15.0, color: Colors.black54, height: 24.0/15.0);
|
final TextStyle descriptionStyle = const PestoStyle(fontSize: 15.0, color: Colors.black54, height: 24.0/15.0);
|
||||||
final TextStyle itemStyle = const PestoStyle(fontSize: 15.0, height: 24.0/15.0);
|
final TextStyle itemStyle = const PestoStyle(fontSize: 15.0, height: 24.0/15.0);
|
||||||
final TextStyle itemAmountStyle = PestoStyle(fontSize: 15.0, color: _kTheme.primaryColor, height: 24.0/15.0);
|
final TextStyle itemAmountStyle = PestoStyle(fontSize: 15.0, color: _kTheme.primaryColor, height: 24.0/15.0);
|
||||||
final TextStyle headingStyle = const PestoStyle(fontSize: 16.0, fontWeight: FontWeight.bold, height: 24.0/15.0);
|
final TextStyle headingStyle = const PestoStyle(fontSize: 16.0, fontWeight: FontWeight.bold, height: 24.0/15.0);
|
||||||
|
|
||||||
RecipeSheet({ Key key, this.recipe }) : super(key: key);
|
|
||||||
|
|
||||||
final Recipe recipe;
|
final Recipe recipe;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -14,13 +14,13 @@ const String beeUri =
|
|||||||
'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4';
|
'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4';
|
||||||
|
|
||||||
class VideoCard extends StatelessWidget {
|
class VideoCard extends StatelessWidget {
|
||||||
|
const VideoCard({Key key, this.controller, this.title, this.subtitle})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
final VideoPlayerController controller;
|
final VideoPlayerController controller;
|
||||||
final String title;
|
final String title;
|
||||||
final String subtitle;
|
final String subtitle;
|
||||||
|
|
||||||
const VideoCard({Key key, this.controller, this.title, this.subtitle})
|
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
Widget _buildInlineVideo() {
|
Widget _buildInlineVideo() {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 30.0),
|
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 30.0),
|
||||||
@ -93,10 +93,10 @@ class VideoCard extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class VideoPlayerLoading extends StatefulWidget {
|
class VideoPlayerLoading extends StatefulWidget {
|
||||||
final VideoPlayerController controller;
|
|
||||||
|
|
||||||
const VideoPlayerLoading(this.controller);
|
const VideoPlayerLoading(this.controller);
|
||||||
|
|
||||||
|
final VideoPlayerController controller;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_VideoPlayerLoadingState createState() => _VideoPlayerLoadingState();
|
_VideoPlayerLoadingState createState() => _VideoPlayerLoadingState();
|
||||||
}
|
}
|
||||||
@ -137,18 +137,15 @@ class _VideoPlayerLoadingState extends State<VideoPlayerLoading> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class VideoPlayPause extends StatefulWidget {
|
class VideoPlayPause extends StatefulWidget {
|
||||||
final VideoPlayerController controller;
|
|
||||||
|
|
||||||
const VideoPlayPause(this.controller);
|
const VideoPlayPause(this.controller);
|
||||||
|
|
||||||
|
final VideoPlayerController controller;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State createState() => _VideoPlayPauseState();
|
State createState() => _VideoPlayPauseState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _VideoPlayPauseState extends State<VideoPlayPause> {
|
class _VideoPlayPauseState extends State<VideoPlayPause> {
|
||||||
FadeAnimation imageFadeAnimation;
|
|
||||||
VoidCallback listener;
|
|
||||||
|
|
||||||
_VideoPlayPauseState() {
|
_VideoPlayPauseState() {
|
||||||
listener = () {
|
listener = () {
|
||||||
if (mounted)
|
if (mounted)
|
||||||
@ -156,6 +153,9 @@ class _VideoPlayPauseState extends State<VideoPlayPause> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FadeAnimation imageFadeAnimation;
|
||||||
|
VoidCallback listener;
|
||||||
|
|
||||||
VideoPlayerController get controller => widget.controller;
|
VideoPlayerController get controller => widget.controller;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -202,14 +202,14 @@ class _VideoPlayPauseState extends State<VideoPlayPause> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FadeAnimation extends StatefulWidget {
|
class FadeAnimation extends StatefulWidget {
|
||||||
final Widget child;
|
|
||||||
final Duration duration;
|
|
||||||
|
|
||||||
const FadeAnimation({
|
const FadeAnimation({
|
||||||
this.child,
|
this.child,
|
||||||
this.duration = const Duration(milliseconds: 500),
|
this.duration = const Duration(milliseconds: 500),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final Widget child;
|
||||||
|
final Duration duration;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_FadeAnimationState createState() => _FadeAnimationState();
|
_FadeAnimationState createState() => _FadeAnimationState();
|
||||||
}
|
}
|
||||||
@ -265,16 +265,16 @@ class _FadeAnimationState extends State<FadeAnimation>
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ConnectivityOverlay extends StatefulWidget {
|
class ConnectivityOverlay extends StatefulWidget {
|
||||||
final Widget child;
|
|
||||||
final Completer<Null> connectedCompleter;
|
|
||||||
final GlobalKey<ScaffoldState> scaffoldKey;
|
|
||||||
|
|
||||||
const ConnectivityOverlay({
|
const ConnectivityOverlay({
|
||||||
this.child,
|
this.child,
|
||||||
this.connectedCompleter,
|
this.connectedCompleter,
|
||||||
this.scaffoldKey,
|
this.scaffoldKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final Widget child;
|
||||||
|
final Completer<Null> connectedCompleter;
|
||||||
|
final GlobalKey<ScaffoldState> scaffoldKey;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ConnectivityOverlayState createState() => _ConnectivityOverlayState();
|
_ConnectivityOverlayState createState() => _ConnectivityOverlayState();
|
||||||
}
|
}
|
||||||
|
@ -268,10 +268,6 @@ class _DemosPage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class GalleryHome extends StatefulWidget {
|
class GalleryHome extends StatefulWidget {
|
||||||
// In checked mode our MaterialApp will show the default "debug" banner.
|
|
||||||
// Otherwise show the "preview" banner.
|
|
||||||
static bool showPreviewBanner = true;
|
|
||||||
|
|
||||||
const GalleryHome({
|
const GalleryHome({
|
||||||
Key key,
|
Key key,
|
||||||
this.testMode = false,
|
this.testMode = false,
|
||||||
@ -281,6 +277,10 @@ class GalleryHome extends StatefulWidget {
|
|||||||
final Widget optionsPage;
|
final Widget optionsPage;
|
||||||
final bool testMode;
|
final bool testMode;
|
||||||
|
|
||||||
|
// In checked mode our MaterialApp will show the default "debug" banner.
|
||||||
|
// Otherwise show the "preview" banner.
|
||||||
|
static bool showPreviewBanner = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_GalleryHomeState createState() => _GalleryHomeState();
|
_GalleryHomeState createState() => _GalleryHomeState();
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ import 'package:flutter/rendering.dart';
|
|||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
|
||||||
class RenderSolidColorBox extends RenderDecoratedBox {
|
class RenderSolidColorBox extends RenderDecoratedBox {
|
||||||
final Size desiredSize;
|
|
||||||
final Color backgroundColor;
|
|
||||||
|
|
||||||
RenderSolidColorBox(this.backgroundColor, { this.desiredSize = Size.infinite })
|
RenderSolidColorBox(this.backgroundColor, { this.desiredSize = Size.infinite })
|
||||||
: super(decoration: BoxDecoration(color: backgroundColor));
|
: super(decoration: BoxDecoration(color: backgroundColor));
|
||||||
|
|
||||||
|
final Size desiredSize;
|
||||||
|
final Color backgroundColor;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
double computeMinIntrinsicWidth(double height) {
|
double computeMinIntrinsicWidth(double height) {
|
||||||
return desiredSize.width == double.infinity ? 0.0 : desiredSize.width;
|
return desiredSize.width == double.infinity ? 0.0 : desiredSize.width;
|
||||||
|
@ -16,12 +16,6 @@ import 'package:http/http.dart' as http;
|
|||||||
final math.Random _rng = math.Random();
|
final math.Random _rng = math.Random();
|
||||||
|
|
||||||
class Stock {
|
class Stock {
|
||||||
String symbol;
|
|
||||||
String name;
|
|
||||||
double lastSale;
|
|
||||||
String marketCap;
|
|
||||||
double percentChange;
|
|
||||||
|
|
||||||
Stock(this.symbol, this.name, this.lastSale, this.marketCap, this.percentChange);
|
Stock(this.symbol, this.name, this.lastSale, this.marketCap, this.percentChange);
|
||||||
|
|
||||||
Stock.fromFields(List<String> fields) {
|
Stock.fromFields(List<String> fields) {
|
||||||
@ -36,6 +30,12 @@ class Stock {
|
|||||||
marketCap = fields[4];
|
marketCap = fields[4];
|
||||||
percentChange = (_rng.nextDouble() * 20) - 10;
|
percentChange = (_rng.nextDouble() * 20) - 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String symbol;
|
||||||
|
String name;
|
||||||
|
double lastSale;
|
||||||
|
String marketCap;
|
||||||
|
double percentChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
class StockData extends ChangeNotifier {
|
class StockData extends ChangeNotifier {
|
||||||
|
@ -77,10 +77,6 @@ const int kMaxUnsignedSMI = 0x3FFFFFFFFFFFFFFF;
|
|||||||
/// A BitField over an enum (or other class whose values implement "index").
|
/// A BitField over an enum (or other class whose values implement "index").
|
||||||
/// Only the first 62 values of the enum can be used as indices.
|
/// Only the first 62 values of the enum can be used as indices.
|
||||||
class BitField<T extends dynamic> {
|
class BitField<T extends dynamic> {
|
||||||
static const int _smiBits = 62; // see https://www.dartlang.org/articles/numeric-computation/#smis-and-mints
|
|
||||||
static const int _allZeros = 0;
|
|
||||||
static const int _allOnes = kMaxUnsignedSMI; // 2^(_kSMIBits+1)-1
|
|
||||||
|
|
||||||
/// Creates a bit field of all zeros.
|
/// Creates a bit field of all zeros.
|
||||||
///
|
///
|
||||||
/// The given length must be at most 62.
|
/// The given length must be at most 62.
|
||||||
@ -101,6 +97,10 @@ class BitField<T extends dynamic> {
|
|||||||
final int _length;
|
final int _length;
|
||||||
int _bits;
|
int _bits;
|
||||||
|
|
||||||
|
static const int _smiBits = 62; // see https://www.dartlang.org/articles/numeric-computation/#smis-and-mints
|
||||||
|
static const int _allZeros = 0;
|
||||||
|
static const int _allOnes = kMaxUnsignedSMI; // 2^(_kSMIBits+1)-1
|
||||||
|
|
||||||
/// Returns whether the bit with the given index is set to one.
|
/// Returns whether the bit with the given index is set to one.
|
||||||
bool operator [](T index) {
|
bool operator [](T index) {
|
||||||
assert(index.index < _length);
|
assert(index.index < _length);
|
||||||
|
@ -720,11 +720,11 @@ class _MonthPickerState extends State<MonthPicker> with SingleTickerProviderStat
|
|||||||
// Defines semantic traversal order of the top-level widgets inside the month
|
// Defines semantic traversal order of the top-level widgets inside the month
|
||||||
// picker.
|
// picker.
|
||||||
class _MonthPickerSortKey extends OrdinalSortKey {
|
class _MonthPickerSortKey extends OrdinalSortKey {
|
||||||
|
const _MonthPickerSortKey(double order) : super(order);
|
||||||
|
|
||||||
static const _MonthPickerSortKey previousMonth = _MonthPickerSortKey(1.0);
|
static const _MonthPickerSortKey previousMonth = _MonthPickerSortKey(1.0);
|
||||||
static const _MonthPickerSortKey nextMonth = _MonthPickerSortKey(2.0);
|
static const _MonthPickerSortKey nextMonth = _MonthPickerSortKey(2.0);
|
||||||
static const _MonthPickerSortKey calendar = _MonthPickerSortKey(3.0);
|
static const _MonthPickerSortKey calendar = _MonthPickerSortKey(3.0);
|
||||||
|
|
||||||
const _MonthPickerSortKey(double order) : super(order);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A scrollable list of years to allow picking a year.
|
/// A scrollable list of years to allow picking a year.
|
||||||
|
@ -92,13 +92,6 @@ class _InkRippleFactory extends InteractiveInkFeatureFactory {
|
|||||||
/// * [InkHighlight], which is an ink feature that emphasizes a part of a
|
/// * [InkHighlight], which is an ink feature that emphasizes a part of a
|
||||||
/// [Material].
|
/// [Material].
|
||||||
class InkRipple extends InteractiveInkFeature {
|
class InkRipple extends InteractiveInkFeature {
|
||||||
/// Used to specify this type of ink splash for an [InkWell], [InkResponse]
|
|
||||||
/// or material [Theme].
|
|
||||||
static const InteractiveInkFeatureFactory splashFactory = _InkRippleFactory();
|
|
||||||
|
|
||||||
static final Animatable<double> _easeCurveTween = CurveTween(curve: Curves.ease);
|
|
||||||
static final Animatable<double> _fadeOutIntervalTween = CurveTween(curve: const Interval(_kFadeOutIntervalStart, 1.0));
|
|
||||||
|
|
||||||
/// Begin a ripple, centered at [position] relative to [referenceBox].
|
/// Begin a ripple, centered at [position] relative to [referenceBox].
|
||||||
///
|
///
|
||||||
/// The [controller] argument is typically obtained via
|
/// The [controller] argument is typically obtained via
|
||||||
@ -192,6 +185,13 @@ class InkRipple extends InteractiveInkFeature {
|
|||||||
Animation<int> _fadeOut;
|
Animation<int> _fadeOut;
|
||||||
AnimationController _fadeOutController;
|
AnimationController _fadeOutController;
|
||||||
|
|
||||||
|
/// Used to specify this type of ink splash for an [InkWell], [InkResponse]
|
||||||
|
/// or material [Theme].
|
||||||
|
static const InteractiveInkFeatureFactory splashFactory = _InkRippleFactory();
|
||||||
|
|
||||||
|
static final Animatable<double> _easeCurveTween = CurveTween(curve: Curves.ease);
|
||||||
|
static final Animatable<double> _fadeOutIntervalTween = CurveTween(curve: const Interval(_kFadeOutIntervalStart, 1.0));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void confirm() {
|
void confirm() {
|
||||||
_radiusController
|
_radiusController
|
||||||
|
@ -96,10 +96,6 @@ class _InkSplashFactory extends InteractiveInkFeatureFactory {
|
|||||||
/// * [InkHighlight], which is an ink feature that emphasizes a part of a
|
/// * [InkHighlight], which is an ink feature that emphasizes a part of a
|
||||||
/// [Material].
|
/// [Material].
|
||||||
class InkSplash extends InteractiveInkFeature {
|
class InkSplash extends InteractiveInkFeature {
|
||||||
/// Used to specify this type of ink splash for an [InkWell], [InkResponse]
|
|
||||||
/// or material [Theme].
|
|
||||||
static const InteractiveInkFeatureFactory splashFactory = _InkSplashFactory();
|
|
||||||
|
|
||||||
/// Begin a splash, centered at position relative to [referenceBox].
|
/// Begin a splash, centered at position relative to [referenceBox].
|
||||||
///
|
///
|
||||||
/// The [controller] argument is typically obtained via
|
/// The [controller] argument is typically obtained via
|
||||||
@ -169,6 +165,10 @@ class InkSplash extends InteractiveInkFeature {
|
|||||||
Animation<int> _alpha;
|
Animation<int> _alpha;
|
||||||
AnimationController _alphaController;
|
AnimationController _alphaController;
|
||||||
|
|
||||||
|
/// Used to specify this type of ink splash for an [InkWell], [InkResponse]
|
||||||
|
/// or material [Theme].
|
||||||
|
static const InteractiveInkFeatureFactory splashFactory = _InkSplashFactory();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void confirm() {
|
void confirm() {
|
||||||
final int duration = (_targetRadius / _kSplashConfirmedVelocity).floor();
|
final int duration = (_targetRadius / _kSplashConfirmedVelocity).floor();
|
||||||
|
@ -28,13 +28,6 @@ import 'package:flutter/widgets.dart';
|
|||||||
/// rounded rectangle around the input decorator's container.
|
/// rounded rectangle around the input decorator's container.
|
||||||
/// * [InputDecoration], which is used to configure an [InputDecorator].
|
/// * [InputDecoration], which is used to configure an [InputDecorator].
|
||||||
abstract class InputBorder extends ShapeBorder {
|
abstract class InputBorder extends ShapeBorder {
|
||||||
/// No input border.
|
|
||||||
///
|
|
||||||
/// Use this value with [InputDecoration.border] to specify that no border
|
|
||||||
/// should be drawn. The [InputDecoration.shrinkWrap] constructor sets
|
|
||||||
/// its border to this value.
|
|
||||||
static const InputBorder none = _NoInputBorder();
|
|
||||||
|
|
||||||
/// Creates a border for an [InputDecorator].
|
/// Creates a border for an [InputDecorator].
|
||||||
///
|
///
|
||||||
/// The [borderSide] parameter must not be null. Applications typically do
|
/// The [borderSide] parameter must not be null. Applications typically do
|
||||||
@ -45,6 +38,13 @@ abstract class InputBorder extends ShapeBorder {
|
|||||||
this.borderSide = BorderSide.none,
|
this.borderSide = BorderSide.none,
|
||||||
}) : assert(borderSide != null);
|
}) : assert(borderSide != null);
|
||||||
|
|
||||||
|
/// No input border.
|
||||||
|
///
|
||||||
|
/// Use this value with [InputDecoration.border] to specify that no border
|
||||||
|
/// should be drawn. The [InputDecoration.shrinkWrap] constructor sets
|
||||||
|
/// its border to this value.
|
||||||
|
static const InputBorder none = _NoInputBorder();
|
||||||
|
|
||||||
/// Defines the border line's color and weight.
|
/// Defines the border line's color and weight.
|
||||||
///
|
///
|
||||||
/// The [InputDecorator] creates copies of its input border, using [copyWith],
|
/// The [InputDecorator] creates copies of its input border, using [copyWith],
|
||||||
|
@ -69,6 +69,20 @@ abstract class ProgressIndicator extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _LinearProgressIndicatorPainter extends CustomPainter {
|
class _LinearProgressIndicatorPainter extends CustomPainter {
|
||||||
|
const _LinearProgressIndicatorPainter({
|
||||||
|
this.backgroundColor,
|
||||||
|
this.valueColor,
|
||||||
|
this.value,
|
||||||
|
this.animationValue,
|
||||||
|
@required this.textDirection,
|
||||||
|
}) : assert(textDirection != null);
|
||||||
|
|
||||||
|
final Color backgroundColor;
|
||||||
|
final Color valueColor;
|
||||||
|
final double value;
|
||||||
|
final double animationValue;
|
||||||
|
final TextDirection textDirection;
|
||||||
|
|
||||||
// The indeterminate progress animation displays two lines whose leading (head)
|
// The indeterminate progress animation displays two lines whose leading (head)
|
||||||
// and trailing (tail) endpoints are defined by the following four curves.
|
// and trailing (tail) endpoints are defined by the following four curves.
|
||||||
static const Curve line1Head = Interval(
|
static const Curve line1Head = Interval(
|
||||||
@ -92,20 +106,6 @@ class _LinearProgressIndicatorPainter extends CustomPainter {
|
|||||||
curve: Cubic(0.10, 0.0, 0.45, 1.0),
|
curve: Cubic(0.10, 0.0, 0.45, 1.0),
|
||||||
);
|
);
|
||||||
|
|
||||||
const _LinearProgressIndicatorPainter({
|
|
||||||
this.backgroundColor,
|
|
||||||
this.valueColor,
|
|
||||||
this.value,
|
|
||||||
this.animationValue,
|
|
||||||
@required this.textDirection,
|
|
||||||
}) : assert(textDirection != null);
|
|
||||||
|
|
||||||
final Color backgroundColor;
|
|
||||||
final Color valueColor;
|
|
||||||
final double value;
|
|
||||||
final double animationValue;
|
|
||||||
final TextDirection textDirection;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
final Paint paint = Paint()
|
final Paint paint = Paint()
|
||||||
@ -254,12 +254,6 @@ class _LinearProgressIndicatorState extends State<LinearProgressIndicator> with
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _CircularProgressIndicatorPainter extends CustomPainter {
|
class _CircularProgressIndicatorPainter extends CustomPainter {
|
||||||
static const double _twoPi = math.pi * 2.0;
|
|
||||||
static const double _epsilon = .001;
|
|
||||||
// Canvas.drawArc(r, 0, 2*PI) doesn't draw anything, so just get close.
|
|
||||||
static const double _sweep = _twoPi - _epsilon;
|
|
||||||
static const double _startAngle = -math.pi / 2.0;
|
|
||||||
|
|
||||||
_CircularProgressIndicatorPainter({
|
_CircularProgressIndicatorPainter({
|
||||||
this.valueColor,
|
this.valueColor,
|
||||||
this.value,
|
this.value,
|
||||||
@ -285,6 +279,12 @@ class _CircularProgressIndicatorPainter extends CustomPainter {
|
|||||||
final double arcStart;
|
final double arcStart;
|
||||||
final double arcSweep;
|
final double arcSweep;
|
||||||
|
|
||||||
|
static const double _twoPi = math.pi * 2.0;
|
||||||
|
static const double _epsilon = .001;
|
||||||
|
// Canvas.drawArc(r, 0, 2*PI) doesn't draw anything, so just get close.
|
||||||
|
static const double _sweep = _twoPi - _epsilon;
|
||||||
|
static const double _startAngle = -math.pi / 2.0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
final Paint paint = Paint()
|
final Paint paint = Paint()
|
||||||
|
@ -30,15 +30,6 @@ enum DayPeriod {
|
|||||||
/// time zones.
|
/// time zones.
|
||||||
@immutable
|
@immutable
|
||||||
class TimeOfDay {
|
class TimeOfDay {
|
||||||
/// The number of hours in one day, i.e. 24.
|
|
||||||
static const int hoursPerDay = 24;
|
|
||||||
|
|
||||||
/// The number of hours in one day period (see also [DayPeriod]), i.e. 12.
|
|
||||||
static const int hoursPerPeriod = 12;
|
|
||||||
|
|
||||||
/// The number of minutes in one hour, i.e. 60.
|
|
||||||
static const int minutesPerHour = 60;
|
|
||||||
|
|
||||||
/// Creates a time of day.
|
/// Creates a time of day.
|
||||||
///
|
///
|
||||||
/// The [hour] argument must be between 0 and 23, inclusive. The [minute]
|
/// The [hour] argument must be between 0 and 23, inclusive. The [minute]
|
||||||
@ -57,6 +48,15 @@ class TimeOfDay {
|
|||||||
/// current minute in the local time zone.
|
/// current minute in the local time zone.
|
||||||
factory TimeOfDay.now() { return TimeOfDay.fromDateTime(DateTime.now()); }
|
factory TimeOfDay.now() { return TimeOfDay.fromDateTime(DateTime.now()); }
|
||||||
|
|
||||||
|
/// The number of hours in one day, i.e. 24.
|
||||||
|
static const int hoursPerDay = 24;
|
||||||
|
|
||||||
|
/// The number of hours in one day period (see also [DayPeriod]), i.e. 12.
|
||||||
|
static const int hoursPerPeriod = 12;
|
||||||
|
|
||||||
|
/// The number of minutes in one hour, i.e. 60.
|
||||||
|
static const int minutesPerHour = 60;
|
||||||
|
|
||||||
/// Returns a new TimeOfDay with the hour and/or minute replaced.
|
/// Returns a new TimeOfDay with the hour and/or minute replaced.
|
||||||
TimeOfDay replacing({ int hour, int minute }) {
|
TimeOfDay replacing({ int hour, int minute }) {
|
||||||
assert(hour == null || (hour >= 0 && hour < hoursPerDay));
|
assert(hour == null || (hour >= 0 && hour < hoursPerDay));
|
||||||
|
@ -92,22 +92,6 @@ class BoxConstraints extends Constraints {
|
|||||||
this.maxHeight = double.infinity
|
this.maxHeight = double.infinity
|
||||||
});
|
});
|
||||||
|
|
||||||
/// The minimum width that satisfies the constraints.
|
|
||||||
final double minWidth;
|
|
||||||
|
|
||||||
/// The maximum width that satisfies the constraints.
|
|
||||||
///
|
|
||||||
/// Might be [double.infinity].
|
|
||||||
final double maxWidth;
|
|
||||||
|
|
||||||
/// The minimum height that satisfies the constraints.
|
|
||||||
final double minHeight;
|
|
||||||
|
|
||||||
/// The maximum height that satisfies the constraints.
|
|
||||||
///
|
|
||||||
/// Might be [double.infinity].
|
|
||||||
final double maxHeight;
|
|
||||||
|
|
||||||
/// Creates box constraints that is respected only by the given size.
|
/// Creates box constraints that is respected only by the given size.
|
||||||
BoxConstraints.tight(Size size)
|
BoxConstraints.tight(Size size)
|
||||||
: minWidth = size.width,
|
: minWidth = size.width,
|
||||||
@ -164,6 +148,22 @@ class BoxConstraints extends Constraints {
|
|||||||
minHeight = height != null ? height : double.infinity,
|
minHeight = height != null ? height : double.infinity,
|
||||||
maxHeight = height != null ? height : double.infinity;
|
maxHeight = height != null ? height : double.infinity;
|
||||||
|
|
||||||
|
/// The minimum width that satisfies the constraints.
|
||||||
|
final double minWidth;
|
||||||
|
|
||||||
|
/// The maximum width that satisfies the constraints.
|
||||||
|
///
|
||||||
|
/// Might be [double.infinity].
|
||||||
|
final double maxWidth;
|
||||||
|
|
||||||
|
/// The minimum height that satisfies the constraints.
|
||||||
|
final double minHeight;
|
||||||
|
|
||||||
|
/// The maximum height that satisfies the constraints.
|
||||||
|
///
|
||||||
|
/// Might be [double.infinity].
|
||||||
|
final double maxHeight;
|
||||||
|
|
||||||
/// Creates a copy of this box constraints but with the given fields replaced with the new values.
|
/// Creates a copy of this box constraints but with the given fields replaced with the new values.
|
||||||
BoxConstraints copyWith({
|
BoxConstraints copyWith({
|
||||||
double minWidth,
|
double minWidth,
|
||||||
|
@ -212,6 +212,9 @@ class JSONMethodCodec implements MethodCodec {
|
|||||||
/// The codec is extensible by subclasses overriding [writeValue] and
|
/// The codec is extensible by subclasses overriding [writeValue] and
|
||||||
/// [readValueOfType].
|
/// [readValueOfType].
|
||||||
class StandardMessageCodec implements MessageCodec<dynamic> {
|
class StandardMessageCodec implements MessageCodec<dynamic> {
|
||||||
|
/// Creates a [MessageCodec] using the Flutter standard binary encoding.
|
||||||
|
const StandardMessageCodec();
|
||||||
|
|
||||||
// The codec serializes messages as outlined below. This format must
|
// The codec serializes messages as outlined below. This format must
|
||||||
// match the Android and iOS counterparts.
|
// match the Android and iOS counterparts.
|
||||||
//
|
//
|
||||||
@ -264,9 +267,6 @@ class StandardMessageCodec implements MessageCodec<dynamic> {
|
|||||||
static const int _valueList = 12;
|
static const int _valueList = 12;
|
||||||
static const int _valueMap = 13;
|
static const int _valueMap = 13;
|
||||||
|
|
||||||
/// Creates a [MessageCodec] using the Flutter standard binary encoding.
|
|
||||||
const StandardMessageCodec();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ByteData encodeMessage(dynamic message) {
|
ByteData encodeMessage(dynamic message) {
|
||||||
if (message == null)
|
if (message == null)
|
||||||
|
@ -97,21 +97,6 @@ class PlatformViewsService {
|
|||||||
///
|
///
|
||||||
/// A Dart version of Android's [MotionEvent.PointerProperties](https://developer.android.com/reference/android/view/MotionEvent.PointerProperties).
|
/// A Dart version of Android's [MotionEvent.PointerProperties](https://developer.android.com/reference/android/view/MotionEvent.PointerProperties).
|
||||||
class AndroidPointerProperties {
|
class AndroidPointerProperties {
|
||||||
/// Value for `toolType` when the tool type is unknown.
|
|
||||||
static const int kToolTypeUnknown = 0;
|
|
||||||
|
|
||||||
/// Value for `toolType` when the tool type is a finger.
|
|
||||||
static const int kToolTypeFinger = 1;
|
|
||||||
|
|
||||||
/// Value for `toolType` when the tool type is a stylus.
|
|
||||||
static const int kToolTypeStylus = 2;
|
|
||||||
|
|
||||||
/// Value for `toolType` when the tool type is a mouse.
|
|
||||||
static const int kToolTypeMouse = 3;
|
|
||||||
|
|
||||||
/// Value for `toolType` when the tool type is an eraser.
|
|
||||||
static const int kToolTypeEraser = 4;
|
|
||||||
|
|
||||||
/// Creates an AndroidPointerProperties.
|
/// Creates an AndroidPointerProperties.
|
||||||
///
|
///
|
||||||
/// All parameters must not be null.
|
/// All parameters must not be null.
|
||||||
@ -128,6 +113,21 @@ class AndroidPointerProperties {
|
|||||||
/// See Android's [MotionEvent.PointerProperties#toolType](https://developer.android.com/reference/android/view/MotionEvent.PointerProperties.html#toolType).
|
/// See Android's [MotionEvent.PointerProperties#toolType](https://developer.android.com/reference/android/view/MotionEvent.PointerProperties.html#toolType).
|
||||||
final int toolType;
|
final int toolType;
|
||||||
|
|
||||||
|
/// Value for `toolType` when the tool type is unknown.
|
||||||
|
static const int kToolTypeUnknown = 0;
|
||||||
|
|
||||||
|
/// Value for `toolType` when the tool type is a finger.
|
||||||
|
static const int kToolTypeFinger = 1;
|
||||||
|
|
||||||
|
/// Value for `toolType` when the tool type is a stylus.
|
||||||
|
static const int kToolTypeStylus = 2;
|
||||||
|
|
||||||
|
/// Value for `toolType` when the tool type is a mouse.
|
||||||
|
static const int kToolTypeMouse = 3;
|
||||||
|
|
||||||
|
/// Value for `toolType` when the tool type is an eraser.
|
||||||
|
static const int kToolTypeEraser = 4;
|
||||||
|
|
||||||
List<int> _asList() => <int>[id, toolType];
|
List<int> _asList() => <int>[id, toolType];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -97,28 +97,6 @@ enum Brightness {
|
|||||||
///
|
///
|
||||||
/// Used by [SystemChrome.setSystemUIOverlayStyle].
|
/// Used by [SystemChrome.setSystemUIOverlayStyle].
|
||||||
class SystemUiOverlayStyle {
|
class SystemUiOverlayStyle {
|
||||||
/// System overlays should be drawn with a light color. Intended for
|
|
||||||
/// applications with a dark background.
|
|
||||||
static const SystemUiOverlayStyle light = SystemUiOverlayStyle(
|
|
||||||
systemNavigationBarColor: Color(0xFF000000),
|
|
||||||
systemNavigationBarDividerColor: null,
|
|
||||||
statusBarColor: null,
|
|
||||||
systemNavigationBarIconBrightness: Brightness.light,
|
|
||||||
statusBarIconBrightness: Brightness.light,
|
|
||||||
statusBarBrightness: Brightness.dark,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// System overlays should be drawn with a dark color. Intended for
|
|
||||||
/// applications with a light background.
|
|
||||||
static const SystemUiOverlayStyle dark = SystemUiOverlayStyle(
|
|
||||||
systemNavigationBarColor: Color(0xFF000000),
|
|
||||||
systemNavigationBarDividerColor: null,
|
|
||||||
statusBarColor: null,
|
|
||||||
systemNavigationBarIconBrightness: Brightness.light,
|
|
||||||
statusBarIconBrightness: Brightness.dark,
|
|
||||||
statusBarBrightness: Brightness.light,
|
|
||||||
);
|
|
||||||
|
|
||||||
/// Creates a new [SystemUiOverlayStyle].
|
/// Creates a new [SystemUiOverlayStyle].
|
||||||
const SystemUiOverlayStyle({
|
const SystemUiOverlayStyle({
|
||||||
this.systemNavigationBarColor,
|
this.systemNavigationBarColor,
|
||||||
@ -159,6 +137,28 @@ class SystemUiOverlayStyle {
|
|||||||
/// Only honored in Android version M and greater.
|
/// Only honored in Android version M and greater.
|
||||||
final Brightness statusBarIconBrightness;
|
final Brightness statusBarIconBrightness;
|
||||||
|
|
||||||
|
/// System overlays should be drawn with a light color. Intended for
|
||||||
|
/// applications with a dark background.
|
||||||
|
static const SystemUiOverlayStyle light = SystemUiOverlayStyle(
|
||||||
|
systemNavigationBarColor: Color(0xFF000000),
|
||||||
|
systemNavigationBarDividerColor: null,
|
||||||
|
statusBarColor: null,
|
||||||
|
systemNavigationBarIconBrightness: Brightness.light,
|
||||||
|
statusBarIconBrightness: Brightness.light,
|
||||||
|
statusBarBrightness: Brightness.dark,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// System overlays should be drawn with a dark color. Intended for
|
||||||
|
/// applications with a light background.
|
||||||
|
static const SystemUiOverlayStyle dark = SystemUiOverlayStyle(
|
||||||
|
systemNavigationBarColor: Color(0xFF000000),
|
||||||
|
systemNavigationBarDividerColor: null,
|
||||||
|
statusBarColor: null,
|
||||||
|
systemNavigationBarIconBrightness: Brightness.light,
|
||||||
|
statusBarIconBrightness: Brightness.dark,
|
||||||
|
statusBarBrightness: Brightness.light,
|
||||||
|
);
|
||||||
|
|
||||||
/// Convert this event to a map for serialization.
|
/// Convert this event to a map for serialization.
|
||||||
Map<String, dynamic> _toMap() {
|
Map<String, dynamic> _toMap() {
|
||||||
return <String, dynamic>{
|
return <String, dynamic>{
|
||||||
|
@ -698,6 +698,8 @@ final _TextInputClientHandler _clientHandler = _TextInputClientHandler();
|
|||||||
|
|
||||||
/// An interface to the system's text input control.
|
/// An interface to the system's text input control.
|
||||||
class TextInput {
|
class TextInput {
|
||||||
|
TextInput._();
|
||||||
|
|
||||||
static const List<TextInputAction> _androidSupportedInputActions = <TextInputAction>[
|
static const List<TextInputAction> _androidSupportedInputActions = <TextInputAction>[
|
||||||
TextInputAction.none,
|
TextInputAction.none,
|
||||||
TextInputAction.unspecified,
|
TextInputAction.unspecified,
|
||||||
@ -724,8 +726,6 @@ class TextInput {
|
|||||||
TextInputAction.emergencyCall,
|
TextInputAction.emergencyCall,
|
||||||
];
|
];
|
||||||
|
|
||||||
TextInput._();
|
|
||||||
|
|
||||||
/// Begin interacting with the text input control.
|
/// Begin interacting with the text input control.
|
||||||
///
|
///
|
||||||
/// Calling this function helps multiple clients coordinate about which one is
|
/// Calling this function helps multiple clients coordinate about which one is
|
||||||
|
@ -5564,17 +5564,17 @@ class KeyedSubtree extends StatelessWidget {
|
|||||||
}) : assert(child != null),
|
}) : assert(child != null),
|
||||||
super(key: key);
|
super(key: key);
|
||||||
|
|
||||||
/// The widget below this widget in the tree.
|
|
||||||
///
|
|
||||||
/// {@macro flutter.widgets.child}
|
|
||||||
final Widget child;
|
|
||||||
|
|
||||||
/// Creates a KeyedSubtree for child with a key that's based on the child's existing key or childIndex.
|
/// Creates a KeyedSubtree for child with a key that's based on the child's existing key or childIndex.
|
||||||
factory KeyedSubtree.wrap(Widget child, int childIndex) {
|
factory KeyedSubtree.wrap(Widget child, int childIndex) {
|
||||||
final Key key = child.key != null ? ValueKey<Key>(child.key) : ValueKey<int>(childIndex);
|
final Key key = child.key != null ? ValueKey<Key>(child.key) : ValueKey<int>(childIndex);
|
||||||
return KeyedSubtree(key: key, child: child);
|
return KeyedSubtree(key: key, child: child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The widget below this widget in the tree.
|
||||||
|
///
|
||||||
|
/// {@macro flutter.widgets.child}
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
/// Wrap each item in a KeyedSubtree whose key is based on the item's existing key or
|
/// Wrap each item in a KeyedSubtree whose key is based on the item's existing key or
|
||||||
/// the sum of its list index and `baseIndex`.
|
/// the sum of its list index and `baseIndex`.
|
||||||
static List<Widget> ensureUniqueKeysForList(Iterable<Widget> items, { int baseIndex = 0 }) {
|
static List<Widget> ensureUniqueKeysForList(Iterable<Widget> items, { int baseIndex = 0 }) {
|
||||||
|
@ -49,10 +49,10 @@ typedef _RegisterServiceExtensionCallback = void Function({
|
|||||||
/// A proxy layer is used for cases where a layer needs to be placed into
|
/// A proxy layer is used for cases where a layer needs to be placed into
|
||||||
/// multiple trees of layers.
|
/// multiple trees of layers.
|
||||||
class _ProxyLayer extends Layer {
|
class _ProxyLayer extends Layer {
|
||||||
final Layer _layer;
|
|
||||||
|
|
||||||
_ProxyLayer(this._layer);
|
_ProxyLayer(this._layer);
|
||||||
|
|
||||||
|
final Layer _layer;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) {
|
void addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) {
|
||||||
_layer.addToScene(builder, layerOffset);
|
_layer.addToScene(builder, layerOffset);
|
||||||
@ -66,9 +66,6 @@ class _ProxyLayer extends Layer {
|
|||||||
/// secondary screenshot canvas so that a screenshot can be recorded at the same
|
/// secondary screenshot canvas so that a screenshot can be recorded at the same
|
||||||
/// time as performing a normal paint.
|
/// time as performing a normal paint.
|
||||||
class _MulticastCanvas implements Canvas {
|
class _MulticastCanvas implements Canvas {
|
||||||
final Canvas _main;
|
|
||||||
final Canvas _screenshot;
|
|
||||||
|
|
||||||
_MulticastCanvas({
|
_MulticastCanvas({
|
||||||
@required Canvas main,
|
@required Canvas main,
|
||||||
@required Canvas screenshot,
|
@required Canvas screenshot,
|
||||||
@ -77,6 +74,9 @@ class _MulticastCanvas implements Canvas {
|
|||||||
_main = main,
|
_main = main,
|
||||||
_screenshot = screenshot;
|
_screenshot = screenshot;
|
||||||
|
|
||||||
|
final Canvas _main;
|
||||||
|
final Canvas _screenshot;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void clipPath(Path path, {bool doAntiAlias = true}) {
|
void clipPath(Path path, {bool doAntiAlias = true}) {
|
||||||
_main.clipPath(path, doAntiAlias: doAntiAlias);
|
_main.clipPath(path, doAntiAlias: doAntiAlias);
|
||||||
|
@ -513,13 +513,13 @@ final Finder findDialPaint = find.descendant(
|
|||||||
);
|
);
|
||||||
|
|
||||||
class _SemanticsNodeExpectation {
|
class _SemanticsNodeExpectation {
|
||||||
|
_SemanticsNodeExpectation(this.label, this.left, this.top, this.right, this.bottom);
|
||||||
|
|
||||||
final String label;
|
final String label;
|
||||||
final double left;
|
final double left;
|
||||||
final double top;
|
final double top;
|
||||||
final double right;
|
final double right;
|
||||||
final double bottom;
|
final double bottom;
|
||||||
|
|
||||||
_SemanticsNodeExpectation(this.label, this.left, this.top, this.right, this.bottom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _CustomPainterSemanticsTester {
|
class _CustomPainterSemanticsTester {
|
||||||
|
@ -14,13 +14,13 @@ import 'package:flutter/foundation.dart';
|
|||||||
/// This is useful for running in the test Zone, where it is tricky to receive
|
/// This is useful for running in the test Zone, where it is tricky to receive
|
||||||
/// callbacks originating from the IO thread.
|
/// callbacks originating from the IO thread.
|
||||||
class FakeCodec implements ui.Codec {
|
class FakeCodec implements ui.Codec {
|
||||||
|
FakeCodec._(this._frameCount, this._repetitionCount, this._frameInfos);
|
||||||
|
|
||||||
final int _frameCount;
|
final int _frameCount;
|
||||||
final int _repetitionCount;
|
final int _repetitionCount;
|
||||||
final List<ui.FrameInfo> _frameInfos;
|
final List<ui.FrameInfo> _frameInfos;
|
||||||
int _nextFrame = 0;
|
int _nextFrame = 0;
|
||||||
|
|
||||||
FakeCodec._(this._frameCount, this._repetitionCount, this._frameInfos);
|
|
||||||
|
|
||||||
/// Creates a FakeCodec from encoded image data.
|
/// Creates a FakeCodec from encoded image data.
|
||||||
///
|
///
|
||||||
/// Only call this method outside of the test zone.
|
/// Only call this method outside of the test zone.
|
||||||
|
@ -13,11 +13,10 @@ import 'package:flutter_test/flutter_test.dart';
|
|||||||
|
|
||||||
|
|
||||||
class TestAssetBundle extends CachingAssetBundle {
|
class TestAssetBundle extends CachingAssetBundle {
|
||||||
|
TestAssetBundle(this._assetBundleMap);
|
||||||
|
|
||||||
Map<String, List<String>> _assetBundleMap;
|
Map<String, List<String>> _assetBundleMap;
|
||||||
|
|
||||||
TestAssetBundle(this._assetBundleMap);
|
|
||||||
|
|
||||||
Map<String, int> loadCallCount = <String, int>{};
|
Map<String, int> loadCallCount = <String, int>{};
|
||||||
|
|
||||||
String get _assetBundleContents {
|
String get _assetBundleContents {
|
||||||
|
@ -11,12 +11,12 @@ import 'package:flutter/scheduler.dart' show timeDilation;
|
|||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
class FakeFrameInfo implements FrameInfo {
|
class FakeFrameInfo implements FrameInfo {
|
||||||
final Duration _duration;
|
|
||||||
final Image _image;
|
|
||||||
|
|
||||||
FakeFrameInfo(int width, int height, this._duration) :
|
FakeFrameInfo(int width, int height, this._duration) :
|
||||||
_image = FakeImage(width, height);
|
_image = FakeImage(width, height);
|
||||||
|
|
||||||
|
final Duration _duration;
|
||||||
|
final Image _image;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Duration get duration => _duration;
|
Duration get duration => _duration;
|
||||||
|
|
||||||
@ -25,11 +25,11 @@ class FakeFrameInfo implements FrameInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FakeImage implements Image {
|
class FakeImage implements Image {
|
||||||
|
FakeImage(this._width, this._height);
|
||||||
|
|
||||||
final int _width;
|
final int _width;
|
||||||
final int _height;
|
final int _height;
|
||||||
|
|
||||||
FakeImage(this._width, this._height);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get width => _width;
|
int get width => _width;
|
||||||
|
|
||||||
|
@ -558,12 +558,12 @@ abstract class _TestRecordingCanvasMatcher extends Matcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _TestRecordingCanvasPaintsCountMatcher extends _TestRecordingCanvasMatcher {
|
class _TestRecordingCanvasPaintsCountMatcher extends _TestRecordingCanvasMatcher {
|
||||||
final Symbol _methodName;
|
|
||||||
final int _count;
|
|
||||||
|
|
||||||
_TestRecordingCanvasPaintsCountMatcher(Symbol methodName, int count)
|
_TestRecordingCanvasPaintsCountMatcher(Symbol methodName, int count)
|
||||||
: _methodName = methodName, _count = count;
|
: _methodName = methodName, _count = count;
|
||||||
|
|
||||||
|
final Symbol _methodName;
|
||||||
|
final int _count;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Description describe(Description description) {
|
Description describe(Description description) {
|
||||||
return description.add('Object or closure painting $_methodName exactly $_count times');
|
return description.add('Object or closure painting $_methodName exactly $_count times');
|
||||||
|
@ -792,15 +792,15 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TestImageProvider extends ImageProvider<TestImageProvider> {
|
class TestImageProvider extends ImageProvider<TestImageProvider> {
|
||||||
final Completer<ImageInfo> _completer = Completer<ImageInfo>();
|
|
||||||
ImageStreamCompleter _streamCompleter;
|
|
||||||
ImageConfiguration _lastResolvedConfiguration;
|
|
||||||
|
|
||||||
TestImageProvider({ImageStreamCompleter streamCompleter}) {
|
TestImageProvider({ImageStreamCompleter streamCompleter}) {
|
||||||
_streamCompleter = streamCompleter
|
_streamCompleter = streamCompleter
|
||||||
?? OneFrameImageStreamCompleter(_completer.future);
|
?? OneFrameImageStreamCompleter(_completer.future);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final Completer<ImageInfo> _completer = Completer<ImageInfo>();
|
||||||
|
ImageStreamCompleter _streamCompleter;
|
||||||
|
ImageConfiguration _lastResolvedConfiguration;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<TestImageProvider> obtainKey(ImageConfiguration configuration) {
|
Future<TestImageProvider> obtainKey(ImageConfiguration configuration) {
|
||||||
return SynchronousFuture<TestImageProvider>(this);
|
return SynchronousFuture<TestImageProvider>(this);
|
||||||
|
@ -41,14 +41,14 @@ class EnterText extends Command {
|
|||||||
/// Creates a command that enters text into the currently focused widget.
|
/// Creates a command that enters text into the currently focused widget.
|
||||||
EnterText(this.text, { Duration timeout }) : super(timeout: timeout);
|
EnterText(this.text, { Duration timeout }) : super(timeout: timeout);
|
||||||
|
|
||||||
/// The text extracted by the [GetText] command.
|
|
||||||
final String text;
|
|
||||||
|
|
||||||
/// Deserializes this command from the value generated by [serialize].
|
/// Deserializes this command from the value generated by [serialize].
|
||||||
EnterText.deserialize(Map<String, dynamic> json)
|
EnterText.deserialize(Map<String, dynamic> json)
|
||||||
: text = json['text'],
|
: text = json['text'],
|
||||||
super.deserialize(json);
|
super.deserialize(json);
|
||||||
|
|
||||||
|
/// The text extracted by the [GetText] command.
|
||||||
|
final String text;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final String kind = 'enter_text';
|
final String kind = 'enter_text';
|
||||||
|
|
||||||
@ -77,14 +77,14 @@ class SetTextEntryEmulation extends Command {
|
|||||||
/// Creates a command that enables and disables text entry emulation.
|
/// Creates a command that enables and disables text entry emulation.
|
||||||
SetTextEntryEmulation(this.enabled, { Duration timeout }) : super(timeout: timeout);
|
SetTextEntryEmulation(this.enabled, { Duration timeout }) : super(timeout: timeout);
|
||||||
|
|
||||||
/// Whether text entry emulation should be enabled.
|
|
||||||
final bool enabled;
|
|
||||||
|
|
||||||
/// Deserializes this command from the value generated by [serialize].
|
/// Deserializes this command from the value generated by [serialize].
|
||||||
SetTextEntryEmulation.deserialize(Map<String, dynamic> json)
|
SetTextEntryEmulation.deserialize(Map<String, dynamic> json)
|
||||||
: enabled = json['enabled'] == 'true',
|
: enabled = json['enabled'] == 'true',
|
||||||
super.deserialize(json);
|
super.deserialize(json);
|
||||||
|
|
||||||
|
/// Whether text entry emulation should be enabled.
|
||||||
|
final bool enabled;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final String kind = 'set_text_entry_emulation';
|
final String kind = 'set_text_entry_emulation';
|
||||||
|
|
||||||
|
@ -770,6 +770,9 @@ class FlutterDriver {
|
|||||||
/// Encapsulates connection information to an instance of a Flutter application.
|
/// Encapsulates connection information to an instance of a Flutter application.
|
||||||
@visibleForTesting
|
@visibleForTesting
|
||||||
class VMServiceClientConnection {
|
class VMServiceClientConnection {
|
||||||
|
/// Creates an instance of this class given a [client] and a [peer].
|
||||||
|
VMServiceClientConnection(this.client, this.peer);
|
||||||
|
|
||||||
/// Use this for structured access to the VM service's public APIs.
|
/// Use this for structured access to the VM service's public APIs.
|
||||||
final VMServiceClient client;
|
final VMServiceClient client;
|
||||||
|
|
||||||
@ -778,9 +781,6 @@ class VMServiceClientConnection {
|
|||||||
/// This object allows reaching into private VM service APIs. Use with
|
/// This object allows reaching into private VM service APIs. Use with
|
||||||
/// caution.
|
/// caution.
|
||||||
final rpc.Peer peer;
|
final rpc.Peer peer;
|
||||||
|
|
||||||
/// Creates an instance of this class given a [client] and a [peer].
|
|
||||||
VMServiceClientConnection(this.client, this.peer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A function that connects to a Dart VM service given the [url].
|
/// A function that connects to a Dart VM service given the [url].
|
||||||
|
@ -92,8 +92,6 @@ typedef FinderConstructor = Finder Function(SerializableFinder finder);
|
|||||||
/// calling [enableFlutterDriverExtension].
|
/// calling [enableFlutterDriverExtension].
|
||||||
@visibleForTesting
|
@visibleForTesting
|
||||||
class FlutterDriverExtension {
|
class FlutterDriverExtension {
|
||||||
final TestTextInput _testTextInput = TestTextInput();
|
|
||||||
|
|
||||||
/// Creates an object to manage a Flutter Driver connection.
|
/// Creates an object to manage a Flutter Driver connection.
|
||||||
FlutterDriverExtension(this._requestDataHandler, this._silenceErrors) {
|
FlutterDriverExtension(this._requestDataHandler, this._silenceErrors) {
|
||||||
_testTextInput.register();
|
_testTextInput.register();
|
||||||
@ -143,6 +141,8 @@ class FlutterDriverExtension {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final TestTextInput _testTextInput = TestTextInput();
|
||||||
|
|
||||||
final DataHandler _requestDataHandler;
|
final DataHandler _requestDataHandler;
|
||||||
final bool _silenceErrors;
|
final bool _silenceErrors;
|
||||||
|
|
||||||
|
@ -36,16 +36,6 @@ class AndroidStudio implements Comparable<AndroidStudio> {
|
|||||||
_init();
|
_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
final String directory;
|
|
||||||
final String studioAppName;
|
|
||||||
final Version version;
|
|
||||||
final String configured;
|
|
||||||
|
|
||||||
String _pluginsPath;
|
|
||||||
String _javaPath;
|
|
||||||
bool _isValid = false;
|
|
||||||
final List<String> _validationMessages = <String>[];
|
|
||||||
|
|
||||||
factory AndroidStudio.fromMacOSBundle(String bundlePath) {
|
factory AndroidStudio.fromMacOSBundle(String bundlePath) {
|
||||||
final String studioPath = fs.path.join(bundlePath, 'Contents');
|
final String studioPath = fs.path.join(bundlePath, 'Contents');
|
||||||
final String plistFile = fs.path.join(studioPath, 'Info.plist');
|
final String plistFile = fs.path.join(studioPath, 'Info.plist');
|
||||||
@ -89,6 +79,16 @@ class AndroidStudio implements Comparable<AndroidStudio> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final String directory;
|
||||||
|
final String studioAppName;
|
||||||
|
final Version version;
|
||||||
|
final String configured;
|
||||||
|
|
||||||
|
String _pluginsPath;
|
||||||
|
String _javaPath;
|
||||||
|
bool _isValid = false;
|
||||||
|
final List<String> _validationMessages = <String>[];
|
||||||
|
|
||||||
String get javaPath => _javaPath;
|
String get javaPath => _javaPath;
|
||||||
|
|
||||||
bool get isValid => _isValid;
|
bool get isValid => _isValid;
|
||||||
|
@ -11,10 +11,10 @@ import '../intellij/intellij.dart';
|
|||||||
import 'android_studio.dart';
|
import 'android_studio.dart';
|
||||||
|
|
||||||
class AndroidStudioValidator extends DoctorValidator {
|
class AndroidStudioValidator extends DoctorValidator {
|
||||||
final AndroidStudio _studio;
|
|
||||||
|
|
||||||
AndroidStudioValidator(this._studio) : super('Android Studio');
|
AndroidStudioValidator(this._studio) : super('Android Studio');
|
||||||
|
|
||||||
|
final AndroidStudio _studio;
|
||||||
|
|
||||||
static List<DoctorValidator> get allValidators {
|
static List<DoctorValidator> get allValidators {
|
||||||
final List<DoctorValidator> validators = <DoctorValidator>[];
|
final List<DoctorValidator> validators = <DoctorValidator>[];
|
||||||
final List<AndroidStudio> studios = AndroidStudio.allInstalled();
|
final List<AndroidStudio> studios = AndroidStudio.allInstalled();
|
||||||
|
@ -21,12 +21,12 @@ import 'project.dart';
|
|||||||
import 'tester/flutter_tester.dart';
|
import 'tester/flutter_tester.dart';
|
||||||
|
|
||||||
abstract class ApplicationPackage {
|
abstract class ApplicationPackage {
|
||||||
/// Package ID from the Android Manifest or equivalent.
|
|
||||||
final String id;
|
|
||||||
|
|
||||||
ApplicationPackage({ @required this.id })
|
ApplicationPackage({ @required this.id })
|
||||||
: assert(id != null);
|
: assert(id != null);
|
||||||
|
|
||||||
|
/// Package ID from the Android Manifest or equivalent.
|
||||||
|
final String id;
|
||||||
|
|
||||||
String get name;
|
String get name;
|
||||||
|
|
||||||
String get displayName => name;
|
String get displayName => name;
|
||||||
@ -38,12 +38,6 @@ abstract class ApplicationPackage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class AndroidApk extends ApplicationPackage {
|
class AndroidApk extends ApplicationPackage {
|
||||||
/// Path to the actual apk file.
|
|
||||||
final File file;
|
|
||||||
|
|
||||||
/// The path to the activity that should be launched.
|
|
||||||
final String launchActivity;
|
|
||||||
|
|
||||||
AndroidApk({
|
AndroidApk({
|
||||||
String id,
|
String id,
|
||||||
@required this.file,
|
@required this.file,
|
||||||
@ -88,6 +82,12 @@ class AndroidApk extends ApplicationPackage {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Path to the actual apk file.
|
||||||
|
final File file;
|
||||||
|
|
||||||
|
/// The path to the activity that should be launched.
|
||||||
|
final String launchActivity;
|
||||||
|
|
||||||
/// Creates a new AndroidApk based on the information in the Android manifest.
|
/// Creates a new AndroidApk based on the information in the Android manifest.
|
||||||
static Future<AndroidApk> fromAndroidProject(AndroidProject androidProject) async {
|
static Future<AndroidApk> fromAndroidProject(AndroidProject androidProject) async {
|
||||||
File apkFile;
|
File apkFile;
|
||||||
@ -250,15 +250,15 @@ class BuildableIOSApp extends IOSApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PrebuiltIOSApp extends IOSApp {
|
class PrebuiltIOSApp extends IOSApp {
|
||||||
final Directory bundleDir;
|
|
||||||
final String bundleName;
|
|
||||||
|
|
||||||
PrebuiltIOSApp({
|
PrebuiltIOSApp({
|
||||||
this.bundleDir,
|
this.bundleDir,
|
||||||
this.bundleName,
|
this.bundleName,
|
||||||
@required String projectBundleId,
|
@required String projectBundleId,
|
||||||
}) : super(projectBundleId: projectBundleId);
|
}) : super(projectBundleId: projectBundleId);
|
||||||
|
|
||||||
|
final Directory bundleDir;
|
||||||
|
final String bundleName;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get name => bundleName;
|
String get name => bundleName;
|
||||||
|
|
||||||
@ -299,11 +299,11 @@ Future<ApplicationPackage> getApplicationPackageForPlatform(
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ApplicationPackageStore {
|
class ApplicationPackageStore {
|
||||||
|
ApplicationPackageStore({ this.android, this.iOS });
|
||||||
|
|
||||||
AndroidApk android;
|
AndroidApk android;
|
||||||
IOSApp iOS;
|
IOSApp iOS;
|
||||||
|
|
||||||
ApplicationPackageStore({ this.android, this.iOS });
|
|
||||||
|
|
||||||
Future<ApplicationPackage> getPackageForPlatform(TargetPlatform platform) async {
|
Future<ApplicationPackage> getPackageForPlatform(TargetPlatform platform) async {
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case TargetPlatform.android_arm:
|
case TargetPlatform.android_arm:
|
||||||
@ -332,9 +332,6 @@ class _Entry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _Element extends _Entry {
|
class _Element extends _Entry {
|
||||||
List<_Entry> children;
|
|
||||||
String name;
|
|
||||||
|
|
||||||
_Element.fromLine(String line, _Element parent) {
|
_Element.fromLine(String line, _Element parent) {
|
||||||
// E: application (line=29)
|
// E: application (line=29)
|
||||||
final List<String> parts = line.trimLeft().split(' ');
|
final List<String> parts = line.trimLeft().split(' ');
|
||||||
@ -344,6 +341,9 @@ class _Element extends _Entry {
|
|||||||
children = <_Entry>[];
|
children = <_Entry>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<_Entry> children;
|
||||||
|
String name;
|
||||||
|
|
||||||
void addChild(_Entry child) {
|
void addChild(_Entry child) {
|
||||||
children.add(child);
|
children.add(child);
|
||||||
}
|
}
|
||||||
@ -369,9 +369,6 @@ class _Element extends _Entry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _Attribute extends _Entry {
|
class _Attribute extends _Entry {
|
||||||
String key;
|
|
||||||
String value;
|
|
||||||
|
|
||||||
_Attribute.fromLine(String line, _Element parent) {
|
_Attribute.fromLine(String line, _Element parent) {
|
||||||
// A: android:label(0x01010001)="hello_world" (Raw: "hello_world")
|
// A: android:label(0x01010001)="hello_world" (Raw: "hello_world")
|
||||||
const String attributePrefix = 'A: ';
|
const String attributePrefix = 'A: ';
|
||||||
@ -383,6 +380,9 @@ class _Attribute extends _Entry {
|
|||||||
level = line.length - line.trimLeft().length;
|
level = line.length - line.trimLeft().length;
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String key;
|
||||||
|
String value;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ApkManifestData {
|
class ApkManifestData {
|
||||||
|
@ -231,12 +231,12 @@ class CachedArtifacts extends Artifacts {
|
|||||||
|
|
||||||
/// Manages the artifacts of a locally built engine.
|
/// Manages the artifacts of a locally built engine.
|
||||||
class LocalEngineArtifacts extends Artifacts {
|
class LocalEngineArtifacts extends Artifacts {
|
||||||
|
LocalEngineArtifacts(this._engineSrcPath, this.engineOutPath, this._hostEngineOutPath);
|
||||||
|
|
||||||
final String _engineSrcPath;
|
final String _engineSrcPath;
|
||||||
final String engineOutPath; // TODO(goderbauer): This should be private.
|
final String engineOutPath; // TODO(goderbauer): This should be private.
|
||||||
String _hostEngineOutPath;
|
String _hostEngineOutPath;
|
||||||
|
|
||||||
LocalEngineArtifacts(this._engineSrcPath, this.engineOutPath, this._hostEngineOutPath);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]) {
|
String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]) {
|
||||||
switch (artifact) {
|
switch (artifact) {
|
||||||
|
@ -56,21 +56,21 @@ class _ManifestAssetBundleFactory implements AssetBundleFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ManifestAssetBundle implements AssetBundle {
|
class _ManifestAssetBundle implements AssetBundle {
|
||||||
|
/// Constructs an [_ManifestAssetBundle] that gathers the set of assets from the
|
||||||
|
/// pubspec.yaml manifest.
|
||||||
|
_ManifestAssetBundle();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Map<String, DevFSContent> entries = <String, DevFSContent>{};
|
final Map<String, DevFSContent> entries = <String, DevFSContent>{};
|
||||||
|
|
||||||
|
DateTime _lastBuildTimestamp;
|
||||||
|
|
||||||
static const String defaultManifestPath = 'pubspec.yaml';
|
static const String defaultManifestPath = 'pubspec.yaml';
|
||||||
static const String _assetManifestJson = 'AssetManifest.json';
|
static const String _assetManifestJson = 'AssetManifest.json';
|
||||||
static const String _fontManifestJson = 'FontManifest.json';
|
static const String _fontManifestJson = 'FontManifest.json';
|
||||||
static const String _fontSetMaterial = 'material';
|
static const String _fontSetMaterial = 'material';
|
||||||
static const String _license = 'LICENSE';
|
static const String _license = 'LICENSE';
|
||||||
|
|
||||||
DateTime _lastBuildTimestamp;
|
|
||||||
|
|
||||||
/// Constructs an [_ManifestAssetBundle] that gathers the set of assets from the
|
|
||||||
/// pubspec.yaml manifest.
|
|
||||||
_ManifestAssetBundle();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool wasBuiltOnce() => _lastBuildTimestamp != null;
|
bool wasBuiltOnce() => _lastBuildTimestamp != null;
|
||||||
|
|
||||||
|
@ -3,24 +3,6 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
class Version implements Comparable<Version> {
|
class Version implements Comparable<Version> {
|
||||||
static final RegExp versionPattern =
|
|
||||||
RegExp(r'^(\d+)(\.(\d+)(\.(\d+))?)?');
|
|
||||||
|
|
||||||
/// The major version number: "1" in "1.2.3".
|
|
||||||
final int major;
|
|
||||||
|
|
||||||
/// The minor version number: "2" in "1.2.3".
|
|
||||||
final int minor;
|
|
||||||
|
|
||||||
/// The patch version number: "3" in "1.2.3".
|
|
||||||
final int patch;
|
|
||||||
|
|
||||||
/// The original string representation of the version number.
|
|
||||||
///
|
|
||||||
/// This preserves textual artifacts like leading zeros that may be left out
|
|
||||||
/// of the parsed version.
|
|
||||||
final String _text;
|
|
||||||
|
|
||||||
/// Creates a new [Version] object.
|
/// Creates a new [Version] object.
|
||||||
factory Version(int major, int minor, int patch, {String text}) {
|
factory Version(int major, int minor, int patch, {String text}) {
|
||||||
if (text == null) {
|
if (text == null) {
|
||||||
@ -76,6 +58,24 @@ class Version implements Comparable<Version> {
|
|||||||
|
|
||||||
static Version get unknown => Version(0, 0, 0, text: 'unknown');
|
static Version get unknown => Version(0, 0, 0, text: 'unknown');
|
||||||
|
|
||||||
|
/// The major version number: "1" in "1.2.3".
|
||||||
|
final int major;
|
||||||
|
|
||||||
|
/// The minor version number: "2" in "1.2.3".
|
||||||
|
final int minor;
|
||||||
|
|
||||||
|
/// The patch version number: "3" in "1.2.3".
|
||||||
|
final int patch;
|
||||||
|
|
||||||
|
/// The original string representation of the version number.
|
||||||
|
///
|
||||||
|
/// This preserves textual artifacts like leading zeros that may be left out
|
||||||
|
/// of the parsed version.
|
||||||
|
final String _text;
|
||||||
|
|
||||||
|
static final RegExp versionPattern =
|
||||||
|
RegExp(r'^(\d+)(\.(\d+)(\.(\d+))?)?');
|
||||||
|
|
||||||
/// Two [Version]s are equal if their version numbers are. The version text
|
/// Two [Version]s are equal if their version numbers are. The version text
|
||||||
/// is ignored.
|
/// is ignored.
|
||||||
@override
|
@override
|
||||||
|
@ -15,11 +15,11 @@ import '../globals.dart';
|
|||||||
|
|
||||||
/// Common behavior for `flutter analyze` and `flutter analyze --watch`
|
/// Common behavior for `flutter analyze` and `flutter analyze --watch`
|
||||||
abstract class AnalyzeBase {
|
abstract class AnalyzeBase {
|
||||||
|
AnalyzeBase(this.argResults);
|
||||||
|
|
||||||
/// The parsed argument results for execution.
|
/// The parsed argument results for execution.
|
||||||
final ArgResults argResults;
|
final ArgResults argResults;
|
||||||
|
|
||||||
AnalyzeBase(this.argResults);
|
|
||||||
|
|
||||||
/// Called by [AnalyzeCommand] to start the analysis process.
|
/// Called by [AnalyzeCommand] to start the analysis process.
|
||||||
Future<Null> analyze();
|
Future<Null> analyze();
|
||||||
|
|
||||||
|
@ -819,14 +819,14 @@ class AppInstance {
|
|||||||
|
|
||||||
/// This domain responds to methods like [getEmulators] and [launch].
|
/// This domain responds to methods like [getEmulators] and [launch].
|
||||||
class EmulatorDomain extends Domain {
|
class EmulatorDomain extends Domain {
|
||||||
EmulatorManager emulators = EmulatorManager();
|
|
||||||
|
|
||||||
EmulatorDomain(Daemon daemon) : super(daemon, 'emulator') {
|
EmulatorDomain(Daemon daemon) : super(daemon, 'emulator') {
|
||||||
registerHandler('getEmulators', getEmulators);
|
registerHandler('getEmulators', getEmulators);
|
||||||
registerHandler('launch', launch);
|
registerHandler('launch', launch);
|
||||||
registerHandler('create', create);
|
registerHandler('create', create);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EmulatorManager emulators = EmulatorManager();
|
||||||
|
|
||||||
Future<List<Map<String, dynamic>>> getEmulators([Map<String, dynamic> args]) async {
|
Future<List<Map<String, dynamic>>> getEmulators([Map<String, dynamic> args]) async {
|
||||||
final List<Emulator> list = await emulators.getAllAvailableEmulators();
|
final List<Emulator> list = await emulators.getAllAvailableEmulators();
|
||||||
return list.map<Map<String, dynamic>>(_emulatorToMap).toList();
|
return list.map<Map<String, dynamic>>(_emulatorToMap).toList();
|
||||||
@ -971,9 +971,9 @@ class _AppRunLogger extends Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class LogMessage {
|
class LogMessage {
|
||||||
|
LogMessage(this.level, this.message, [this.stackTrace]);
|
||||||
|
|
||||||
final String level;
|
final String level;
|
||||||
final String message;
|
final String message;
|
||||||
final StackTrace stackTrace;
|
final StackTrace stackTrace;
|
||||||
|
|
||||||
LogMessage(this.level, this.message, [this.stackTrace]);
|
|
||||||
}
|
}
|
||||||
|
@ -444,18 +444,18 @@ class FuchsiaReloadCommand extends FlutterCommand {
|
|||||||
// VM service running on a Fuchsia device. [process] is the ssh process running
|
// VM service running on a Fuchsia device. [process] is the ssh process running
|
||||||
// the tunnel and [port] is the local port.
|
// the tunnel and [port] is the local port.
|
||||||
class _PortForwarder {
|
class _PortForwarder {
|
||||||
final String _remoteAddress;
|
|
||||||
final int _remotePort;
|
|
||||||
final int _localPort;
|
|
||||||
final Process _process;
|
|
||||||
final String _sshConfig;
|
|
||||||
|
|
||||||
_PortForwarder._(this._remoteAddress,
|
_PortForwarder._(this._remoteAddress,
|
||||||
this._remotePort,
|
this._remotePort,
|
||||||
this._localPort,
|
this._localPort,
|
||||||
this._process,
|
this._process,
|
||||||
this._sshConfig);
|
this._sshConfig);
|
||||||
|
|
||||||
|
final String _remoteAddress;
|
||||||
|
final int _remotePort;
|
||||||
|
final int _localPort;
|
||||||
|
final Process _process;
|
||||||
|
final String _sshConfig;
|
||||||
|
|
||||||
int get port => _localPort;
|
int get port => _localPort;
|
||||||
|
|
||||||
static Future<_PortForwarder> start(String sshConfig,
|
static Future<_PortForwarder> start(String sshConfig,
|
||||||
@ -519,11 +519,11 @@ class _PortForwarder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FuchsiaDeviceCommandRunner {
|
class FuchsiaDeviceCommandRunner {
|
||||||
|
FuchsiaDeviceCommandRunner(this._address, this._sshConfig);
|
||||||
|
|
||||||
final String _address;
|
final String _address;
|
||||||
final String _sshConfig;
|
final String _sshConfig;
|
||||||
|
|
||||||
FuchsiaDeviceCommandRunner(this._address, this._sshConfig);
|
|
||||||
|
|
||||||
Future<List<String>> run(String command) async {
|
Future<List<String>> run(String command) async {
|
||||||
final List<String> args = <String>['ssh', '-F', _sshConfig, _address, command];
|
final List<String> args = <String>['ssh', '-F', _sshConfig, _address, command];
|
||||||
printTrace(args.join(' '));
|
printTrace(args.join(' '));
|
||||||
|
@ -72,12 +72,6 @@ abstract class RunCommandBase extends FlutterCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class RunCommand extends RunCommandBase {
|
class RunCommand extends RunCommandBase {
|
||||||
@override
|
|
||||||
final String name = 'run';
|
|
||||||
|
|
||||||
@override
|
|
||||||
final String description = 'Run your Flutter app on an attached device.';
|
|
||||||
|
|
||||||
RunCommand({ bool verboseHelp = false }) : super(verboseHelp: verboseHelp) {
|
RunCommand({ bool verboseHelp = false }) : super(verboseHelp: verboseHelp) {
|
||||||
requiresPubspecYaml();
|
requiresPubspecYaml();
|
||||||
usesFilesystemOptions(hide: !verboseHelp);
|
usesFilesystemOptions(hide: !verboseHelp);
|
||||||
@ -179,6 +173,12 @@ class RunCommand extends RunCommandBase {
|
|||||||
..addOption(FlutterOptions.kExtraGenSnapshotOptions, hide: true);
|
..addOption(FlutterOptions.kExtraGenSnapshotOptions, hide: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
final String name = 'run';
|
||||||
|
|
||||||
|
@override
|
||||||
|
final String description = 'Run your Flutter app on an attached device.';
|
||||||
|
|
||||||
List<Device> devices;
|
List<Device> devices;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -21,10 +21,10 @@ KernelCompiler get kernelCompiler => context[KernelCompiler];
|
|||||||
typedef CompilerMessageConsumer = void Function(String message, {bool emphasis, TerminalColor color});
|
typedef CompilerMessageConsumer = void Function(String message, {bool emphasis, TerminalColor color});
|
||||||
|
|
||||||
class CompilerOutput {
|
class CompilerOutput {
|
||||||
|
const CompilerOutput(this.outputFilename, this.errorCount);
|
||||||
|
|
||||||
final String outputFilename;
|
final String outputFilename;
|
||||||
final int errorCount;
|
final int errorCount;
|
||||||
|
|
||||||
const CompilerOutput(this.outputFilename, this.errorCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _StdoutHandler {
|
class _StdoutHandler {
|
||||||
@ -198,10 +198,10 @@ class KernelCompiler {
|
|||||||
|
|
||||||
/// Class that allows to serialize compilation requests to the compiler.
|
/// Class that allows to serialize compilation requests to the compiler.
|
||||||
abstract class _CompilationRequest {
|
abstract class _CompilationRequest {
|
||||||
Completer<CompilerOutput> completer;
|
|
||||||
|
|
||||||
_CompilationRequest(this.completer);
|
_CompilationRequest(this.completer);
|
||||||
|
|
||||||
|
Completer<CompilerOutput> completer;
|
||||||
|
|
||||||
Future<CompilerOutput> _run(ResidentCompiler compiler);
|
Future<CompilerOutput> _run(ResidentCompiler compiler);
|
||||||
|
|
||||||
Future<void> run(ResidentCompiler compiler) async {
|
Future<void> run(ResidentCompiler compiler) async {
|
||||||
|
@ -48,10 +48,10 @@ const String _kStackTraceFilename = 'stacktrace_file';
|
|||||||
/// * In tests call [initializeWith] and provide a mock implementation of
|
/// * In tests call [initializeWith] and provide a mock implementation of
|
||||||
/// [http.Client].
|
/// [http.Client].
|
||||||
class CrashReportSender {
|
class CrashReportSender {
|
||||||
static CrashReportSender _instance;
|
|
||||||
|
|
||||||
CrashReportSender._(this._client);
|
CrashReportSender._(this._client);
|
||||||
|
|
||||||
|
static CrashReportSender _instance;
|
||||||
|
|
||||||
static CrashReportSender get instance => _instance ?? CrashReportSender._(http.Client());
|
static CrashReportSender get instance => _instance ?? CrashReportSender._(http.Client());
|
||||||
|
|
||||||
/// Overrides the default [http.Client] with [client] for testing purposes.
|
/// Overrides the default [http.Client] with [client] for testing purposes.
|
||||||
|
@ -23,7 +23,17 @@ import 'sdk.dart';
|
|||||||
// DO NOT update without contacting kevmoo.
|
// DO NOT update without contacting kevmoo.
|
||||||
// We have server-side tooling that assumes the values are consistent.
|
// We have server-side tooling that assumes the values are consistent.
|
||||||
class PubContext {
|
class PubContext {
|
||||||
static final RegExp _validContext = RegExp('[a-z][a-z_]*[a-z]');
|
PubContext._(this._values) {
|
||||||
|
for (String item in _values) {
|
||||||
|
if (!_validContext.hasMatch(item)) {
|
||||||
|
throw ArgumentError.value(
|
||||||
|
_values, 'value', 'Must match RegExp ${_validContext.pattern}');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static PubContext getVerifyContext(String commandName) =>
|
||||||
|
PubContext._(<String>['verify', commandName.replaceAll('-', '_')]);
|
||||||
|
|
||||||
static final PubContext create = PubContext._(<String>['create']);
|
static final PubContext create = PubContext._(<String>['create']);
|
||||||
static final PubContext createPackage = PubContext._(<String>['create_pkg']);
|
static final PubContext createPackage = PubContext._(<String>['create_pkg']);
|
||||||
@ -38,17 +48,7 @@ class PubContext {
|
|||||||
|
|
||||||
final List<String> _values;
|
final List<String> _values;
|
||||||
|
|
||||||
PubContext._(this._values) {
|
static final RegExp _validContext = RegExp('[a-z][a-z_]*[a-z]');
|
||||||
for (String item in _values) {
|
|
||||||
if (!_validContext.hasMatch(item)) {
|
|
||||||
throw ArgumentError.value(
|
|
||||||
_values, 'value', 'Must match RegExp ${_validContext.pattern}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static PubContext getVerifyContext(String commandName) =>
|
|
||||||
PubContext._(<String>['verify', commandName.replaceAll('-', '_')]);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'PubContext: ${_values.join(':')}';
|
String toString() => 'PubContext: ${_values.join(':')}';
|
||||||
|
@ -8,10 +8,11 @@ import 'dart/dependencies.dart';
|
|||||||
import 'globals.dart';
|
import 'globals.dart';
|
||||||
|
|
||||||
class DependencyChecker {
|
class DependencyChecker {
|
||||||
|
DependencyChecker(this.builder, this.assets);
|
||||||
|
|
||||||
final DartDependencySetBuilder builder;
|
final DartDependencySetBuilder builder;
|
||||||
final Set<String> _dependencies = Set<String>();
|
final Set<String> _dependencies = Set<String>();
|
||||||
final AssetBundle assets;
|
final AssetBundle assets;
|
||||||
DependencyChecker(this.builder, this.assets);
|
|
||||||
|
|
||||||
/// Returns [true] if any components have been modified after [threshold] or
|
/// Returns [true] if any components have been modified after [threshold] or
|
||||||
/// if it cannot be determined.
|
/// if it cannot be determined.
|
||||||
|
@ -201,10 +201,10 @@ abstract class DevFSOperations {
|
|||||||
/// An implementation of [DevFSOperations] that speaks to the
|
/// An implementation of [DevFSOperations] that speaks to the
|
||||||
/// vm service.
|
/// vm service.
|
||||||
class ServiceProtocolDevFSOperations implements DevFSOperations {
|
class ServiceProtocolDevFSOperations implements DevFSOperations {
|
||||||
final VMService vmService;
|
|
||||||
|
|
||||||
ServiceProtocolDevFSOperations(this.vmService);
|
ServiceProtocolDevFSOperations(this.vmService);
|
||||||
|
|
||||||
|
final VMService vmService;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Uri> create(String fsName) async {
|
Future<Uri> create(String fsName) async {
|
||||||
final Map<String, dynamic> response = await vmService.vm.createDevFS(fsName);
|
final Map<String, dynamic> response = await vmService.vm.createDevFS(fsName);
|
||||||
|
@ -420,10 +420,10 @@ class NoIdeValidator extends DoctorValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abstract class IntelliJValidator extends DoctorValidator {
|
abstract class IntelliJValidator extends DoctorValidator {
|
||||||
final String installPath;
|
|
||||||
|
|
||||||
IntelliJValidator(String title, this.installPath) : super(title);
|
IntelliJValidator(String title, this.installPath) : super(title);
|
||||||
|
|
||||||
|
final String installPath;
|
||||||
|
|
||||||
String get version;
|
String get version;
|
||||||
String get pluginsPath;
|
String get pluginsPath;
|
||||||
|
|
||||||
@ -644,10 +644,10 @@ class DeviceValidator extends DoctorValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ValidatorWithResult extends DoctorValidator {
|
class ValidatorWithResult extends DoctorValidator {
|
||||||
final ValidationResult result;
|
|
||||||
|
|
||||||
ValidatorWithResult(String title, this.result) : super(title);
|
ValidatorWithResult(String title, this.result) : super(title);
|
||||||
|
|
||||||
|
final ValidationResult result;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<ValidationResult> validate() async => result;
|
Future<ValidationResult> validate() async => result;
|
||||||
}
|
}
|
||||||
|
@ -277,10 +277,10 @@ abstract class Emulator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class CreateEmulatorResult {
|
class CreateEmulatorResult {
|
||||||
|
CreateEmulatorResult(this.emulatorName, {this.success, this.output, this.error});
|
||||||
|
|
||||||
final bool success;
|
final bool success;
|
||||||
final String emulatorName;
|
final String emulatorName;
|
||||||
final String output;
|
final String output;
|
||||||
final String error;
|
final String error;
|
||||||
|
|
||||||
CreateEmulatorResult(this.emulatorName, {this.success, this.output, this.error});
|
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,10 @@ import '../device.dart';
|
|||||||
|
|
||||||
/// Read the log for a particular device.
|
/// Read the log for a particular device.
|
||||||
class _FuchsiaLogReader extends DeviceLogReader {
|
class _FuchsiaLogReader extends DeviceLogReader {
|
||||||
FuchsiaDevice _device;
|
|
||||||
|
|
||||||
_FuchsiaLogReader(this._device);
|
_FuchsiaLogReader(this._device);
|
||||||
|
|
||||||
|
FuchsiaDevice _device;
|
||||||
|
|
||||||
@override String get name => _device.name;
|
@override String get name => _device.name;
|
||||||
|
|
||||||
Stream<String> _logLines;
|
Stream<String> _logLines;
|
||||||
|
@ -11,11 +11,11 @@ import '../base/version.dart';
|
|||||||
import '../doctor.dart';
|
import '../doctor.dart';
|
||||||
|
|
||||||
class IntelliJPlugins {
|
class IntelliJPlugins {
|
||||||
static final Version kMinFlutterPluginVersion = Version(16, 0, 0);
|
IntelliJPlugins(this.pluginsPath);
|
||||||
|
|
||||||
final String pluginsPath;
|
final String pluginsPath;
|
||||||
|
|
||||||
IntelliJPlugins(this.pluginsPath);
|
static final Version kMinFlutterPluginVersion = Version(16, 0, 0);
|
||||||
|
|
||||||
void validatePackage(
|
void validatePackage(
|
||||||
List<ValidationMessage> messages, List<String> packageNames, String title,
|
List<ValidationMessage> messages, List<String> packageNames, String title,
|
||||||
|
@ -440,11 +440,6 @@ String decodeSyslog(String line) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _IOSDeviceLogReader extends DeviceLogReader {
|
class _IOSDeviceLogReader extends DeviceLogReader {
|
||||||
// Matches a syslog line from the runner.
|
|
||||||
RegExp _runnerLineRegex;
|
|
||||||
// Matches a syslog line from any app.
|
|
||||||
RegExp _anyLineRegex;
|
|
||||||
|
|
||||||
_IOSDeviceLogReader(this.device, ApplicationPackage app) {
|
_IOSDeviceLogReader(this.device, ApplicationPackage app) {
|
||||||
_linesController = StreamController<String>.broadcast(
|
_linesController = StreamController<String>.broadcast(
|
||||||
onListen: _start,
|
onListen: _start,
|
||||||
@ -465,6 +460,11 @@ class _IOSDeviceLogReader extends DeviceLogReader {
|
|||||||
|
|
||||||
final IOSDevice device;
|
final IOSDevice device;
|
||||||
|
|
||||||
|
// Matches a syslog line from the runner.
|
||||||
|
RegExp _runnerLineRegex;
|
||||||
|
// Matches a syslog line from any app.
|
||||||
|
RegExp _anyLineRegex;
|
||||||
|
|
||||||
StreamController<String> _linesController;
|
StreamController<String> _linesController;
|
||||||
Process _process;
|
Process _process;
|
||||||
|
|
||||||
|
@ -482,8 +482,6 @@ Future<Process> launchSystemLogTool(IOSSimulator device) async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _IOSSimulatorLogReader extends DeviceLogReader {
|
class _IOSSimulatorLogReader extends DeviceLogReader {
|
||||||
String _appName;
|
|
||||||
|
|
||||||
_IOSSimulatorLogReader(this.device, IOSApp app) {
|
_IOSSimulatorLogReader(this.device, IOSApp app) {
|
||||||
_linesController = StreamController<String>.broadcast(
|
_linesController = StreamController<String>.broadcast(
|
||||||
onListen: _start,
|
onListen: _start,
|
||||||
@ -494,6 +492,8 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
|
|||||||
|
|
||||||
final IOSSimulator device;
|
final IOSSimulator device;
|
||||||
|
|
||||||
|
String _appName;
|
||||||
|
|
||||||
StreamController<String> _linesController;
|
StreamController<String> _linesController;
|
||||||
|
|
||||||
// We log from two files: the device and the system log.
|
// We log from two files: the device and the system log.
|
||||||
|
@ -22,12 +22,6 @@ void _renderTemplateToFile(String template, dynamic context, String filePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Plugin {
|
class Plugin {
|
||||||
final String name;
|
|
||||||
final String path;
|
|
||||||
final String androidPackage;
|
|
||||||
final String iosPrefix;
|
|
||||||
final String pluginClass;
|
|
||||||
|
|
||||||
Plugin({
|
Plugin({
|
||||||
this.name,
|
this.name,
|
||||||
this.path,
|
this.path,
|
||||||
@ -53,6 +47,12 @@ class Plugin {
|
|||||||
pluginClass: pluginClass,
|
pluginClass: pluginClass,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final String name;
|
||||||
|
final String path;
|
||||||
|
final String androidPackage;
|
||||||
|
final String iosPrefix;
|
||||||
|
final String pluginClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
Plugin _pluginFromPubspec(String name, Uri packageRoot) {
|
Plugin _pluginFromPubspec(String name, Uri packageRoot) {
|
||||||
|
@ -148,15 +148,15 @@ class FlutterProject {
|
|||||||
/// Instances will reflect the contents of the `ios/` sub-folder of
|
/// Instances will reflect the contents of the `ios/` sub-folder of
|
||||||
/// Flutter applications and the `.ios/` sub-folder of Flutter modules.
|
/// Flutter applications and the `.ios/` sub-folder of Flutter modules.
|
||||||
class IosProject {
|
class IosProject {
|
||||||
static final RegExp _productBundleIdPattern = RegExp(r'^\s*PRODUCT_BUNDLE_IDENTIFIER\s*=\s*(.*);\s*$');
|
|
||||||
static const String _productBundleIdVariable = r'$(PRODUCT_BUNDLE_IDENTIFIER)';
|
|
||||||
static const String _hostAppBundleName = 'Runner';
|
|
||||||
|
|
||||||
IosProject._(this.parent);
|
IosProject._(this.parent);
|
||||||
|
|
||||||
/// The parent of this project.
|
/// The parent of this project.
|
||||||
final FlutterProject parent;
|
final FlutterProject parent;
|
||||||
|
|
||||||
|
static final RegExp _productBundleIdPattern = RegExp(r'^\s*PRODUCT_BUNDLE_IDENTIFIER\s*=\s*(.*);\s*$');
|
||||||
|
static const String _productBundleIdVariable = r'$(PRODUCT_BUNDLE_IDENTIFIER)';
|
||||||
|
static const String _hostAppBundleName = 'Runner';
|
||||||
|
|
||||||
Directory get _ephemeralDirectory => parent.directory.childDirectory('.ios');
|
Directory get _ephemeralDirectory => parent.directory.childDirectory('.ios');
|
||||||
Directory get _editableDirectory => parent.directory.childDirectory('ios');
|
Directory get _editableDirectory => parent.directory.childDirectory('ios');
|
||||||
|
|
||||||
@ -321,14 +321,14 @@ class IosProject {
|
|||||||
/// Instances will reflect the contents of the `android/` sub-folder of
|
/// Instances will reflect the contents of the `android/` sub-folder of
|
||||||
/// Flutter applications and the `.android/` sub-folder of Flutter modules.
|
/// Flutter applications and the `.android/` sub-folder of Flutter modules.
|
||||||
class AndroidProject {
|
class AndroidProject {
|
||||||
static final RegExp _applicationIdPattern = RegExp('^\\s*applicationId\\s+[\'\"](.*)[\'\"]\\s*\$');
|
|
||||||
static final RegExp _groupPattern = RegExp('^\\s*group\\s+[\'\"](.*)[\'\"]\\s*\$');
|
|
||||||
|
|
||||||
AndroidProject._(this.parent);
|
AndroidProject._(this.parent);
|
||||||
|
|
||||||
/// The parent of this project.
|
/// The parent of this project.
|
||||||
final FlutterProject parent;
|
final FlutterProject parent;
|
||||||
|
|
||||||
|
static final RegExp _applicationIdPattern = RegExp('^\\s*applicationId\\s+[\'\"](.*)[\'\"]\\s*\$');
|
||||||
|
static final RegExp _groupPattern = RegExp('^\\s*group\\s+[\'\"](.*)[\'\"]\\s*\$');
|
||||||
|
|
||||||
/// The Gradle root directory of the Android host app. This is the directory
|
/// The Gradle root directory of the Android host app. This is the directory
|
||||||
/// containing the `app/` subdirectory and the `settings.gradle` file that
|
/// containing the `app/` subdirectory and the `settings.gradle` file that
|
||||||
/// includes it in the overall Gradle project.
|
/// includes it in the overall Gradle project.
|
||||||
|
@ -22,8 +22,6 @@ import '../protocol_discovery.dart';
|
|||||||
import '../version.dart';
|
import '../version.dart';
|
||||||
|
|
||||||
class FlutterTesterApp extends ApplicationPackage {
|
class FlutterTesterApp extends ApplicationPackage {
|
||||||
final Directory _directory;
|
|
||||||
|
|
||||||
factory FlutterTesterApp.fromCurrentDirectory() {
|
factory FlutterTesterApp.fromCurrentDirectory() {
|
||||||
return FlutterTesterApp._(fs.currentDirectory);
|
return FlutterTesterApp._(fs.currentDirectory);
|
||||||
}
|
}
|
||||||
@ -32,6 +30,8 @@ class FlutterTesterApp extends ApplicationPackage {
|
|||||||
: _directory = directory,
|
: _directory = directory,
|
||||||
super(id: directory.path);
|
super(id: directory.path);
|
||||||
|
|
||||||
|
final Directory _directory;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get name => _directory.basename;
|
String get name => _directory.basename;
|
||||||
|
|
||||||
|
@ -368,10 +368,6 @@ class FlutterVersion {
|
|||||||
/// Contains data and load/save logic pertaining to Flutter version checks.
|
/// Contains data and load/save logic pertaining to Flutter version checks.
|
||||||
@visibleForTesting
|
@visibleForTesting
|
||||||
class VersionCheckStamp {
|
class VersionCheckStamp {
|
||||||
/// The prefix of the stamp file where we cache Flutter version check data.
|
|
||||||
@visibleForTesting
|
|
||||||
static const String kFlutterVersionCheckStampFile = 'flutter_version_check';
|
|
||||||
|
|
||||||
const VersionCheckStamp({
|
const VersionCheckStamp({
|
||||||
this.lastTimeVersionWasChecked,
|
this.lastTimeVersionWasChecked,
|
||||||
this.lastKnownRemoteVersion,
|
this.lastKnownRemoteVersion,
|
||||||
@ -382,6 +378,10 @@ class VersionCheckStamp {
|
|||||||
final DateTime lastKnownRemoteVersion;
|
final DateTime lastKnownRemoteVersion;
|
||||||
final DateTime lastTimeWarningWasPrinted;
|
final DateTime lastTimeWarningWasPrinted;
|
||||||
|
|
||||||
|
/// The prefix of the stamp file where we cache Flutter version check data.
|
||||||
|
@visibleForTesting
|
||||||
|
static const String kFlutterVersionCheckStampFile = 'flutter_version_check';
|
||||||
|
|
||||||
static Future<VersionCheckStamp> load() async {
|
static Future<VersionCheckStamp> load() async {
|
||||||
final String versionCheckStamp = Cache.instance.getStampFor(kFlutterVersionCheckStampFile);
|
final String versionCheckStamp = Cache.instance.getStampFor(kFlutterVersionCheckStampFile);
|
||||||
|
|
||||||
|
@ -559,7 +559,20 @@ abstract class ServiceObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ServiceEvent extends ServiceObject {
|
class ServiceEvent extends ServiceObject {
|
||||||
/// The possible 'kind' values.
|
ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner);
|
||||||
|
|
||||||
|
String _kind;
|
||||||
|
String get kind => _kind;
|
||||||
|
DateTime _timestamp;
|
||||||
|
DateTime get timestamp => _timestamp;
|
||||||
|
String _extensionKind;
|
||||||
|
String get extensionKind => _extensionKind;
|
||||||
|
Map<String, dynamic> _extensionData;
|
||||||
|
Map<String, dynamic> get extensionData => _extensionData;
|
||||||
|
List<Map<String, dynamic>> _timelineEvents;
|
||||||
|
List<Map<String, dynamic>> get timelineEvents => _timelineEvents;
|
||||||
|
|
||||||
|
// The possible 'kind' values.
|
||||||
static const String kVMUpdate = 'VMUpdate';
|
static const String kVMUpdate = 'VMUpdate';
|
||||||
static const String kIsolateStart = 'IsolateStart';
|
static const String kIsolateStart = 'IsolateStart';
|
||||||
static const String kIsolateRunnable = 'IsolateRunnable';
|
static const String kIsolateRunnable = 'IsolateRunnable';
|
||||||
@ -587,19 +600,6 @@ class ServiceEvent extends ServiceObject {
|
|||||||
static const String kLogging = '_Logging';
|
static const String kLogging = '_Logging';
|
||||||
static const String kExtension = 'Extension';
|
static const String kExtension = 'Extension';
|
||||||
|
|
||||||
ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner);
|
|
||||||
|
|
||||||
String _kind;
|
|
||||||
String get kind => _kind;
|
|
||||||
DateTime _timestamp;
|
|
||||||
DateTime get timestamp => _timestamp;
|
|
||||||
String _extensionKind;
|
|
||||||
String get extensionKind => _extensionKind;
|
|
||||||
Map<String, dynamic> _extensionData;
|
|
||||||
Map<String, dynamic> get extensionData => _extensionData;
|
|
||||||
List<Map<String, dynamic>> _timelineEvents;
|
|
||||||
List<Map<String, dynamic>> get timelineEvents => _timelineEvents;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void _update(Map<String, dynamic> map, bool mapIsRef) {
|
void _update(Map<String, dynamic> map, bool mapIsRef) {
|
||||||
_loaded = true;
|
_loaded = true;
|
||||||
|
@ -22,11 +22,6 @@ const String _kData = 'data';
|
|||||||
/// A [StreamChannel] that expects VM service (JSON-rpc) protocol messages and
|
/// A [StreamChannel] that expects VM service (JSON-rpc) protocol messages and
|
||||||
/// serializes all such messages to the file system for later playback.
|
/// serializes all such messages to the file system for later playback.
|
||||||
class RecordingVMServiceChannel extends DelegatingStreamChannel<String> {
|
class RecordingVMServiceChannel extends DelegatingStreamChannel<String> {
|
||||||
final List<_Message> _messages = <_Message>[];
|
|
||||||
|
|
||||||
_RecordingStream _streamRecorder;
|
|
||||||
_RecordingSink _sinkRecorder;
|
|
||||||
|
|
||||||
RecordingVMServiceChannel(StreamChannel<String> delegate, Directory location)
|
RecordingVMServiceChannel(StreamChannel<String> delegate, Directory location)
|
||||||
: super(delegate) {
|
: super(delegate) {
|
||||||
addShutdownHook(() async {
|
addShutdownHook(() async {
|
||||||
@ -41,6 +36,11 @@ class RecordingVMServiceChannel extends DelegatingStreamChannel<String> {
|
|||||||
}, ShutdownStage.SERIALIZE_RECORDING);
|
}, ShutdownStage.SERIALIZE_RECORDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final List<_Message> _messages = <_Message>[];
|
||||||
|
|
||||||
|
_RecordingStream _streamRecorder;
|
||||||
|
_RecordingSink _sinkRecorder;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Stream<String> get stream {
|
Stream<String> get stream {
|
||||||
_streamRecorder ??= _RecordingStream(super.stream, _messages);
|
_streamRecorder ??= _RecordingStream(super.stream, _messages);
|
||||||
@ -53,9 +53,6 @@ class RecordingVMServiceChannel extends DelegatingStreamChannel<String> {
|
|||||||
|
|
||||||
/// Base class for request and response JSON-rpc messages.
|
/// Base class for request and response JSON-rpc messages.
|
||||||
abstract class _Message implements Comparable<_Message> {
|
abstract class _Message implements Comparable<_Message> {
|
||||||
final String type;
|
|
||||||
final Map<String, dynamic> data;
|
|
||||||
|
|
||||||
_Message(this.type, this.data);
|
_Message(this.type, this.data);
|
||||||
|
|
||||||
factory _Message.fromRecording(Map<String, dynamic> recordingData) {
|
factory _Message.fromRecording(Map<String, dynamic> recordingData) {
|
||||||
@ -64,6 +61,9 @@ abstract class _Message implements Comparable<_Message> {
|
|||||||
: _Response(recordingData[_kData]);
|
: _Response(recordingData[_kData]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final String type;
|
||||||
|
final Map<String, dynamic> data;
|
||||||
|
|
||||||
int get id => data[_kId];
|
int get id => data[_kId];
|
||||||
|
|
||||||
/// Allows [JsonEncoder] to properly encode objects of this type.
|
/// Allows [JsonEncoder] to properly encode objects of this type.
|
||||||
@ -115,11 +115,6 @@ class _Transaction {
|
|||||||
/// A helper class that monitors a [Stream] of VM service JSON-rpc responses
|
/// A helper class that monitors a [Stream] of VM service JSON-rpc responses
|
||||||
/// and saves the responses to a recording.
|
/// and saves the responses to a recording.
|
||||||
class _RecordingStream {
|
class _RecordingStream {
|
||||||
final Stream<String> _delegate;
|
|
||||||
final StreamController<String> _controller;
|
|
||||||
final List<_Message> _recording;
|
|
||||||
StreamSubscription<String> _subscription;
|
|
||||||
|
|
||||||
_RecordingStream(Stream<String> stream, this._recording)
|
_RecordingStream(Stream<String> stream, this._recording)
|
||||||
: _delegate = stream,
|
: _delegate = stream,
|
||||||
_controller = stream.isBroadcast
|
_controller = stream.isBroadcast
|
||||||
@ -144,6 +139,11 @@ class _RecordingStream {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final Stream<String> _delegate;
|
||||||
|
final StreamController<String> _controller;
|
||||||
|
final List<_Message> _recording;
|
||||||
|
StreamSubscription<String> _subscription;
|
||||||
|
|
||||||
StreamSubscription<String> _listenToStream() {
|
StreamSubscription<String> _listenToStream() {
|
||||||
return _delegate.listen(
|
return _delegate.listen(
|
||||||
(String element) {
|
(String element) {
|
||||||
@ -162,11 +162,11 @@ class _RecordingStream {
|
|||||||
/// A [StreamSink] that monitors VM service JSON-rpc requests and saves the
|
/// A [StreamSink] that monitors VM service JSON-rpc requests and saves the
|
||||||
/// requests to a recording.
|
/// requests to a recording.
|
||||||
class _RecordingSink implements StreamSink<String> {
|
class _RecordingSink implements StreamSink<String> {
|
||||||
|
_RecordingSink(this._delegate, this._recording);
|
||||||
|
|
||||||
final StreamSink<String> _delegate;
|
final StreamSink<String> _delegate;
|
||||||
final List<_Message> _recording;
|
final List<_Message> _recording;
|
||||||
|
|
||||||
_RecordingSink(this._delegate, this._recording);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<dynamic> close() => _delegate.close();
|
Future<dynamic> close() => _delegate.close();
|
||||||
|
|
||||||
@ -194,13 +194,13 @@ class _RecordingSink implements StreamSink<String> {
|
|||||||
/// to its [StreamChannel.sink], looks up those requests in a recording, and
|
/// to its [StreamChannel.sink], looks up those requests in a recording, and
|
||||||
/// replays the corresponding responses back from the recording.
|
/// replays the corresponding responses back from the recording.
|
||||||
class ReplayVMServiceChannel extends StreamChannelMixin<String> {
|
class ReplayVMServiceChannel extends StreamChannelMixin<String> {
|
||||||
|
ReplayVMServiceChannel(Directory location)
|
||||||
|
: _transactions = _loadTransactions(location);
|
||||||
|
|
||||||
final Map<int, _Transaction> _transactions;
|
final Map<int, _Transaction> _transactions;
|
||||||
final StreamController<String> _controller = StreamController<String>();
|
final StreamController<String> _controller = StreamController<String>();
|
||||||
_ReplaySink _replaySink;
|
_ReplaySink _replaySink;
|
||||||
|
|
||||||
ReplayVMServiceChannel(Directory location)
|
|
||||||
: _transactions = _loadTransactions(location);
|
|
||||||
|
|
||||||
static Map<int, _Transaction> _loadTransactions(Directory location) {
|
static Map<int, _Transaction> _loadTransactions(Directory location) {
|
||||||
final File file = _getManifest(location);
|
final File file = _getManifest(location);
|
||||||
final String jsonData = file.readAsStringSync();
|
final String jsonData = file.readAsStringSync();
|
||||||
@ -250,11 +250,11 @@ class ReplayVMServiceChannel extends StreamChannelMixin<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ReplaySink implements StreamSink<String> {
|
class _ReplaySink implements StreamSink<String> {
|
||||||
|
_ReplaySink(this.channel);
|
||||||
|
|
||||||
final ReplayVMServiceChannel channel;
|
final ReplayVMServiceChannel channel;
|
||||||
final Completer<Null> _completer = Completer<Null>();
|
final Completer<Null> _completer = Completer<Null>();
|
||||||
|
|
||||||
_ReplaySink(this.channel);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<dynamic> close() {
|
Future<dynamic> close() {
|
||||||
_completer.complete();
|
_completer.complete();
|
||||||
|
@ -45,17 +45,6 @@ class VsCode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final String directory;
|
|
||||||
final String extensionDirectory;
|
|
||||||
final Version version;
|
|
||||||
final String edition;
|
|
||||||
|
|
||||||
static const String extensionIdentifier = 'Dart-Code.flutter';
|
|
||||||
|
|
||||||
bool _isValid = false;
|
|
||||||
Version _extensionVersion;
|
|
||||||
final List<String> _validationMessages = <String>[];
|
|
||||||
|
|
||||||
factory VsCode.fromDirectory(String installPath, String extensionDirectory,
|
factory VsCode.fromDirectory(String installPath, String extensionDirectory,
|
||||||
{ String edition }) {
|
{ String edition }) {
|
||||||
final String packageJsonPath =
|
final String packageJsonPath =
|
||||||
@ -67,6 +56,17 @@ class VsCode {
|
|||||||
return VsCode._(installPath, extensionDirectory, version: version, edition: edition);
|
return VsCode._(installPath, extensionDirectory, version: version, edition: edition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final String directory;
|
||||||
|
final String extensionDirectory;
|
||||||
|
final Version version;
|
||||||
|
final String edition;
|
||||||
|
|
||||||
|
static const String extensionIdentifier = 'Dart-Code.flutter';
|
||||||
|
|
||||||
|
bool _isValid = false;
|
||||||
|
Version _extensionVersion;
|
||||||
|
final List<String> _validationMessages = <String>[];
|
||||||
|
|
||||||
bool get isValid => _isValid;
|
bool get isValid => _isValid;
|
||||||
String get productName => 'VS Code' + (edition != null ? ', $edition' : '');
|
String get productName => 'VS Code' + (edition != null ? ', $edition' : '');
|
||||||
|
|
||||||
|
@ -9,11 +9,12 @@ import '../doctor.dart';
|
|||||||
import 'vscode.dart';
|
import 'vscode.dart';
|
||||||
|
|
||||||
class VsCodeValidator extends DoctorValidator {
|
class VsCodeValidator extends DoctorValidator {
|
||||||
static const String extensionMarketplaceUrl =
|
VsCodeValidator(this._vsCode) : super(_vsCode.productName);
|
||||||
'https://marketplace.visualstudio.com/items?itemName=${VsCode.extensionIdentifier}';
|
|
||||||
final VsCode _vsCode;
|
final VsCode _vsCode;
|
||||||
|
|
||||||
VsCodeValidator(this._vsCode) : super(_vsCode.productName);
|
static const String extensionMarketplaceUrl =
|
||||||
|
'https://marketplace.visualstudio.com/items?itemName=${VsCode.extensionIdentifier}';
|
||||||
|
|
||||||
static Iterable<DoctorValidator> get installedValidators {
|
static Iterable<DoctorValidator> get installedValidators {
|
||||||
return VsCode
|
return VsCode
|
||||||
|
@ -510,18 +510,17 @@ class FakeGroupedDoctorWithStatus extends Doctor {
|
|||||||
/// A doctor that takes any two validators. Used to check behavior when
|
/// A doctor that takes any two validators. Used to check behavior when
|
||||||
/// merging ValidationTypes (installed, missing, partial).
|
/// merging ValidationTypes (installed, missing, partial).
|
||||||
class FakeSmallGroupDoctor extends Doctor {
|
class FakeSmallGroupDoctor extends Doctor {
|
||||||
List<DoctorValidator> _validators;
|
|
||||||
FakeSmallGroupDoctor(DoctorValidator val1, DoctorValidator val2) {
|
FakeSmallGroupDoctor(DoctorValidator val1, DoctorValidator val2) {
|
||||||
_validators = <DoctorValidator>[GroupedValidator(<DoctorValidator>[val1, val2])];
|
_validators = <DoctorValidator>[GroupedValidator(<DoctorValidator>[val1, val2])];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<DoctorValidator> _validators;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<DoctorValidator> get validators => _validators;
|
List<DoctorValidator> get validators => _validators;
|
||||||
}
|
}
|
||||||
|
|
||||||
class VsCodeValidatorTestTargets extends VsCodeValidator {
|
class VsCodeValidatorTestTargets extends VsCodeValidator {
|
||||||
static final String validInstall = fs.path.join('test', 'data', 'vscode', 'application');
|
|
||||||
static final String validExtensions = fs.path.join('test', 'data', 'vscode', 'extensions');
|
|
||||||
static final String missingExtensions = fs.path.join('test', 'data', 'vscode', 'notExtensions');
|
|
||||||
VsCodeValidatorTestTargets._(String installDirectory, String extensionDirectory, {String edition})
|
VsCodeValidatorTestTargets._(String installDirectory, String extensionDirectory, {String edition})
|
||||||
: super(VsCode.fromDirectory(installDirectory, extensionDirectory, edition: edition));
|
: super(VsCode.fromDirectory(installDirectory, extensionDirectory, edition: edition));
|
||||||
|
|
||||||
@ -533,4 +532,8 @@ class VsCodeValidatorTestTargets extends VsCodeValidator {
|
|||||||
|
|
||||||
static VsCodeValidatorTestTargets get installedWithoutExtension =>
|
static VsCodeValidatorTestTargets get installedWithoutExtension =>
|
||||||
VsCodeValidatorTestTargets._(validInstall, missingExtensions);
|
VsCodeValidatorTestTargets._(validInstall, missingExtensions);
|
||||||
|
|
||||||
|
static final String validInstall = fs.path.join('test', 'data', 'vscode', 'application');
|
||||||
|
static final String validExtensions = fs.path.join('test', 'data', 'vscode', 'extensions');
|
||||||
|
static final String missingExtensions = fs.path.join('test', 'data', 'vscode', 'notExtensions');
|
||||||
}
|
}
|
||||||
|
@ -251,13 +251,13 @@ class MockFile implements File {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MockDirectory implements Directory {
|
class MockDirectory implements Directory {
|
||||||
static bool findCache = false;
|
|
||||||
|
|
||||||
MockDirectory(this.path);
|
MockDirectory(this.path);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final String path;
|
final String path;
|
||||||
|
|
||||||
|
static bool findCache = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool existsSync() => findCache && path.endsWith('.pub-cache');
|
bool existsSync() => findCache && path.endsWith('.pub-cache');
|
||||||
|
|
||||||
|
@ -424,14 +424,14 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MockVMService extends BasicMock implements VMService {
|
class MockVMService extends BasicMock implements VMService {
|
||||||
Uri _httpAddress;
|
|
||||||
HttpServer _server;
|
|
||||||
MockVM _vm;
|
|
||||||
|
|
||||||
MockVMService() {
|
MockVMService() {
|
||||||
_vm = MockVM(this);
|
_vm = MockVM(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Uri _httpAddress;
|
||||||
|
HttpServer _server;
|
||||||
|
MockVM _vm;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Uri get httpAddress => _httpAddress;
|
Uri get httpAddress => _httpAddress;
|
||||||
|
|
||||||
@ -468,14 +468,14 @@ class MockVMService extends BasicMock implements VMService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MockVM implements VM {
|
class MockVM implements VM {
|
||||||
|
MockVM(this._service);
|
||||||
|
|
||||||
final MockVMService _service;
|
final MockVMService _service;
|
||||||
final Uri _baseUri = Uri.parse('file:///tmp/devfs/test');
|
final Uri _baseUri = Uri.parse('file:///tmp/devfs/test');
|
||||||
bool _devFSExists = false;
|
bool _devFSExists = false;
|
||||||
|
|
||||||
static const int kFileSystemAlreadyExists = 1001;
|
static const int kFileSystemAlreadyExists = 1001;
|
||||||
|
|
||||||
MockVM(this._service);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Map<String, dynamic>> createDevFS(String fsName) async {
|
Future<Map<String, dynamic>> createDevFS(String fsName) async {
|
||||||
_service.messages.add('create $fsName');
|
_service.messages.add('create $fsName');
|
||||||
|
@ -39,10 +39,10 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TestDeviceManager extends DeviceManager {
|
class TestDeviceManager extends DeviceManager {
|
||||||
final List<Device> allDevices;
|
|
||||||
|
|
||||||
TestDeviceManager(this.allDevices);
|
TestDeviceManager(this.allDevices);
|
||||||
|
|
||||||
|
final List<Device> allDevices;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Stream<Device> getAllConnectedDevices() {
|
Stream<Device> getAllConnectedDevices() {
|
||||||
return Stream<Device>.fromIterable(allDevices);
|
return Stream<Device>.fromIterable(allDevices);
|
||||||
@ -50,11 +50,11 @@ class TestDeviceManager extends DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MockDevice extends Device {
|
class _MockDevice extends Device {
|
||||||
|
_MockDevice(this.name, String id) : super(id);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final String name;
|
final String name;
|
||||||
|
|
||||||
_MockDevice(this.name, String id) : super(id);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
|
void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
|
||||||
}
|
}
|
||||||
|
@ -152,10 +152,10 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TestEmulatorManager extends EmulatorManager {
|
class TestEmulatorManager extends EmulatorManager {
|
||||||
final List<Emulator> allEmulators;
|
|
||||||
|
|
||||||
TestEmulatorManager(this.allEmulators);
|
TestEmulatorManager(this.allEmulators);
|
||||||
|
|
||||||
|
final List<Emulator> allEmulators;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<Emulator>> getAllAvailableEmulators() {
|
Future<List<Emulator>> getAllAvailableEmulators() {
|
||||||
return Future<List<Emulator>>.value(allEmulators);
|
return Future<List<Emulator>>.value(allEmulators);
|
||||||
|
@ -135,10 +135,10 @@ class MockDevice extends Mock implements Device {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TestHotRunnerConfig extends HotRunnerConfig {
|
class TestHotRunnerConfig extends HotRunnerConfig {
|
||||||
bool successfulSetup;
|
|
||||||
|
|
||||||
TestHotRunnerConfig({@required this.successfulSetup});
|
TestHotRunnerConfig({@required this.successfulSetup});
|
||||||
|
|
||||||
|
bool successfulSetup;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> setupHotRestart() async {
|
Future<bool> setupHotRestart() async {
|
||||||
return successfulSetup;
|
return successfulSetup;
|
||||||
|
@ -223,9 +223,10 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MockPortForwarder extends DevicePortForwarder {
|
class MockPortForwarder extends DevicePortForwarder {
|
||||||
final int availablePort;
|
|
||||||
MockPortForwarder([this.availablePort]);
|
MockPortForwarder([this.availablePort]);
|
||||||
|
|
||||||
|
final int availablePort;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<int> forward(int devicePort, {int hostPort}) async {
|
Future<int> forward(int devicePort, {int hostPort}) async {
|
||||||
hostPort ??= 0;
|
hostPort ??= 0;
|
||||||
|
@ -308,12 +308,12 @@ class MockStdio extends Stdio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MockPollingDeviceDiscovery extends PollingDeviceDiscovery {
|
class MockPollingDeviceDiscovery extends PollingDeviceDiscovery {
|
||||||
|
MockPollingDeviceDiscovery() : super('mock');
|
||||||
|
|
||||||
final List<Device> _devices = <Device>[];
|
final List<Device> _devices = <Device>[];
|
||||||
final StreamController<Device> _onAddedController = StreamController<Device>.broadcast();
|
final StreamController<Device> _onAddedController = StreamController<Device>.broadcast();
|
||||||
final StreamController<Device> _onRemovedController = StreamController<Device>.broadcast();
|
final StreamController<Device> _onRemovedController = StreamController<Device>.broadcast();
|
||||||
|
|
||||||
MockPollingDeviceDiscovery() : super('mock');
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<Device>> pollingGetDevices() async => _devices;
|
Future<List<Device>> pollingGetDevices() async => _devices;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user