Skip to content

Commit

Permalink
refactor: fix analyzer warnings
Browse files Browse the repository at this point in the history
- remove uses of `FallThroughError?
- don't use `:` arg default value syntax
  • Loading branch information
ardera committed Feb 26, 2023
1 parent 56b2dc2 commit 9e65215
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions packages/_ardera_common_libc_bindings/lib/src/libc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class epoll_event_ptr {
} else if (Arch.isAmd64) {
return backing.cast<amd64.epoll_event>();
} else {
throw FallThroughError();
throw UnsupportedError('Unsupported Architecture');
}
}

Expand Down Expand Up @@ -216,7 +216,7 @@ class epoll_event_ptr {
} else if (Arch.isAmd64) {
ptr = backing.cast<amd64.epoll_event_real>().elementAt(index);
} else {
throw FallThroughError();
throw UnsupportedError('Unsupported Architecture');
}
return epoll_event_ptr(allocator, ptr);
}
Expand All @@ -233,7 +233,7 @@ class epoll_event_ptr {
} else if (Arch.isAmd64) {
return backing.cast<amd64.epoll_event_real>().ref;
} else {
throw FallThroughError();
throw UnsupportedError('Unsupported Architecture');
}
}

Expand Down Expand Up @@ -262,7 +262,7 @@ class epoll_event_ptr {
} else if (Arch.isAmd64) {
return ffi.sizeOf<amd64.epoll_event_real>();
} else {
throw FallThroughError();
throw UnsupportedError('Unsupported Architecture');
}
}

Expand Down Expand Up @@ -346,7 +346,7 @@ class termios_ptr {
} else if (Arch.isAmd64) {
return i386.NCCS;
} else {
throw FallThroughError();
throw UnsupportedError('Unsupported Architecture');
}
}

Expand All @@ -361,7 +361,7 @@ class termios_ptr {
} else if (Arch.isAmd64) {
ptr = backing.cast<i386.termios>().elementAt(index);
} else {
throw FallThroughError();
throw UnsupportedError('Unsupported Architecture');
}
return termios_ptr(allocator, ptr);
}
Expand All @@ -376,7 +376,7 @@ class termios_ptr {
} else if (Arch.isAmd64) {
return backing.cast<i386.termios>().ref;
} else {
throw FallThroughError();
throw UnsupportedError('Unsupported Architecture');
}
}

Expand Down Expand Up @@ -404,7 +404,7 @@ class termios_ptr {
} else if (Arch.isAmd64) {
return ffi.sizeOf<amd64.termios>();
} else {
throw FallThroughError();
throw UnsupportedError('Unsupported Architecture');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class LibCPlatformBackendGenerator extends Generator {
} else if (Platform.isLinux) {
return _linuxLlvmPath;
} else {
throw FallThroughError();
throw UnsupportedError('Unsupported platform');
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_gpiod_test_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
Expand Down
4 changes: 2 additions & 2 deletions packages/flutterpi_gstreamer_video_player/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutterpi_gstreamer_video_player
description: A new Flutter plugin project.
description: video_player platform implementation for flutter-pi.
version: 0.1.0
homepage:
repository: https://github.com/ardera/flutter_packages

environment:
sdk: '>=2.18.6 <3.0.0'
Expand Down
2 changes: 1 addition & 1 deletion packages/linux_serial/lib/src/linux_serial.dart
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ class SerialPort {
}

abstract class StringReader {
factory StringReader(Stream<int> source, {Encoding encoding: utf8}) {
factory StringReader(Stream<int> source, {Encoding encoding = utf8}) {
return _StringReaderImpl(source, encoding: encoding);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class OmxplayerVideoPlayer extends VideoPlayerPlatform {
/// is mounted in the widget tree at a time.
/// When [strictViewBehaviour] is `false`, will try to work around that issue and
/// only actually build the platform view for the last-recently registered element.
static void useAsImplementation({bool strictViewBehaviour: false}) {
static void useAsImplementation({bool strictViewBehaviour = false}) {
VideoPlayerPlatform.instance = OmxplayerVideoPlayer._(strictViewBehaviour);
}

Expand Down

0 comments on commit 9e65215

Please sign in to comment.