Browse Source

migrate to latest dart version.

pull/5/merge
Herbert Poul 1 year ago
parent
commit
2968ec486b
  1. 4
      CHANGELOG.md
  2. 6
      analysis_options.yaml
  3. 105
      example/pubspec.lock
  4. 2
      lib/src/crypto/key_encrypter_kdf.dart
  5. 14
      lib/src/kdbx_var_dictionary.dart
  6. 6
      pubspec.yaml

4
CHANGELOG.md

@ -1,3 +1,7 @@
## 2.4.0
- Migrate to latest dart version.
## 2.3.0 ## 2.3.0
- Mark objects only as clean when saving was successful. - Mark objects only as clean when saving was successful.

6
analysis_options.yaml

@ -4,9 +4,6 @@
include: package:flutter_lints/flutter.yaml include: package:flutter_lints/flutter.yaml
analyzer: analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors: errors:
# treat missing required parameters as a warning (not a hint) # treat missing required parameters as a warning (not a hint)
missing_required_param: warning missing_required_param: warning
@ -14,6 +11,9 @@ analyzer:
missing_return: warning missing_return: warning
# allow having TODOs in the code # allow having TODOs in the code
todo: ignore todo: ignore
language:
strict-casts: true
strict-raw-types: true
linter: linter:
rules: rules:

105
example/pubspec.lock

