Skip to content

Commit

Permalink
Update win32 dependency and lints
Browse files Browse the repository at this point in the history
  • Loading branch information
timsneath committed Dec 5, 2021
1 parent 2baf9e5 commit f5d33da
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 115 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 2.0.0-nullsafety.0
## 2.0.1

- Upgrade win32 dependency

## 2.0.0

- Enable sound null safety

Expand Down
14 changes: 1 addition & 13 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:lint/analysis_options_package.yaml
include: package:lints/recommended.yaml

analyzer:
strong-mode:
Expand All @@ -7,27 +7,15 @@ analyzer:

linter:
rules:
# redundancy is good if it leads to better documentation
avoid_redundant_argument_values: false

# print is useful for examples
avoid_print: false

# disable for now per https://github.com/timsneath/win32/issues/87
avoid_private_typedef_functions: false

# win32 parity requires SCREAMING_CAPS constants
constant_identifier_names: false

# deliberately name generated files after their COM equivalents
file_names: false

# seems to trigger false positives
invariant_booleans: false

# while(true) is useful for Win32 enumerations
literal_only_boolean_expressions: false

# doesn't make sense if adjacent strings are not human language
missing_whitespace_between_adjacent_strings: false

Expand Down
17 changes: 1 addition & 16 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:lint/analysis_options_package.yaml
include: package:lints/recommended.yaml

analyzer:
strong-mode:
Expand All @@ -7,36 +7,21 @@ analyzer:

linter:
rules:
# redundancy is good if it leads to better documentation
avoid_redundant_argument_values: false

# print is useful for examples
avoid_print: false

# disable for now per https://github.com/timsneath/win32/issues/87
avoid_private_typedef_functions: false

# win32 parity requires SCREAMING_CAPS constants
constant_identifier_names: false

# deliberately name generated files after their COM equivalents
file_names: false

# seems to trigger false positives
invariant_booleans: false

# while(true) is useful for Win32 enumerations
literal_only_boolean_expressions: false

# doesn't make sense if adjacent strings are not human language
missing_whitespace_between_adjacent_strings: false

# Win32 parity requires TitleCase method names
non_constant_identifier_names: false

# Not compatible with sound null safety
use_key_in_widget_constructors: false

# Some additional lints we want to enforce
omit_local_variable_types: true
prefer_expression_function_bodies: true
Expand Down
14 changes: 7 additions & 7 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ packages:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.2"
filepicker_windows:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "2.0.0"
lint:
version: "2.0.1"
lints:
dependency: "direct dev"
description:
name: lint
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.3"
version: "1.0.1"
win32:
dependency: "direct main"
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.3.1"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.14.0 <3.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.0.1
win32: ^2.3.1

dev_dependencies:
lint: ^1.5.3
lints: ^1.0.1
16 changes: 0 additions & 16 deletions example/wallpaper/README.md

This file was deleted.

17 changes: 1 addition & 16 deletions example/wallpaper/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:lint/analysis_options_package.yaml
include: package:lints/recommended.yaml

analyzer:
strong-mode:
Expand All @@ -7,36 +7,21 @@ analyzer:

linter:
rules:
# redundancy is good if it leads to better documentation
avoid_redundant_argument_values: false

# print is useful for examples
avoid_print: false

# disable for now per https://github.com/timsneath/win32/issues/87
avoid_private_typedef_functions: false

# win32 parity requires SCREAMING_CAPS constants
constant_identifier_names: false

# deliberately name generated files after their COM equivalents
file_names: false

# seems to trigger false positives
invariant_booleans: false

# while(true) is useful for Win32 enumerations
literal_only_boolean_expressions: false

# doesn't make sense if adjacent strings are not human language
missing_whitespace_between_adjacent_strings: false

# Win32 parity requires TitleCase method names
non_constant_identifier_names: false

# Not compatible with sound null safety
use_key_in_widget_constructors: false

# Some additional lints we want to enforce
omit_local_variable_types: true
prefer_expression_function_bodies: true
Expand Down
2 changes: 1 addition & 1 deletion example/wallpaper/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:filepicker_windows/filepicker_windows.dart' as picker;
import 'package:flutter/material.dart';

import 'wallpaper.dart';

Expand Down
27 changes: 17 additions & 10 deletions example/wallpaper/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
collection:
dependency: transitive
description:
Expand All @@ -21,33 +21,40 @@ packages:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.2"
filepicker_windows:
dependency: "direct main"
description:
path: "../.."
relative: true
source: path
version: "2.0.0"
version: "2.0.1"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
lint:
lints:
dependency: "direct dev"
description:
name: lint
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.3"
version: "1.0.1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -66,13 +73,13 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.3.1"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.14.0 <3.0.0"
2 changes: 1 addition & 1 deletion example/wallpaper/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ flutter:
uses-material-design: true

dev_dependencies:
lint: ^1.5.3
lints: ^1.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

#include "generated_plugin_registrant.h"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_

Expand Down
19 changes: 0 additions & 19 deletions filepicker_windows.iml

This file was deleted.

4 changes: 3 additions & 1 deletion lib/src/directorydialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class DirectoryPicker extends FileDialog {
late String path;

var hr = CoInitializeEx(
nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
nullptr,
COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE,
);
if (FAILED(hr)) throw WindowsException(hr);

final dialog = FileOpenDialog.createInstance();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/filedialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ abstract class FileDialog {
final knownFolderManager = KnownFolderManager.createInstance();
final publicMusicFolder = calloc<GUID>()..ref.setGUID(folderGUID);

final ppkf = calloc<Pointer>();
final ppkf = calloc<Pointer<COMObject>>();
hr = knownFolderManager.GetFolder(publicMusicFolder, ppkf);
if (FAILED(hr)) throw WindowsException(hr);
final knownFolder = IKnownFolder(ppkf.cast());
Expand Down
2 changes: 1 addition & 1 deletion lib/src/opendialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class OpenFilePicker extends FileDialog {
throw WindowsException(hr);
}
} else {
final ppsi = calloc<Pointer>();
final ppsi = calloc<Pointer<COMObject>>();
hr = fileDialog.GetResult(ppsi);
if (FAILED(hr)) throw WindowsException(hr);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/savedialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SaveFilePicker extends FileDialog {
throw WindowsException(hr);
}
} else {
final ppsi = calloc<Pointer>();
final ppsi = calloc<Pointer<COMObject>>();
hr = fileDialog.GetResult(ppsi);
if (!SUCCEEDED(hr)) throw WindowsException(hr);

Expand Down
12 changes: 6 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ packages:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
lint:
version: "1.1.2"
lints:
dependency: "direct dev"
description:
name: lint
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.3"
version: "1.0.1"
win32:
dependency: "direct main"
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.3.1"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.14.0 <3.0.0"
Loading

0 comments on commit f5d33da

Please sign in to comment.