Skip to content

🐛 Fix invalid linter #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
includes: package:flutter_lints/flutter.yaml
include: package:flutter_lints/flutter.yaml

linter:
rules:
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void main() {
}

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

@override
Widget build(BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import '../widgets/method_list_view.dart';
import '../widgets/selected_assets_view.dart';

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

@override
State<HomePage> createState() => _MyHomePageState();
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '../main.dart';
import 'home_page.dart';

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

@override
State<SplashPage> createState() => _SplashPageState();
Expand Down
4 changes: 2 additions & 2 deletions example/lib/widgets/asset_widget_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import 'package:wechat_camera_picker/wechat_camera_picker.dart';

class AssetWidgetBuilder extends StatelessWidget {
const AssetWidgetBuilder({
Key? key,
super.key,
required this.entity,
required this.isDisplayingDetail,
}) : super(key: key);
});

final AssetEntity entity;
final bool isDisplayingDetail;
Expand Down
4 changes: 2 additions & 2 deletions example/lib/widgets/method_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import '../models/picker_method.dart';

class MethodListView extends StatefulWidget {
const MethodListView({
Key? key,
super.key,
required this.pickMethods,
required this.onSelectMethod,
}) : super(key: key);
});

final List<PickMethod> pickMethods;
final void Function(PickMethod method) onSelectMethod;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/widgets/preview_asset_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:video_player/video_player.dart';
import 'package:wechat_camera_picker/wechat_camera_picker.dart';

class PreviewAssetWidget extends StatefulWidget {
const PreviewAssetWidget(this.asset, {Key? key}) : super(key: key);
const PreviewAssetWidget(this.asset, {super.key});

final AssetEntity asset;

Expand Down
4 changes: 2 additions & 2 deletions example/lib/widgets/selected_assets_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import 'preview_asset_widget.dart';

class SelectedAssetView extends StatelessWidget {
const SelectedAssetView({
Key? key,
super.key,
required this.asset,
required this.isDisplayingDetail,
required this.onRemoveAsset,
}) : super(key: key);
});

final AssetEntity asset;
final ValueNotifier<bool> isDisplayingDetail;
Expand Down
3 changes: 3 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ dependencies:
package_info_plus: ^4.0.0
video_player: ^2.7.0

dev_dependencies:
flutter_lints: any

flutter:
uses-material-design: true
assets:
Expand Down
3 changes: 2 additions & 1 deletion lib/src/states/camera_picker_viewer_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ class CameraPickerViewerState extends State<CameraPickerViewer> {
}

class _WechatLoading extends StatefulWidget {
const _WechatLoading({Key? key, required this.tip}) : super(key: key);
// ignore: unused_element
const _WechatLoading({super.key, required this.tip});

final String tip;

Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/builder/tween_animation_builder_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import 'package:flutter/material.dart';

class TweenAnimationBuilder2<A, B> extends StatelessWidget {
const TweenAnimationBuilder2({
Key? key,
super.key,
required this.firstTween,
required this.secondTween,
required this.builder,
this.firstTweenDuration = kThemeAnimationDuration,
this.secondTweenDuration = kThemeAnimationDuration,
this.firstTweenCurve = Curves.linear,
this.secondTweenCurve = Curves.linear,
}) : super(key: key);
});

final Tween<A> firstTween;
final Tween<B> secondTween;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/camera_focus_point.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import 'builder/tween_animation_builder_2.dart';

class CameraFocusPoint extends StatelessWidget {
const CameraFocusPoint({
Key? key,
super.key,
required this.size,
required this.color,
}) : super(key: key);
});

final double size;
final Color color;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/camera_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import 'camera_picker_page_route.dart';
/// 该选择器可以通过 [CameraController] 创建 [AssetEntity]。
class CameraPicker extends StatefulWidget {
const CameraPicker({
Key? key,
super.key,
this.pickerConfig = const CameraPickerConfig(),
this.createPickerState,
this.locale,
}) : super(key: key);
});

/// {@macro wechat_camera_picker.CameraPickerConfig}
final CameraPickerConfig pickerConfig;
Expand Down
9 changes: 3 additions & 6 deletions lib/src/widgets/camera_picker_page_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ class CameraPickerPageRoute<T> extends PageRoute<T> {
this.maintainState = true,
this.opaque = true,
this.canTransitionFromPredicate,
bool fullscreenDialog = false,
RouteSettings? settings,
}) : super(
settings: settings,
fullscreenDialog: fullscreenDialog,
);
super.fullscreenDialog,
super.settings,
});

final WidgetBuilder builder;

Expand Down
5 changes: 3 additions & 2 deletions lib/src/widgets/camera_picker_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ import '../states/camera_picker_viewer_state.dart';

class CameraPickerViewer extends StatefulWidget {
const CameraPickerViewer._({
Key? key,
// ignore: unused_element
super.key,
required this.viewType,
required this.previewXFile,
required this.pickerConfig,
this.createViewerState,
}) : super(key: key);
});

/// The type of the viewer. (Image | Video)
/// 预览的类型(图片或视频)
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/camera_progress_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import '../internals/methods.dart';

class CameraProgressButton extends StatefulWidget {
const CameraProgressButton({
Key? key,
super.key,
required this.isAnimating,
required this.outerRadius,
required this.ringsWidth,
this.ringsColor = wechatThemeColor,
this.progress = 0.0,
this.duration = const Duration(seconds: 15),
}) : super(key: key);
});

final bool isAnimating;
final double outerRadius;
Expand Down