Skip to content

Commit

Permalink
Modernize codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
timsneath committed Apr 29, 2023
1 parent c590f8e commit f142c77
Show file tree
Hide file tree
Showing 15 changed files with 161 additions and 94 deletions.
19 changes: 15 additions & 4 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
include: package:lints/recommended.yaml

analyzer:
language:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true

linter:
rules:
# Some additional lints we want to enforce
always_declare_return_types: true
avoid_type_to_string: true
cascade_invocations: true
comment_references: true
discarded_futures: true
directives_ordering: true
invalid_case_patterns: true
leading_newlines_in_multiline_strings: true
literal_only_boolean_expressions: true
no_default_cases: true
omit_local_variable_types: true
prefer_const_constructors: true
prefer_const_literals_to_create_immutables: true
prefer_expression_function_bodies: true
prefer_final_in_for_each: true
prefer_final_locals: true
prefer_interpolation_to_compose_strings: true
prefer_relative_imports: true
sort_child_properties_last: true
sort_unnamed_constructors_first: true
test_types_in_equals: true
unawaited_futures: true
unnecessary_lambdas: true
unnecessary_null_aware_assignments: true
unnecessary_parenthesis: true
use_super_parameters: true
unnecessary_statements: true
use_super_parameters: true
19 changes: 15 additions & 4 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
include: package:lints/recommended.yaml

analyzer:
language:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true

linter:
rules:
# Some additional lints we want to enforce
always_declare_return_types: true
avoid_type_to_string: true
cascade_invocations: true
comment_references: true
discarded_futures: true
directives_ordering: true
invalid_case_patterns: true
leading_newlines_in_multiline_strings: true
literal_only_boolean_expressions: true
no_default_cases: true
omit_local_variable_types: true
prefer_const_constructors: true
prefer_const_literals_to_create_immutables: true
prefer_expression_function_bodies: true
prefer_final_in_for_each: true
prefer_final_locals: true
prefer_interpolation_to_compose_strings: true
prefer_relative_imports: true
sort_child_properties_last: true
sort_unnamed_constructors_first: true
test_types_in_equals: true
unawaited_futures: true
unnecessary_lambdas: true
unnecessary_null_aware_assignments: true
unnecessary_parenthesis: true
use_super_parameters: true
unnecessary_statements: true
use_super_parameters: true
19 changes: 11 additions & 8 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,32 @@ packages:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "2.0.1"
filepicker_windows:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "2.0.2"
version: "2.0.3"
lints:
dependency: "direct dev"
description:
name: lints
url: "https://pub.dartlang.org"
sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "2.1.0"
win32:
dependency: "direct main"
description:
name: win32
url: "https://pub.dartlang.org"
sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4
url: "https://pub.dev"
source: hosted
version: "2.7.0"
version: "3.1.4"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=3.0.0-417 <4.0.0"
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
filepicker_windows:
path: ../
win32: ^2.3.8
win32: ^3.0.0

dev_dependencies:
lints: ^2.0.0
lints: ^2.1.0
17 changes: 14 additions & 3 deletions example/wallpaper/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:lints/recommended.yaml
include: package:flutter_lints/flutter.yaml

analyzer:
language:
Expand All @@ -8,19 +8,30 @@ analyzer:

linter:
rules:
# Some additional lints we want to enforce
always_declare_return_types: true
avoid_type_to_string: true
cascade_invocations: true
comment_references: true
discarded_futures: true
directives_ordering: true
invalid_case_patterns: true
leading_newlines_in_multiline_strings: true
literal_only_boolean_expressions: true
no_default_cases: true
omit_local_variable_types: true
prefer_const_constructors: true
prefer_const_literals_to_create_immutables: true
prefer_expression_function_bodies: true
prefer_final_in_for_each: true
prefer_final_locals: true
prefer_interpolation_to_compose_strings: true
prefer_relative_imports: true
sort_child_properties_last: true
sort_unnamed_constructors_first: true
test_types_in_equals: true
unawaited_futures: true
unnecessary_lambdas: true
unnecessary_null_aware_assignments: true
unnecessary_parenthesis: true
use_super_parameters: true
unnecessary_statements: true
use_super_parameters: true
8 changes: 6 additions & 2 deletions example/wallpaper/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ import 'package:flutter/material.dart';

import 'wallpaper.dart';

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

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

@override
Widget build(BuildContext context) => MaterialApp(home: HomePage());
Widget build(BuildContext context) => const MaterialApp(home: HomePage());
}

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

@override
State<HomePage> createState() => _HomePageState();
}
Expand Down
2 changes: 1 addition & 1 deletion example/wallpaper/lib/wallpaper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Wallpaper {
final wallpaper = DesktopWallpaper.createInstance();

final pathPtr = TEXT(wallpaperFile.path);
wallpaper.SetWallpaper(nullptr, pathPtr);
wallpaper.setWallpaper(nullptr, pathPtr);
if (FAILED(hr)) throw WindowsException(hr);

free(pathPtr);
Expand Down
62 changes: 43 additions & 19 deletions example/wallpaper/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,78 @@ packages:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.3.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.17.1"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "2.0.1"
filepicker_windows:
dependency: "direct main"
description:
path: "../.."
relative: true
source: path
version: "2.0.2"
version: "2.0.3"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
lints:
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
url: "https://pub.dev"
source: hosted
version: "2.0.1"
js:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.7"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "2.1.0"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.dev"
source: hosted
version: "0.1.5"
version: "0.2.0"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.9.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -64,15 +86,17 @@ packages:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.4"
win32:
dependency: "direct main"
description:
name: win32
url: "https://pub.dartlang.org"
sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4
url: "https://pub.dev"
source: hosted
version: "2.7.0"
version: "3.1.4"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=3.0.0-417 <4.0.0"
4 changes: 2 additions & 2 deletions example/wallpaper/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ dependencies:
flutter:
sdk: flutter

win32: ^2.3.8
win32: ^3.0.0

flutter:
uses-material-design: true

dev_dependencies:
lints: ^2.0.0
flutter_lints: ^2.0.1
Loading

0 comments on commit f142c77

Please sign in to comment.