Skip to content

Commit db56a26

Browse files
authored
Upgrade hive_flutter to v1.1.0 (#700)
* Fixed linter warnings * Updated CI script for tests * Update hive_generator tests and dart-channel matrix * Add missing working-directory * Install flutter for hive_flutter tests * Replace flutter_test with test and fix test CI * flutter .. * Replace pub test with flutter test * hive_flutter/CHANGELOG.md modified
1 parent f370eaa commit db56a26

File tree

10 files changed

+66
-47
lines changed

10 files changed

+66
-47
lines changed

.github/workflows/test.yml

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,56 @@ jobs:
88
strategy:
99
matrix:
1010
test-platform: [vm, chrome]
11-
dart-channel: [unstable]
11+
dart-channel: ["2.12.0", "2.13.0"]
1212
steps:
13-
- uses: actions/checkout@v1
14-
- name: Install Dart
15-
run: |
16-
sudo apt-get update
17-
sudo apt-get install apt-transport-https
18-
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
19-
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_${{ matrix.dart-channel }}.list > /etc/apt/sources.list.d/dart_${{ matrix.dart-channel }}.list'
20-
sudo apt-get update
21-
sudo apt-get install dart
22-
- name: Run tests
23-
run: |
24-
export PATH="$PATH:/usr/lib/dart/bin"
25-
pub get
26-
pub run test -p ${{ matrix.test-platform }}
27-
working-directory: hive
13+
- uses: actions/checkout@v1
14+
- uses: dart-lang/setup-dart@v1
15+
with:
16+
sdk: ${{ matrix.dart-channel }}
17+
- name: Install dependencies
18+
run: pub get
19+
working-directory: hive
20+
- name: Run tests
21+
run: pub run test -p ${{ matrix.test-platform }}
22+
working-directory: hive
23+
24+
test-hive-flutter:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
flutter-channel: [dev, beta, stable]
29+
steps:
30+
- uses: actions/checkout@v1
31+
- uses: actions/setup-java@v1
32+
with:
33+
java-version: "12.x"
34+
- uses: subosito/flutter-action@v1
35+
with:
36+
flutter-version: ${{ matrix.dart-channel }}
37+
- name: Install dependencies
38+
run: flutter pub get
39+
working-directory: hive_flutter
40+
- name: Run tests
41+
run: flutter test
42+
working-directory: hive_flutter
2843

2944
test-hive_generator:
3045
runs-on: ubuntu-latest
3146
strategy:
3247
matrix:
33-
dart-channel: [unstable]
48+
dart-channel: ["2.12.0", "2.13.0"]
3449
steps:
35-
- uses: actions/checkout@v1
36-
- name: Install Dart
37-
run: |
38-
sudo apt-get update
39-
sudo apt-get install apt-transport-https
40-
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
41-
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_${{ matrix.dart-channel }}.list > /etc/apt/sources.list.d/dart_${{ matrix.dart-channel }}.list'
42-
sudo apt-get update
43-
sudo apt-get install dart
44-
- name: Generate build_runner output
45-
run: |
46-
export PATH="$PATH:/usr/lib/dart/bin"
47-
pub get
48-
pub run build_runner build --delete-conflicting-outputs
49-
working-directory: hive_generator/example
50-
50+
- uses: actions/checkout@v1
51+
- uses: dart-lang/setup-dart@v1
52+
with:
53+
sdk: ${{ matrix.dart-channel }}
54+
- name: Install dependencies
55+
run: pub get
56+
working-directory: hive_generator/example
57+
- name: Generate build_runner output
58+
run: pub run build_runner build --delete-conflicting-outputs
59+
working-directory: hive_generator/example
60+
5161
check-score:
5262
runs-on: ubuntu-latest
5363
strategy:

hive_flutter/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.1.0
2+
3+
- Exports `Color` and `TimeOfDay` adapters - [#698](https://github.com/hivedb/hive/pull/698)
4+
- Fixed null safety score fail - [#698](https://github.com/hivedb/hive/pull/698)
5+
- Fixed minor linter warnings
6+
- Replaced `package:pedantic` with `package:linter`
7+
- Exports `package:hive/hive.dart`
8+
19
## 1.0.0
210

311
- Stable null-safety version

hive_flutter/analysis_options.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include: package:pedantic/analysis_options.yaml
1+
include: package:lints/recommended.yaml
22
analyzer:
33
exclude:
44
- "**/*.g.dart"
@@ -7,7 +7,7 @@ analyzer:
77
implicit-casts: false
88
errors:
99
invalid_use_of_protected_member: error
10-
always_declare_return_types: error
10+
always_declare_return_types: error
1111
linter:
1212
rules:
1313
- always_declare_return_types
@@ -77,4 +77,4 @@ linter:
7777
- unnecessary_this
7878
- unrelated_type_equality_checks
7979
- use_rethrow_when_possible
80-
- valid_regexps
80+
- valid_regexps

hive_flutter/lib/adapters.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
library hive_flutter_adapters;
2+
13
import 'package:flutter/material.dart' show Color, TimeOfDay;
24
import 'package:hive/hive.dart' show TypeAdapter, BinaryReader, BinaryWriter;
35

hive_flutter/lib/src/adapters/color_adapter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
part of '../../adapters.dart';
1+
part of hive_flutter_adapters;
22

33
class ColorAdapter extends TypeAdapter<Color> {
44
@override

hive_flutter/lib/src/adapters/time_adapter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
part of '../../adapters.dart';
1+
part of hive_flutter_adapters;
22

33
class TimeOfDayAdapter extends TypeAdapter<TimeOfDay> {
44
@override

hive_flutter/lib/src/watch_box_builder.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
part of hive_flutter;
22

33
/// Signature for a function that builds a widget given a [Box].
4-
@deprecated
4+
@Deprecated('Use [ValueListenableBuilder] and `box.listenable()` instead')
55
typedef BoxWidgetBuilder<T> = Widget Function(BuildContext context, Box<T> box);
66

77
/// A general-purpose widget which rebuilds itself when the box or a specific
88
/// key change.
99
///
1010
/// Deprecated: Use [ValueListenableBuilder] and `box.listenable()` instead
11-
@deprecated
11+
@Deprecated('Use [ValueListenableBuilder] and `box.listenable()` instead')
1212
class WatchBoxBuilder extends StatefulWidget {
1313
/// Creates a widget that rebuilds itself when a value in the [box] changes.
1414
///
@@ -34,7 +34,7 @@ class WatchBoxBuilder extends StatefulWidget {
3434
_WatchBoxBuilderState createState() => _WatchBoxBuilderState();
3535
}
3636

37-
// ignore: deprecated_member_use
37+
@Deprecated('Use [ValueListenableBuilder] and `box.listenable()` instead')
3838
class _WatchBoxBuilderState extends State<WatchBoxBuilder> {
3939
@visibleForTesting
4040
StreamSubscription? subscription;

hive_flutter/pubspec.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: hive_flutter
22
description: Extension for Hive. Makes it easier to use Hive in Flutter apps.
3-
version: 1.0.1
3+
version: 1.1.0
44
homepage: https://github.com/hivedb/hive/tree/master/hive_flutter
55
documentation: https://docs.hivedb.dev/
66

@@ -16,8 +16,7 @@ dependencies:
1616
path: ^1.8.0
1717

1818
dev_dependencies:
19-
flutter_test:
20-
sdk: flutter
21-
pedantic: ^1.11.1
19+
test: ^1.15.7
20+
lints: ^1.0.1
2221
mockito: ^5.0.10
2322
build_runner: ^2.0.4

hive_flutter/test/adapters/color_adapter_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'dart:ui' show Color;
22

3-
import 'package:flutter_test/flutter_test.dart';
3+
import 'package:test/test.dart';
44
import 'package:hive/hive.dart';
55
import 'package:hive_flutter/adapters.dart';
66
import 'package:mockito/mockito.dart';

hive_flutter/test/adapters/time_adapter_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:flutter/material.dart' show TimeOfDay;
2-
import 'package:flutter_test/flutter_test.dart';
2+
import 'package:test/test.dart';
33
import 'package:hive/hive.dart';
44
import 'package:hive_flutter/adapters.dart';
55
import 'package:mockito/mockito.dart';

0 commit comments

Comments
 (0)