@ -5,105 +5,120 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: archive name: archive
url: "https://pub.dartlang.org" sha256: a92e39b291073bb840a72cf43d96d2a63c74e9a485d227833e8ea0054d16ad16
url: "https://pub.dev"
source: hosted source: hosted
version: "3.1.2" version: "3.1.2"
argon2_ffi_base: argon2_ffi_base:
dependency: transitive dependency: transitive
description: description:
name: argon2_ffi_base name: argon2_ffi_base
url: "https://pub.dartlang.org" sha256: afb48b48cb418fe632863983a54c231c097f495129d3fc9d758d17d209663977
url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0+1" version: "1.1.0+1"
args: args:
dependency: transitive dependency: transitive
description: description:
name: args name: args
url: "https://pub.dartlang.org" sha256: "3d82ff8620ec576fd38f6cec0df45a7c088b8704eb1c63d4c336392e5efca6ca"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.0" version: "2.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306
url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" sha256: "6021e0172ab6e6eaa1d391afed0a99353921f00c54385c574dc53e55d67c092c"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" sha256: "6d4193120997ecfd09acf0e313f13dc122b119e5eca87ef57a7d065ec9183762"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.15.0" version: "1.15.0"
convert: convert:
dependency: transitive dependency: transitive
description: description:
name: convert name: convert
url: "https://pub.dartlang.org" sha256: f08428ad63615f96a27e34221c65e1a451439b5f26030f78d790f461c686d65d
url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "3.0.1"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
name: crypto name: crypto
url: "https://pub.dartlang.org" sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c
url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "3.0.1"
dio: dio:
dependency: transitive dependency: transitive
description: description:
name: dio name: dio
url: "https://pub.dartlang.org" sha256: bf173c8bc66b776e3c2892b6ac56ac1a5ad73d21dd06d337f9fe656f63612947
url: "https://pub.dev"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
name: ffi name: ffi
url: "https://pub.dartlang.org" sha256: "35d0f481d939de0d640b3db9a7aa36a52cd22054a798a73b4f50bdad5ce12678"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.2" version: "1.1.2"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
url: "https://pub.dartlang.org" sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493
url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185
url: "https://pub.dev"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
intl: intl:
dependency: transitive dependency: transitive
description: description:
name: intl name: intl
url: "https://pub.dartlang.org" sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"
url: "https://pub.dev"
source: hosted source: hosted
version: "0.17.0" version: "0.17.0"
isolates: isolates:
dependency: transitive dependency: transitive
description: description:
name: isolates name: isolates
url: "https://pub.dartlang.org" sha256: ce89e4141b27b877326d3715be2dceac7a7ba89f3229785816d2d318a75ddf28
url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.3+8" version: "3.0.3+8"
js: js:
dependency: transitive dependency: transitive
description: description:
name: js name: js
url: "https://pub.dartlang.org" sha256: d9bdfd70d828eeb352390f81b18d6a354ef2044aa28ef25682079797fa7cd174
url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.3" version: "0.6.3"
kdbx: kdbx:
@ -112,132 +127,150 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "2.2.0" version: "2.3.0"
lints: lints:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
url: "https://pub.dartlang.org" sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c
url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
logging: logging:
dependency: transitive dependency: transitive
description: description:
name: logging name: logging
url: "https://pub.dartlang.org" sha256: "0520a4826042a8a5d09ddd4755623a50d37ee536d79a70452aff8c8ad7bb6c27"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
logging_appenders: logging_appenders:
dependency: transitive dependency: transitive
description: description:
name: logging_appenders name: logging_appenders
url: "https://pub.dartlang.org" sha256: "013e8548b79e3b8dc0333f3efae706184356b5926c6bea59150efa126c91598c"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.dartlang.org" sha256: "2e2c34e631f93410daa3ee3410250eadc77ac6befc02a040eda8a123f34e6f5a"
url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.11" version: "0.12.11"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" sha256: "5202fdd37b4da5fd14a237ed0a01cad6c1efd4c99b5b5a0d3c9237f3728c9485"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.7.0" version: "1.7.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.0" version: "1.8.0"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
name: petitparser name: petitparser
url: "https://pub.dartlang.org" sha256: "3abc4a0f06dccb2348ebdab9f5b9cc88bb64bfc830bed6351040ca42722044a6"
url: "https://pub.dev"
source: hosted source: hosted
version: "4.2.0" version: "4.2.0"
pointycastle: pointycastle:
dependency: transitive dependency: transitive
description: description:
name: pointycastle name: pointycastle
url: "https://pub.dartlang.org" sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c"
url: "https://pub.dev"
source: hosted source: hosted
version: "3.3.4" version: "3.7.3"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:
name: quiver name: quiver
url: "https://pub.dartlang.org" sha256: "5e592c348a6c528fb8deb7cc7d85a7097ce65bf2349121ad004d1fc5d5905eaa"
url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "3.0.1"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" sha256: d5f89a9e52b36240a80282b3dc0667dd36e53459717bb17b8fb102d30496606a
url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.1" version: "1.8.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" sha256: f8d9f247e2f9f90e32d1495ff32dac7e4ae34ffa7194c5ff8fcc0fd0e52df774
url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.10.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4
url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
supercharged_dart: supercharged_dart:
dependency: transitive dependency: transitive
description: description:
name: supercharged_dart name: supercharged_dart
url: "https://pub.dartlang.org" sha256: "9d6d4fa1736d07f0506ce2713e5f9815b20bcd741c0d53e9b56c265458c3ce05"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.0" version: "2.0.0"
synchronized: synchronized:
dependency: transitive dependency: transitive
description: description:
name: synchronized name: synchronized
url: "https://pub.dartlang.org" sha256: "271977ff1e9e82ceefb4f08424b8839f577c1852e0726b5ce855311b46d3ef83"
url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.0" version: "3.0.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830
url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
uuid: uuid:
dependency: transitive dependency: transitive
description: description:
name: uuid name: uuid
url: "https://pub.dartlang.org" sha256: "0ea20bfc625477e17f08a92d112272a071609b275ce4ca10ad853e1426ca3758"
url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.4" version: "3.0.4"
xml: xml:
dependency: transitive dependency: transitive
description: description:
name: xml name: xml
url: "https://pub.dartlang.org" sha256: "925e1d7923773fef2f90c5c9ad0f496630f63e03f974a0aaa5fb50c60640c570"
url: "https://pub.dev"
source: hosted source: hosted
version: "5.2.0" version: "5.2.0"
sdks: sdks:
dart: ">=2.13.0 <3.0.0" dart: ">=2.14.0 <4.0.0"

2
lib/src/crypto/key_encrypter_kdf.dart

