Skip to content

Commit

Permalink
adding analysys_options
Browse files Browse the repository at this point in the history
  • Loading branch information
GJJ2019 committed Jul 7, 2022
1 parent 3ae69e5 commit e615f52
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 46 deletions.
14 changes: 11 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
include: package:flutter_lints/flutter.yaml
include: package:lint/analysis_options.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

analyzer:
exclude:
- "**.g.dart"

linter:
rules:
prefer_relative_imports: true
always_use_package_imports: false
sort_pub_dependencies: false
33 changes: 8 additions & 25 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
include: package:lint/analysis_options.yaml

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

analyzer:
exclude:
- "**.g.dart"

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
prefer_relative_imports: true
always_use_package_imports: false
sort_pub_dependencies: false
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _MyAppState extends State<MyApp> {
),
);

print(transactionDetail.toString());
log(transactionDetail.toString());
} on PlatformException catch (e) {
log('exception is $e');
} finally {
Expand Down
15 changes: 4 additions & 11 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,18 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
lints:
dependency: transitive
lint:
dependency: "direct dev"
description:
name: lints
name: lint
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "1.8.2"
matcher:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.0
lint: ^1.8.2

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down
6 changes: 2 additions & 4 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:easy_upi_payment_example/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:easy_upi_payment_example/main.dart';

void main() {
testWidgets('Verify Platform version', (WidgetTester tester) async {
// Build our app and trigger a frame.
Expand All @@ -18,8 +17,7 @@ void main() {
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Text &&
widget.data!.startsWith('Running on:'),
(Widget widget) => widget is Text && widget.data!.startsWith('Running on:'),
),
findsOneWidget,
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
lint: ^1.8.2

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down

0 comments on commit e615f52

Please sign in to comment.