@@ -22,7 +22,7 @@ class Sane {
2222 }) {
2323 final completer = Completer <int >();
2424
25- authCallbackAdapter (
25+ void authCallbackAdapter (
2626 SANE_String_Const resource,
2727 ffi.Pointer <SANE_Char > username,
2828 ffi.Pointer <SANE_Char > password,
@@ -79,7 +79,7 @@ class Sane {
7979
8080 Future <List <SaneDevice >> getDevices ({
8181 required bool localOnly,
82- }) async {
82+ }) {
8383 final completer = Completer <List <SaneDevice >>();
8484
8585 Future (() {
@@ -107,7 +107,7 @@ class Sane {
107107 return completer.future;
108108 }
109109
110- Future <SaneHandle > open (String deviceName) async {
110+ Future <SaneHandle > open (String deviceName) {
111111 final completer = Completer <SaneHandle >();
112112
113113 Future (() {
@@ -132,7 +132,7 @@ class Sane {
132132 return completer.future;
133133 }
134134
135- Future <SaneHandle > openDevice (SaneDevice device) async {
135+ Future <SaneHandle > openDevice (SaneDevice device) {
136136 return open (device.name);
137137 }
138138
@@ -231,7 +231,7 @@ class Sane {
231231 valuePointer = ffi.nullptr;
232232
233233 case SaneOptionValueType .group:
234- throw SaneInvalidDataException ();
234+ throw const SaneInvalidDataException ();
235235 }
236236
237237 if (action == SaneAction .setValue) {
@@ -267,7 +267,7 @@ class Sane {
267267
268268 invalid:
269269 default :
270- throw SaneInvalidDataException ();
270+ throw const SaneInvalidDataException ();
271271 }
272272 }
273273
@@ -287,7 +287,8 @@ class Sane {
287287 switch (optionType) {
288288 case SaneOptionValueType .bool :
289289 result = dartBoolFromSaneBool (
290- (valuePointer as ffi.Pointer <SANE_Bool >).value);
290+ (valuePointer as ffi.Pointer <SANE_Bool >).value,
291+ );
291292
292293 case SaneOptionValueType .int :
293294 result = (valuePointer as ffi.Pointer <SANE_Int >).value;
@@ -306,16 +307,18 @@ class Sane {
306307 result = null ;
307308
308309 default :
309- throw SaneInvalidDataException ();
310+ throw const SaneInvalidDataException ();
310311 }
311312
312313 ffi.calloc.free (valuePointer);
313314 ffi.calloc.free (infoPointer);
314315
315- completer.complete (SaneOptionResult (
316- result: result,
317- infos: infos,
318- ));
316+ completer.complete (
317+ SaneOptionResult (
318+ result: result,
319+ infos: infos,
320+ ),
321+ );
319322 });
320323
321324 return completer.future;
@@ -326,8 +329,8 @@ class Sane {
326329 required int index,
327330 required SaneAction action,
328331 bool ? value,
329- }) async {
330- return await _controlOption <bool >(
332+ }) {
333+ return _controlOption <bool >(
331334 handle: handle,
332335 index: index,
333336 action: action,
@@ -340,8 +343,8 @@ class Sane {
340343 required int index,
341344 required SaneAction action,
342345 int ? value,
343- }) async {
344- return await _controlOption <int >(
346+ }) {
347+ return _controlOption <int >(
345348 handle: handle,
346349 index: index,
347350 action: action,
@@ -354,8 +357,8 @@ class Sane {
354357 required int index,
355358 required SaneAction action,
356359 double ? value,
357- }) async {
358- return await _controlOption <double >(
360+ }) {
361+ return _controlOption <double >(
359362 handle: handle,
360363 index: index,
361364 action: action,
@@ -368,8 +371,8 @@ class Sane {
368371 required int index,
369372 required SaneAction action,
370373 String ? value,
371- }) async {
372- return await _controlOption <String >(
374+ }) {
375+ return _controlOption <String >(
373376 handle: handle,
374377 index: index,
375378 action: action,
@@ -380,8 +383,8 @@ class Sane {
380383 Future <SaneOptionResult <Null >> controlButtonOption ({
381384 required SaneHandle handle,
382385 required int index,
383- }) async {
384- return await _controlOption <Null >(
386+ }) {
387+ return _controlOption <Null >(
385388 handle: handle,
386389 index: index,
387390 action: SaneAction .setValue,
@@ -395,7 +398,9 @@ class Sane {
395398 Future (() {
396399 final nativeParametersPointer = ffi.calloc <SANE_Parameters >();
397400 final status = dylib.sane_get_parameters (
398- _getNativeHandle (handle), nativeParametersPointer);
401+ _getNativeHandle (handle),
402+ nativeParametersPointer,
403+ );
399404 print ('sane_get_parameters() -> ${status .name }' );
400405
401406 status.check ();
0 commit comments