Skip to content

Commit b719a16

Browse files
committed
Dart 3.8.0
1 parent 52dc70f commit b719a16

File tree

6 files changed

+34
-39
lines changed

6 files changed

+34
-39
lines changed

bin/generate_bindings.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,13 @@ class Parameter {
9494
Parameter(this.declaration) {
9595
final match = _paramRegExp.matchAsPrefix(declaration)!;
9696
type = Type(match.group(1)!.trim());
97-
name =
98-
match
99-
.group(2)!
100-
.trim()
101-
.split('_')
102-
.map((value) => value.toUpperCaseFirstCharacter())
103-
.join()
104-
.toLowerCaseFirstCharacter();
97+
name = match
98+
.group(2)!
99+
.trim()
100+
.split('_')
101+
.map((value) => value.toUpperCaseFirstCharacter())
102+
.join()
103+
.toLowerCaseFirstCharacter();
105104
}
106105

107106
final String declaration;

example/test.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ class UnderRunAnalyzer implements Analyzer {
4444
}
4545

4646
@override
47-
String toString() =>
48-
lostSamples > 0
49-
? 'Lost $lostSamples (${100 * lostSamples / seenSamples}%) in '
50-
'$seenSamples samples in buffer '
51-
'${lostSamplesPerBuffer.keys.join(', ')}.'
52-
: 'Lost no samples in $seenSamples samples.';
47+
String toString() => lostSamples > 0
48+
? 'Lost $lostSamples (${100 * lostSamples / seenSamples}%) in '
49+
'$seenSamples samples in buffer '
50+
'${lostSamplesPerBuffer.keys.join(', ')}.'
51+
: 'Lost no samples in $seenSamples samples.';
5352
}
5453

5554
class SampleAnalyzer implements Analyzer {

lib/src/ffi/library.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ Set<String> _defaultLibraryNames() {
4747
DynamicLibrary loadLibrary() {
4848
for (final path in libraryPaths) {
4949
for (final name in libraryNames) {
50-
final fullName =
51-
path.isEmpty ? name : '$path${Platform.pathSeparator}$name';
50+
final fullName = path.isEmpty
51+
? name
52+
: '$path${Platform.pathSeparator}$name';
5253
try {
5354
return DynamicLibrary.open(fullName);
5455
} on ArgumentError {

lib/src/generated/lazy_bindings.dart

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ class LazyBindings implements AbstractBindings {
1515
final DynamicLibrary _library;
1616

1717
@override
18-
int getDeviceCount() =>
19-
(_getDeviceCount ??= _library
20-
.lookupFunction<NativeGetDeviceCount, DartGetDeviceCount>(
21-
'rtlsdr_get_device_count',
22-
))();
18+
int getDeviceCount() => (_getDeviceCount ??= _library
19+
.lookupFunction<NativeGetDeviceCount, DartGetDeviceCount>(
20+
'rtlsdr_get_device_count',
21+
))();
2322
DartGetDeviceCount? _getDeviceCount;
2423

2524
@override
@@ -108,12 +107,9 @@ class LazyBindings implements AbstractBindings {
108107
int offset,
109108
int len,
110109
) => (_readEeprom ??= _library
111-
.lookupFunction<NativeReadEeprom, DartReadEeprom>('rtlsdr_read_eeprom'))(
112-
dev,
113-
data,
114-
offset,
115-
len,
116-
);
110+
.lookupFunction<NativeReadEeprom, DartReadEeprom>(
111+
'rtlsdr_read_eeprom',
112+
))(dev, data, offset, len);
117113
DartReadEeprom? _readEeprom;
118114

119115
@override
@@ -221,10 +217,9 @@ class LazyBindings implements AbstractBindings {
221217

222218
@override
223219
int setAgcMode(Pointer<DeviceHandle> dev, int on) => (_setAgcMode ??= _library
224-
.lookupFunction<NativeSetAgcMode, DartSetAgcMode>('rtlsdr_set_agc_mode'))(
225-
dev,
226-
on,
227-
);
220+
.lookupFunction<NativeSetAgcMode, DartSetAgcMode>(
221+
'rtlsdr_set_agc_mode',
222+
))(dev, on);
228223
DartSetAgcMode? _setAgcMode;
229224

230225
@override
@@ -303,9 +298,8 @@ class LazyBindings implements AbstractBindings {
303298

304299
@override
305300
int setBiasTee(Pointer<DeviceHandle> dev, int on) => (_setBiasTee ??= _library
306-
.lookupFunction<NativeSetBiasTee, DartSetBiasTee>('rtlsdr_set_bias_tee'))(
307-
dev,
308-
on,
309-
);
301+
.lookupFunction<NativeSetBiasTee, DartSetBiasTee>(
302+
'rtlsdr_set_bias_tee',
303+
))(dev, on);
310304
DartSetBiasTee? _setBiasTee;
311305
}

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ topics:
88
- ffi
99

1010
environment:
11-
sdk: ^3.7.0
11+
sdk: ^3.8.0
1212
dependencies:
1313
characters: ^1.3.0
1414
ffi: ^2.1.0
1515
meta: ^1.16.0
1616
more: ^4.3.0
1717
dev_dependencies:
18-
lints: ^5.0.0
18+
lints: ^6.0.0
1919
test: ^1.25.0

test/rtlsdr_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ void main() {
151151
test('toDiff', () async {
152152
final input1 = Int16List.fromList([-81, 42, -21, 124]);
153153
final input2 = Int16List.fromList([66, 102, -88, -93]);
154-
final output =
155-
await Stream.fromIterable([input1, input2]).toDiff().toList();
154+
final output = await Stream.fromIterable([
155+
input1,
156+
input2,
157+
]).toDiff().toList();
156158
expect(output, [
157159
[-81, 123, -63, 145],
158160
[-58, 36, -190, -5],

0 commit comments

Comments
 (0)