@ -17,7 +17,7 @@ enum KdfType {
Aes, Aes,
} }
class KdfField<T> { class KdfField<T extends Object> {
KdfField(this.field, this.type); KdfField(this.field, this.type);
final String field; final String field;

14
lib/src/kdbx_var_dictionary.dart

@ -20,37 +20,37 @@ class ValueType<T> {
final Decoder<T> decoder; final Decoder<T> decoder;
final Encoder<T>? encoder; final Encoder<T>? encoder;
static final typeUInt32 = ValueType( static final typeUInt32 = ValueType<int>(
0x04, 0x04,
(reader, _) => reader.readUint32(), (reader, _) => reader.readUint32(),
(writer, value) => writer.writeUint32(value, writer._lengthWriter()), (writer, value) => writer.writeUint32(value, writer._lengthWriter()),
); );
static final typeUInt64 = ValueType( static final typeUInt64 = ValueType<int>(
0x05, 0x05,
(reader, _) => reader.readUint64(), (reader, _) => reader.readUint64(),
(writer, value) => writer.writeUint64(value, writer._lengthWriter()), (writer, value) => writer.writeUint64(value, writer._lengthWriter()),
); );
static final typeBool = ValueType( static final typeBool = ValueType<bool>(
0x08, 0x08,
(reader, _) => reader.readUint8() != 0, (reader, _) => reader.readUint8() != 0,
(writer, value) => writer.writeUint8(value ? 1 : 0, writer._lengthWriter()), (writer, value) => writer.writeUint8(value ? 1 : 0, writer._lengthWriter()),
); );
static final typeInt32 = ValueType( static final typeInt32 = ValueType<int>(
0x0C, 0x0C,
(reader, _) => reader.readInt32(), (reader, _) => reader.readInt32(),
(writer, value) => writer.writeInt32(value, writer._lengthWriter()), (writer, value) => writer.writeInt32(value, writer._lengthWriter()),
); );
static final typeInt64 = ValueType( static final typeInt64 = ValueType<int>(
0x0D, 0x0D,
(reader, _) => reader.readInt64(), (reader, _) => reader.readInt64(),
(writer, value) => writer.writeInt64(value, writer._lengthWriter()), (writer, value) => writer.writeInt64(value, writer._lengthWriter()),
); );
static final typeString = ValueType( static final typeString = ValueType<String>(
0x18, 0x18,
(reader, length) => reader.readString(length), (reader, length) => reader.readString(length),
(writer, value) => writer.writeString(value, writer._lengthWriter()), (writer, value) => writer.writeString(value, writer._lengthWriter()),
); );
static final typeBytes = ValueType( static final typeBytes = ValueType<Uint8List>(
0x42, 0x42,
(reader, length) => reader.readBytes(length), (reader, length) => reader.readBytes(length),
(writer, value) => writer.writeBytes(value, writer._lengthWriter()), (writer, value) => writer.writeBytes(value, writer._lengthWriter()),

6
pubspec.yaml

@ -1,15 +1,15 @@
name: kdbx name: kdbx
description: KeepassX format implementation in pure dart. (kdbx 3.x and 4.x support). description: KeepassX format implementation in pure dart. (kdbx 3.x and 4.x support).
version: 2.3.0 version: 2.4.0
homepage: https://github.com/authpass/kdbx.dart homepage: https://github.com/authpass/kdbx.dart
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <4.0.0'
dependencies: dependencies:
logging: '>=0.11.3+2 <2.0.0' logging: '>=0.11.3+2 <2.0.0'
crypto: '>=2.0.0 <4.0.0' crypto: '>=2.0.0 <4.0.0'
pointycastle: '>=3.0.0 <4.0.0' pointycastle: '>=3.4.0 <4.0.0'
xml: '>=4.4.0 <7.0.0' xml: '>=4.4.0 <7.0.0'
uuid: ">=3.0.0 <5.0.0" uuid: ">=3.0.0 <5.0.0"
meta: '>=1.0.0 <2.0.0' meta: '>=1.0.0 <2.0.0'

Loading…
Cancel
Save