Skip to content

Commit

Permalink
chore: update linting rules and apply them
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed Oct 28, 2024
1 parent 159ad69 commit 8e49fbc
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 21 deletions.
27 changes: 25 additions & 2 deletions clipboard_viewer/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
include: package:flutter_lints/flutter.yaml

analyzer:

linter:
rules:
prefer_single_quotes: true
require_trailing_commas: true
always_declare_return_types: true
avoid_catches_without_on_clauses: true
avoid_equals_and_hash_code_on_mutable_classes: true
avoid_types_on_closure_parameters: true
cancel_subscriptions: true
directives_ordering: true
eol_at_end_of_file: true
omit_local_variable_types: true
prefer_asserts_in_initializer_lists: true
prefer_const_constructors: true
prefer_final_in_for_each: true
prefer_final_locals: true
prefer_null_aware_method_calls: true
prefer_null_aware_operators: true
sort_constructors_first: true
sort_unnamed_constructors_first: true
sort_pub_dependencies: true
type_annotate_public_apis: true
unawaited_futures: true
unnecessary_lambdas: true
unnecessary_parenthesis: true
use_named_constants: true
use_super_parameters: true
7 changes: 4 additions & 3 deletions clipboard_viewer/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:pasteboard/pasteboard.dart';
import 'package:super_clipboard/super_clipboard.dart';
// ignore: implementation_imports
import 'package:super_clipboard/src/format_conversions.dart';
import 'package:super_clipboard/super_clipboard.dart';

void main() {
runApp(const MyApp());
Expand Down Expand Up @@ -54,13 +54,14 @@ class _MyHomePageState extends State<MyHomePage> {
return ListTile(
title: SelectableText(item.$2.toString()),
subtitle: SelectableText(
item.$1.platformFormats.map((e) => "'$e'").join(", ")),
item.$1.platformFormats.map((e) => "'$e'").join(', '),
),
);
},
),
floatingActionButton: FloatingActionButton(
onPressed: () async {
await Pasteboard.writeFiles(["/home/davide"]);
await Pasteboard.writeFiles(['/home/davide']);
return;
// TODO(@HrX03) is this needed?
// ignore: unused_local_variable, dead_code
Expand Down
18 changes: 5 additions & 13 deletions clipboard_viewer/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
name: clipboard_viewer
description: A new Flutter project.
publish_to: 'none'
publish_to: "none"
version: 1.0.0+1

environment:
sdk: '>=3.0.0-313.0.dev <4.0.0'
sdk: ">=3.0.0-313.0.dev <4.0.0"

dependencies:
cupertino_icons: ^1.0.2
flutter:
sdk: flutter

cupertino_icons: ^1.0.2
pasteboard: ^0.2.0
super_clipboard: ^0.2.3
super_native_extensions: ^0.2.3
pasteboard: ^0.2.0

dev_dependencies:
flutter_lints: ^2.0.0
flutter_test:
sdk: flutter

flutter_lints: ^2.0.0


flutter:
uses-material-design: true





5 changes: 2 additions & 3 deletions clipboard_viewer/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'package:clipboard_viewer/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:clipboard_viewer/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
testWidgets('Counter increments smoke test', (tester) async {
await tester.pumpWidget(const MyApp());

expect(find.text('0'), findsOneWidget);
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version: 1.0.0+1

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.24.3"

dependencies:
collection: ^1.16.0
Expand Down

0 comments on commit 8e49fbc

Please sign in to comment.