Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
a14n committed Oct 8, 2018
1 parent 96a3a5a commit 2f56505
Show file tree
Hide file tree
Showing 43 changed files with 394 additions and 381 deletions.
4 changes: 2 additions & 2 deletions packages/android_alarm_manager/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Future<Null> ensureFirebaseUser() async {
}

class HelloMessage {
HelloMessage(this._now, this._msg, this._isolate, this._user, this._token);

final DateTime _now;
final String _msg;
final int _isolate;
final FirebaseUser _user;
final String _token;

HelloMessage(this._now, this._msg, this._isolate, this._user, this._token);

@override
String toString() {
return "[$_now] $_msg "
Expand Down
4 changes: 2 additions & 2 deletions packages/android_intent/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ class MyHomePage extends StatelessWidget {
}

class ExplicitIntentsWidget extends StatelessWidget {
static const String routeName = "/explicitIntents";

const ExplicitIntentsWidget();

static const String routeName = "/explicitIntents";

void _openGoogleMapsStreetView() {
final AndroidIntent intent = AndroidIntent(
action: 'action_view',
Expand Down
16 changes: 8 additions & 8 deletions packages/android_intent/lib/android_intent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ const String kChannelName = 'plugins.flutter.io/android_intent';

/// Flutter plugin for launching arbitrary Android Intents.
class AndroidIntent {
final String action;
final String category;
final String data;
final Map<String, dynamic> arguments;
final String package;
final MethodChannel _channel;
final Platform _platform;

/// Builds an Android intent with the following parameters
/// [action] refers to the action parameter of the intent.
/// [category] refers to the category of the intent, can be null.
Expand All @@ -38,6 +30,14 @@ class AndroidIntent {
_channel = const MethodChannel(kChannelName),
_platform = platform ?? const LocalPlatform();

final String action;
final String category;
final String data;
final Map<String, dynamic> arguments;
final String package;
final MethodChannel _channel;
final Platform _platform;

/// Launch the intent.
///
/// This works only on Android platforms. Please guard the call so that your
Expand Down
46 changes: 23 additions & 23 deletions packages/camera/lib/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ Future<List<CameraDescription>> availableCameras() async {
}

class CameraDescription {
CameraDescription({this.name, this.lensDirection});

final String name;
final CameraLensDirection lensDirection;

CameraDescription({this.name, this.lensDirection});

@override
bool operator ==(Object o) {
return o is CameraDescription &&
Expand All @@ -79,21 +79,21 @@ class CameraDescription {

/// This is thrown when the plugin reports an error.
class CameraException implements Exception {
CameraException(this.code, this.description);

String code;
String description;

CameraException(this.code, this.description);

@override
String toString() => '$runtimeType($code, $description)';
}

// Build the UI texture view of the video data with textureId.
class CameraPreview extends StatelessWidget {
final CameraController controller;

const CameraPreview(this.controller);

final CameraController controller;

@override
Widget build(BuildContext context) {
return controller.value.isInitialized
Expand All @@ -104,6 +104,20 @@ class CameraPreview extends StatelessWidget {

/// The state of a [CameraController].
class CameraValue {
const CameraValue({
this.isInitialized,
this.errorDescription,
this.previewSize,
this.isRecordingVideo,
this.isTakingPicture,
});

const CameraValue.uninitialized()
: this(
isInitialized: false,
isRecordingVideo: false,
isTakingPicture: false);

/// True after [CameraController.initialize] has completed successfully.
final bool isInitialized;

Expand All @@ -120,20 +134,6 @@ class CameraValue {
/// Is `null` until [isInitialized] is `true`.
final Size previewSize;

const CameraValue({
this.isInitialized,
this.errorDescription,
this.previewSize,
this.isRecordingVideo,
this.isTakingPicture,
});

const CameraValue.uninitialized()
: this(
isInitialized: false,
isRecordingVideo: false,
isTakingPicture: false);

/// Convenience getter for `previewSize.height / previewSize.width`.
///
/// Can only be called when [initialize] is done.
Expand Down Expand Up @@ -176,6 +176,9 @@ class CameraValue {
///
/// To show the camera preview on the screen use a [CameraPreview] widget.
class CameraController extends ValueNotifier<CameraValue> {
CameraController(this.description, this.resolutionPreset)
: super(const CameraValue.uninitialized());

final CameraDescription description;
final ResolutionPreset resolutionPreset;

Expand All @@ -184,9 +187,6 @@ class CameraController extends ValueNotifier<CameraValue> {
StreamSubscription<dynamic> _eventSubscription;
Completer<Null> _creatingCompleter;

CameraController(this.description, this.resolutionPreset)
: super(const CameraValue.uninitialized());

/// Initializes the camera on the device.
///
/// Throws a [CameraException] if the initialization fails.
Expand Down
3 changes: 2 additions & 1 deletion packages/cloud_firestore/lib/src/blob.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
part of cloud_firestore;

class Blob {
final Uint8List bytes;
const Blob(this.bytes);

final Uint8List bytes;

@override
bool operator ==(dynamic other) =>
other is Blob &&
Expand Down
4 changes: 2 additions & 2 deletions packages/cloud_firestore/lib/src/field_value.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ enum FieldValueType { arrayUnion, arrayRemove, delete, serverTimestamp }
/// Sentinel values that can be used when writing document fields with set() or
/// update().
class FieldValue {
FieldValue._(this.type, this.value);

final FieldValueType type;
final dynamic value;

FieldValue._(this.type, this.value);

/// Returns a special value that tells the server to union the given elements
/// with any array value that already exists on the server.
///
Expand Down
38 changes: 19 additions & 19 deletions packages/cloud_firestore/lib/src/firestore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,7 @@ part of cloud_firestore;
///
/// You can get an instance by calling [Firestore.instance].
class Firestore {
@visibleForTesting
static const MethodChannel channel = MethodChannel(
'plugins.flutter.io/cloud_firestore',
StandardMethodCodec(FirestoreMessageCodec()),
);

static final Map<int, StreamController<QuerySnapshot>> _queryObservers =
<int, StreamController<QuerySnapshot>>{};

static final Map<int, StreamController<DocumentSnapshot>> _documentObservers =
<int, StreamController<DocumentSnapshot>>{};

static final Map<int, TransactionHandler> _transactionHandlers =
<int, TransactionHandler>{};
static int _transactionHandlerId = 0;

static bool _initialized = false;

Firestore({FirebaseApp app}) : this.app = app ?? FirebaseApp.instance {
Firestore({FirebaseApp app}) : app = app ?? FirebaseApp.instance {
if (_initialized) return;
channel.setMethodCallHandler((MethodCall call) async {
if (call.method == 'QuerySnapshot') {
Expand Down Expand Up @@ -57,6 +39,24 @@ class Firestore {
/// If null, the default [FirebaseApp] is used.
final FirebaseApp app;

static bool _initialized = false;

@visibleForTesting
static const MethodChannel channel = MethodChannel(
'plugins.flutter.io/cloud_firestore',
StandardMethodCodec(FirestoreMessageCodec()),
);

static final Map<int, StreamController<QuerySnapshot>> _queryObservers =
<int, StreamController<QuerySnapshot>>{};

static final Map<int, StreamController<DocumentSnapshot>> _documentObservers =
<int, StreamController<DocumentSnapshot>>{};

static final Map<int, TransactionHandler> _transactionHandlers =
<int, TransactionHandler>{};
static int _transactionHandlerId = 0;

@override
bool operator ==(dynamic o) => o is Firestore && o.app == app;

Expand Down
3 changes: 2 additions & 1 deletion packages/cloud_firestore/lib/src/geo_point.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
part of cloud_firestore;

class GeoPoint {
const GeoPoint(this.latitude, this.longitude);

final double latitude;
final double longitude;
const GeoPoint(this.latitude, this.longitude);

@override
bool operator ==(dynamic o) =>
Expand Down
18 changes: 9 additions & 9 deletions packages/cloud_firestore/lib/src/query_snapshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ part of cloud_firestore;

/// A QuerySnapshot contains zero or more DocumentSnapshot objects.
class QuerySnapshot {
/// Gets a list of all the documents included in this snapshot
final List<DocumentSnapshot> documents;

/// An array of the documents that changed since the last snapshot. If this
/// is the first snapshot, all documents will be in the list as Added changes.
final List<DocumentChange> documentChanges;

final Firestore _firestore;

QuerySnapshot._(Map<dynamic, dynamic> data, this._firestore)
: documents = List<DocumentSnapshot>.generate(data['documents'].length,
(int index) {
Expand All @@ -31,4 +22,13 @@ class QuerySnapshot {
_firestore,
);
});

/// Gets a list of all the documents included in this snapshot
final List<DocumentSnapshot> documents;

/// An array of the documents that changed since the last snapshot. If this
/// is the first snapshot, all documents will be in the list as Added changes.
final List<DocumentChange> documentChanges;

final Firestore _firestore;
}
4 changes: 2 additions & 2 deletions packages/cloud_firestore/lib/src/snapshot_metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ part of cloud_firestore;

/// Metadata about a snapshot, describing the state of the snapshot.
class SnapshotMetadata {
SnapshotMetadata._(this.hasPendingWrites, this.isFromCache);

/// Whether the snapshot contains the result of local writes that have not yet
/// been committed to the backend.
///
Expand All @@ -23,6 +25,4 @@ class SnapshotMetadata {
/// snapshot with `isFomCache` equal to `false` once the client has received
/// up-to-date data from the backend.
final bool isFromCache;

SnapshotMetadata._(this.hasPendingWrites, this.isFromCache);
}
6 changes: 3 additions & 3 deletions packages/cloud_firestore/lib/src/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ part of cloud_firestore;
typedef Future<dynamic> TransactionHandler(Transaction transaction);

class Transaction {
int _transactionId;
Firestore _firestore;

@visibleForTesting
Transaction(this._transactionId, this._firestore);

int _transactionId;
Firestore _firestore;

Future<DocumentSnapshot> get(DocumentReference documentReference) async {
final dynamic result = await Firestore.channel
.invokeMethod('Transaction#get', <String, dynamic>{
Expand Down
4 changes: 2 additions & 2 deletions packages/cloud_functions/lib/cloud_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import 'package:flutter/services.dart';
import 'package:meta/meta.dart';

class CloudFunctionsException implements Exception {
CloudFunctionsException._(this.code, this.message, this.details);

final String code;
final String message;
final dynamic details;

CloudFunctionsException._(this.code, this.message, this.details);
}

/// The entry point for accessing a CloudFunctions.
Expand Down
4 changes: 2 additions & 2 deletions packages/device_info/lib/device_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import 'package:flutter/services.dart';

/// Provides device and operating system information.
class DeviceInfoPlugin {
DeviceInfoPlugin();

/// Channel used to communicate to native code.
static const MethodChannel channel =
MethodChannel('plugins.flutter.io/device_info');

DeviceInfoPlugin();

/// This information does not change from call to call. Cache it.
AndroidDeviceInfo _cachedAndroidDeviceInfo;

Expand Down
Loading

0 comments on commit 2f56505

Please sign in to comment.