Skip to content

Commit 9483b89

Browse files
author
Bentaimia Haddadi
committed
make package null safe
1 parent dd2545a commit 9483b89

File tree

8 files changed

+86
-91
lines changed

8 files changed

+86
-91
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## [0.0.2]
2+
-
13
## [0.0.1] - TODO: Add release date.
24

35
* TODO: Describe initial release.

android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

-23
This file was deleted.

android/local.properties

-3
This file was deleted.

lib/byte_data_wrapper.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
library byte_data_wrapper;
22

3-
export 'package:byte_data_wrapper/src/byte_data.dart';
3+
export './src/byte_data.dart';

lib/src/byte_data.dart

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ class ByteDataWrapper {
55
int _writeOffset = 0;
66
ByteData byteBuffer;
77

8-
ByteDataWrapper(int numBytes) {
9-
this.byteBuffer = ByteData(numBytes);
10-
}
8+
ByteDataWrapper({required int numBytes}) : this.byteBuffer = ByteData(numBytes);
119

12-
static ByteDataWrapper view(ByteBuffer buffer,
13-
[int offsetInBytes = 0, int length]) {
14-
final byteDataWrapper = ByteDataWrapper(0)
15-
..byteBuffer = ByteData.view(buffer, offsetInBytes, length);
10+
static ByteDataWrapper view(ByteBuffer buffer, [int offsetInBytes = 0, int length = 0]) {
11+
final byteDataWrapper = ByteDataWrapper(numBytes: 0)..byteBuffer = ByteData.view(buffer, offsetInBytes, length);
1612
return byteDataWrapper;
1713
}
1814

pubspec.lock

+77-52
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,54 @@
11
# Generated by pub
2-
# See https://www.dartlang.org/tools/pub/glossary#lockfile
2+
# See https://dart.dev/tools/pub/glossary#lockfile
33
packages:
44
async:
55
dependency: transitive
66
description:
77
name: async
8-
url: "https://pub.dartlang.org"
8+
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
9+
url: "https://pub.dev"
910
source: hosted
10-
version: "2.1.0"
11+
version: "2.11.0"
1112
boolean_selector:
1213
dependency: transitive
1314
description:
1415
name: boolean_selector
15-
url: "https://pub.dartlang.org"
16+
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
17+
url: "https://pub.dev"
1618
source: hosted
17-
version: "1.0.4"
18-
charcode:
19+
version: "2.1.1"
20+
characters:
1921
dependency: transitive
2022
description:
21-
name: charcode
22-
url: "https://pub.dartlang.org"
23+
name: characters
24+
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
25+
url: "https://pub.dev"
2326
source: hosted
24-
version: "1.1.2"
27+
version: "1.3.0"
28+
clock:
29+
dependency: transitive
30+
description:
31+
name: clock
32+
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
33+
url: "https://pub.dev"
34+
source: hosted
35+
version: "1.1.1"
2536
collection:
2637
dependency: transitive
2738
description:
2839
name: collection
29-
url: "https://pub.dartlang.org"
40+
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
41+
url: "https://pub.dev"
42+
source: hosted
43+
version: "1.17.2"
44+
fake_async:
45+
dependency: transitive
46+
description:
47+
name: fake_async
48+
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
49+
url: "https://pub.dev"
3050
source: hosted
31-
version: "1.14.11"
51+
version: "1.3.1"
3252
flutter:
3353
dependency: "direct main"
3454
description: flutter
@@ -43,37 +63,34 @@ packages:
4363
dependency: transitive
4464
description:
4565
name: matcher
46-
url: "https://pub.dartlang.org"
66+
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
67+
url: "https://pub.dev"
4768
source: hosted
48-
version: "0.12.5"
69+
version: "0.12.16"
70+
material_color_utilities:
71+
dependency: transitive
72+
description:
73+
name: material_color_utilities
74+
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
75+
url: "https://pub.dev"
76+
source: hosted
77+
version: "0.5.0"
4978
meta:
5079
dependency: transitive
5180
description:
5281
name: meta
53-
url: "https://pub.dartlang.org"
82+
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
83+
url: "https://pub.dev"
5484
source: hosted
55-
version: "1.1.6"
85+
version: "1.9.1"
5686
path:
5787
dependency: transitive
5888
description:
5989
name: path
60-
url: "https://pub.dartlang.org"
90+
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
91+
url: "https://pub.dev"
6192
source: hosted
62-
version: "1.6.2"
63-
pedantic:
64-
dependency: transitive
65-
description:
66-
name: pedantic
67-
url: "https://pub.dartlang.org"
68-
source: hosted
69-
version: "1.5.0"
70-
quiver:
71-
dependency: transitive
72-
description:
73-
name: quiver
74-
url: "https://pub.dartlang.org"
75-
source: hosted
76-
version: "2.0.2"
93+
version: "1.8.3"
7794
sky_engine:
7895
dependency: transitive
7996
description: flutter
@@ -83,57 +100,65 @@ packages:
83100
dependency: transitive
84101
description:
85102
name: source_span
86-
url: "https://pub.dartlang.org"
103+
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
104+
url: "https://pub.dev"
87105
source: hosted
88-
version: "1.5.5"
106+
version: "1.10.0"
89107
stack_trace:
90108
dependency: transitive
91109
description:
92110
name: stack_trace
93-
url: "https://pub.dartlang.org"
111+
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
112+
url: "https://pub.dev"
94113
source: hosted
95-
version: "1.9.3"
114+
version: "1.11.0"
96115
stream_channel:
97116
dependency: transitive
98117
description:
99118
name: stream_channel
100-
url: "https://pub.dartlang.org"
119+
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
120+
url: "https://pub.dev"
101121
source: hosted
102-
version: "2.0.0"
122+
version: "2.1.1"
103123
string_scanner:
104124
dependency: transitive
105125
description:
106126
name: string_scanner
107-
url: "https://pub.dartlang.org"
127+
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
128+
url: "https://pub.dev"
108129
source: hosted
109-
version: "1.0.4"
130+
version: "1.2.0"
110131
term_glyph:
111132
dependency: transitive
112133
description:
113134
name: term_glyph
114-
url: "https://pub.dartlang.org"
135+
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
136+
url: "https://pub.dev"
115137
source: hosted
116-
version: "1.1.0"
138+
version: "1.2.1"
117139
test_api:
118140
dependency: transitive
119141
description:
120142
name: test_api
121-
url: "https://pub.dartlang.org"
143+
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
144+
url: "https://pub.dev"
122145
source: hosted
123-
version: "0.2.4"
124-
typed_data:
146+
version: "0.6.0"
147+
vector_math:
125148
dependency: transitive
126149
description:
127-
name: typed_data
128-
url: "https://pub.dartlang.org"
150+
name: vector_math
151+
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
152+
url: "https://pub.dev"
129153
source: hosted
130-
version: "1.1.6"
131-
vector_math:
154+
version: "2.1.4"
155+
web:
132156
dependency: transitive
133157
description:
134-
name: vector_math
135-
url: "https://pub.dartlang.org"
158+
name: web
159+
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
160+
url: "https://pub.dev"
136161
source: hosted
137-
version: "2.0.8"
162+
version: "0.1.4-beta"
138163
sdks:
139-
dart: ">=2.2.0 <3.0.0"
164+
dart: ">=3.1.0-185.0.dev <4.0.0"

pubspec.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
name: byte_data_wrapper
22
description: A new Flutter package project.
3-
version: 0.0.1
4-
author: Taym Haddadi <[email protected]>
3+
version: 0.0.2
54
homepage: https://github.com/Taym95/byte_data_wrapper
65

76
environment:
8-
sdk: ">=2.0.0-dev.68.0 <3.0.0"
7+
sdk: '>=3.0.0 <4.0.0'
98

109
dependencies:
1110
flutter:

test/byte_data_wrapper_test.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import 'package:byte_data_wrapper/src/byte_data.dart';
44

55
void main() {
66
test('Write to byte buffer and increase writeOffset counter', () {
7-
final byteDataWrapper = ByteDataWrapper(5);
7+
final byteDataWrapper = ByteDataWrapper(numBytes: 5);
88
byteDataWrapper.setUint8(1);
99
byteDataWrapper.setUint16(8);
1010
expect(byteDataWrapper.length, 5);
1111
expect(byteDataWrapper.writeOffset, 3);
1212
});
1313

14-
1514
test('Read from byte buffer and increase readOffset counter', () {
1615
final bytes = Uint8List.fromList([14, 0, 2, 197, 105, 0, 0]);
1716
final byteDataWrapper = ByteDataWrapper.view(bytes.buffer, 0, bytes.length);

0 commit comments

Comments
 (0)