Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ linter:
- leading_newlines_in_multiline_strings
- library_names
- library_prefixes
- library_private_types_in_public_api
# - lines_longer_than_80_chars # not required by flutter style
- list_remove_unrelated_type
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
Expand Down Expand Up @@ -197,7 +198,7 @@ linter:
- recursive_getters
# - sized_box_for_whitespace # not yet tested
- slash_for_doc_comments
# - sort_child_properties_last # not yet tested
- sort_child_properties_last
- sort_constructors_first
- sort_unnamed_constructors_first
- test_types_in_equals
Expand Down Expand Up @@ -229,7 +230,7 @@ linter:
- use_full_hex_values_for_flutter_colors
# - use_function_type_syntax_for_parameters # not yet tested
- use_is_even_rather_than_modulo
# - use_key_in_widget_constructors # not yet tested
- use_key_in_widget_constructors
- use_late_for_private_fields_and_variables
- use_raw_strings
- use_rethrow_when_possible
Expand Down
4 changes: 3 additions & 1 deletion packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## NEXT
## 0.9.4+22

* Removes unnecessary imports.
* Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors
Comment thread
asashour marked this conversation as resolved.
lint warnings

## 0.9.4+21

Expand Down
6 changes: 4 additions & 2 deletions packages/camera/camera/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

cameras = await availableCameras();
runApp(CameraApp());
runApp(const CameraApp());
}

class CameraApp extends StatefulWidget {
const CameraApp({Key? key}) : super(key: key);

@override
_CameraAppState createState() => _CameraAppState();
State<CameraApp> createState() => _CameraAppState();
}

class _CameraAppState extends State<CameraApp> {
Expand Down
40 changes: 22 additions & 18 deletions packages/camera/camera/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import 'package:flutter/scheduler.dart';
import 'package:video_player/video_player.dart';

class CameraExampleHome extends StatefulWidget {
const CameraExampleHome({Key? key}) : super(key: key);

@override
_CameraExampleHomeState createState() {
State<CameraExampleHome> createState() {
return _CameraExampleHomeState();
}
}
Expand Down Expand Up @@ -134,12 +136,6 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
children: <Widget>[
Expanded(
child: Container(
child: Padding(
padding: const EdgeInsets.all(1.0),
child: Center(
child: _cameraPreviewWidget(),
),
),
decoration: BoxDecoration(
color: Colors.black,
border: Border.all(
Expand All @@ -150,6 +146,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
width: 3.0,
),
),
child: Padding(
padding: const EdgeInsets.all(1.0),
child: Center(
child: _cameraPreviewWidget(),
),
),
),
),
_captureControlRowWidget(),
Expand Down Expand Up @@ -233,6 +235,8 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
Container()
else
SizedBox(
width: 64.0,
height: 64.0,
child: (localVideoController == null)
? (
// The captured image on the web contains a network-accessible URL
Expand All @@ -243,6 +247,8 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
? Image.network(imageFile!.path)
: Image.file(File(imageFile!.path)))
: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.pink)),
child: Center(
child: AspectRatio(
aspectRatio:
Expand All @@ -251,11 +257,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
: 1.0,
child: VideoPlayer(localVideoController)),
),
decoration: BoxDecoration(
border: Border.all(color: Colors.pink)),
),
width: 64.0,
height: 64.0,
),
],
),
Expand Down Expand Up @@ -394,7 +396,6 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
mainAxisSize: MainAxisSize.max,
children: <Widget>[
TextButton(
child: const Text('AUTO'),
style: styleAuto,
onPressed: controller != null
? () =>
Expand All @@ -406,21 +407,22 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
showInSnackBar('Resetting exposure point');
}
},
child: const Text('AUTO'),
),
TextButton(
child: const Text('LOCKED'),
style: styleLocked,
onPressed: controller != null
? () =>
onSetExposureModeButtonPressed(ExposureMode.locked)
: null,
child: const Text('LOCKED'),
),
TextButton(
child: const Text('RESET OFFSET'),
style: styleLocked,
onPressed: controller != null
? () => controller!.setExposureOffset(0.0)
: null,
child: const Text('RESET OFFSET'),
),
],
),
Expand Down Expand Up @@ -479,7 +481,6 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
mainAxisSize: MainAxisSize.max,
children: <Widget>[
TextButton(
child: const Text('AUTO'),
style: styleAuto,
onPressed: controller != null
? () => onSetFocusModeButtonPressed(FocusMode.auto)
Expand All @@ -490,13 +491,14 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
}
showInSnackBar('Resetting focus point');
},
child: const Text('AUTO'),
),
TextButton(
child: const Text('LOCKED'),
style: styleLocked,
onPressed: controller != null
? () => onSetFocusModeButtonPressed(FocusMode.locked)
: null,
child: const Text('LOCKED'),
),
],
),
Expand Down Expand Up @@ -1020,9 +1022,11 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
}

