Skip to content

Commit

Permalink
Fix lint issues causing CI to fail (flutter#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
a14n authored and cbracken committed Oct 8, 2018
1 parent 53eef39 commit 581c16d
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions 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

0 comments on commit 581c16d

Please sign in to comment.