Skip to content

Commit

Permalink
Merge pull request #2 from Nolence/main
Browse files Browse the repository at this point in the history
Upgrade analysis options and remove warnings
  • Loading branch information
saytoonz authored Aug 17, 2022
2 parents d05b540 + c13ebac commit 4a9ba13
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 85 deletions.
36 changes: 36 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
include: package:flutter_lints/flutter.yaml

analyzer:
errors:
todo: ignore
strong-mode:
implicit-casts: false
implicit-dynamic: false

linter:
rules:
camel_case_types: true
require_trailing_commas: true
avoid_positional_boolean_parameters: false
avoid_print: true
always_declare_return_types: true
prefer_is_empty: true
prefer_is_not_empty: true
avoid_empty_else: true
avoid_type_to_string: true
close_sinks: true
control_flow_in_finally: true
empty_statements: true
throw_in_finally: true
unawaited_futures: true
unnecessary_await_in_return: true
avoid_shadowing_type_parameters: true
parameter_assignments: true
only_throw_errors: true
always_use_package_imports: true
avoid_dynamic_calls: true
prefer_void_to_null: true
unnecessary_lambdas: true
unnecessary_const: true
avoid_void_async: true
lines_longer_than_80_chars: true
36 changes: 36 additions & 0 deletions example/analysis_options copy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
include: package:flutter_lints/flutter.yaml

analyzer:
errors:
todo: ignore
strong-mode:
implicit-casts: false
implicit-dynamic: false

linter:
rules:
camel_case_types: true
require_trailing_commas: true
avoid_positional_boolean_parameters: false
avoid_print: true
always_declare_return_types: true
prefer_is_empty: true
prefer_is_not_empty: true
avoid_empty_else: true
avoid_type_to_string: true
close_sinks: true
control_flow_in_finally: true
empty_statements: true
throw_in_finally: true
unawaited_futures: true
unnecessary_await_in_return: true
avoid_shadowing_type_parameters: true
parameter_assignments: true
only_throw_errors: true
always_use_package_imports: true
avoid_dynamic_calls: true
prefer_void_to_null: true
unnecessary_lambdas: true
unnecessary_const: true
avoid_void_async: true
lines_longer_than_80_chars: true
10 changes: 4 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
theme: ThemeData(primarySwatch: Colors.blue),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
Expand All @@ -26,7 +24,7 @@ class MyHomePage extends StatefulWidget {
final String title;

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

class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
Expand All @@ -37,14 +35,14 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
controller1 = FlutterGifController(vsync: this);
controller2 = FlutterGifController(vsync: this);
controller4 = FlutterGifController(vsync: this);
WidgetsBinding.instance?.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) {
controller1.repeat(
min: 0,
max: 53,
period: const Duration(milliseconds: 200),
);
});
WidgetsBinding.instance?.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) {
controller2.repeat(
min: 0,
max: 13,
Expand Down
27 changes: 10 additions & 17 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
cupertino_icons:
dependency: "direct main"
description:
Expand All @@ -56,7 +56,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -75,7 +75,7 @@ packages:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "2.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -87,7 +87,7 @@ packages:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "2.0.0"
matcher:
dependency: transitive
description:
Expand All @@ -101,7 +101,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: transitive
description:
Expand All @@ -115,7 +115,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -127,7 +127,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -162,21 +162,14 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "0.4.9"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.16.1 <3.0.0"
dart: ">=2.17.1 <3.0.0"
flutter: ">=2.5.0"
11 changes: 4 additions & 7 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,30 @@ environment:
dependencies:
flutter:
sdk: flutter

cupertino_icons: ^1.0.4

flutter_gif:
path: ../
path: ../

dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0


flutter_lints: ^2.0.0

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

# The following section is specific to Flutter.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true

# To add assets to your application, add an assets section, like this:
assets:
- images/animate.gif
- images/animate.gif
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
Expand Down
8 changes: 8 additions & 0 deletions example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)

set(PLUGIN_BUNDLED_LIBRARIES)

foreach(plugin ${FLUTTER_PLUGIN_LIST})
Expand All @@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)

foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
Loading

0 comments on commit 4a9ba13

Please sign in to comment.