class CameraApp extends StatelessWidget {
const CameraApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
return const MaterialApp(
home: CameraExampleHome(),
);
}
Expand All @@ -1038,7 +1042,7 @@ Future<void> main() async {
} on CameraException catch (e) {
logError(e.code, e.description);
}
runApp(CameraApp());
runApp(const CameraApp());
}

/// This allows a value of type T or T? to be treated as a value of type T?.
Expand Down
6 changes: 4 additions & 2 deletions packages/camera/camera/example/lib/readme_full_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

cameras = await availableCameras();
runApp(CameraApp());
runApp(const CameraApp());
}

class CameraApp extends StatefulWidget {
const CameraApp({Key? key}) : super(key: key);

@override
_CameraAppState createState() => _CameraAppState();
State<CameraApp> createState() => _CameraAppState();
}

class _CameraAppState extends State<CameraApp> {
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera/example/test/main_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Test snackbar', (WidgetTester tester) async {
WidgetsFlutterBinding.ensureInitialized();
await tester.pumpWidget(CameraApp());
await tester.pumpWidget(const CameraApp());
await tester.pumpAndSettle();
expect(find.byType(SnackBar), findsOneWidget);
});
Expand Down
3 changes: 2 additions & 1 deletion packages/camera/camera/lib/src/camera_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import 'package:flutter/services.dart';
/// A widget showing a live camera preview.
class CameraPreview extends StatelessWidget {
/// Creates a preview widget for the given camera controller.
const CameraPreview(this.controller, {this.child});
const CameraPreview(this.controller, {Key? key, this.child})
: super(key: key);

/// The controller for the camera that the preview is shown for.
final CameraController controller;
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A Flutter plugin for controlling the camera. Supports previewing
Dart.
repository: https://github.com/flutter/plugins/tree/main/packages/camera/camera
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.9.4+21
version: 0.9.4+22

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down
5 changes: 5 additions & 0 deletions packages/camera/camera_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.2.1+5

* Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors
lint warnings

## 0.2.1+4

* Migrates from `ui.hash*` to `Object.hash*`.
Expand Down
6 changes: 5 additions & 1 deletion packages/camera/camera_web/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: public_member_api_docs
Comment thread
asashour marked this conversation as resolved.
Outdated

import 'package:flutter/material.dart';

void main() => runApp(MyApp());
void main() => runApp(const MyApp());

/// App for testing
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return const Directionality(
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_web
description: A Flutter plugin for getting information about and controlling the camera on Web.
repository: https://github.com/flutter/plugins/tree/main/packages/camera/camera_web
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.2.1+4
version: 0.2.1+5

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
4 changes: 3 additions & 1 deletion packages/camera/camera_windows/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## NEXT
## 0.1.1
Comment thread
asashour marked this conversation as resolved.
Outdated

* Removes unnecessary imports.
* Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors
lint warnings

## 0.1.0

Expand Down
6 changes: 5 additions & 1 deletion packages/camera/camera_windows/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: public_member_api_docs
Comment thread
asashour marked this conversation as resolved.
Outdated

import 'dart:async';

import 'package:camera_platform_interface/camera_platform_interface.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

/// Example app for Camera Windows plugin.
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);

@override
State<MyApp> createState() => _MyAppState();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_windows/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: camera_windows
description: A Flutter plugin for getting information about and controlling the camera on Windows.
version: 0.1.0
version: 0.1.1
repository: https://github.com/flutter/plugins/tree/master/packages/camera/camera_windows
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22

Expand Down
7 changes: 6 additions & 1 deletion packages/espresso/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## 0.2.0+2

* Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors
lint warnings

## 0.2.0+1

* Adds OS version support information to README.
* Updates `androidx.test.ext:junit` and `androidx.test.ext:truth` for
compatibilty with updated Flutter template.
compatibility with updated Flutter template.

## 0.2.0

Expand Down
8 changes: 6 additions & 2 deletions packages/espresso/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: public_member_api_docs

import 'package:flutter/material.dart';

void main() => runApp(MyApp());
void main() => runApp(const MyApp());

/// Example app for Espresso plugin.
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -45,7 +49,7 @@ class _MyHomePage extends StatefulWidget {
final String title;

@override
_MyHomePageState createState() => _MyHomePageState();
State<_MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<_MyHomePage> {
Expand Down
2 changes: 1 addition & 1 deletion packages/espresso/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Java classes for testing Flutter apps using Espresso.
Allows driving Flutter widgets from a native Espresso test.
repository: https://github.com/flutter/plugins/tree/main/packages/espresso
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+espresso%22
version: 0.2.0+1
version: 0.2.0+2

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
4 changes: 3 additions & 1 deletion packages/file_selector/file_selector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## NEXT
## 0.8.4+2

* Removes unnecessary imports.
* Adds OS version support information to README.
* Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors
lint warnings

## 0.8.4+1

Expand Down
Loading