From 9e652157b62b64c080f492715fda83e9b63533bd Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sun, 26 Feb 2023 22:17:03 +0100 Subject: [PATCH] refactor: fix analyzer warnings - remove uses of `FallThroughError? - don't use `:` arg default value syntax --- .../lib/src/libc.dart | 16 ++++++++-------- .../lib/src/libc_bindings_generator.dart | 2 +- packages/flutter_gpiod_test_app/lib/main.dart | 2 +- .../pubspec.yaml | 4 ++-- packages/linux_serial/lib/src/linux_serial.dart | 2 +- .../lib/src/omxplayer_video_player.dart | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/_ardera_common_libc_bindings/lib/src/libc.dart b/packages/_ardera_common_libc_bindings/lib/src/libc.dart index 53f8231..b3b4a05 100644 --- a/packages/_ardera_common_libc_bindings/lib/src/libc.dart +++ b/packages/_ardera_common_libc_bindings/lib/src/libc.dart @@ -184,7 +184,7 @@ class epoll_event_ptr { } else if (Arch.isAmd64) { return backing.cast(); } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported Architecture'); } } @@ -216,7 +216,7 @@ class epoll_event_ptr { } else if (Arch.isAmd64) { ptr = backing.cast().elementAt(index); } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported Architecture'); } return epoll_event_ptr(allocator, ptr); } @@ -233,7 +233,7 @@ class epoll_event_ptr { } else if (Arch.isAmd64) { return backing.cast().ref; } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported Architecture'); } } @@ -262,7 +262,7 @@ class epoll_event_ptr { } else if (Arch.isAmd64) { return ffi.sizeOf(); } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported Architecture'); } } @@ -346,7 +346,7 @@ class termios_ptr { } else if (Arch.isAmd64) { return i386.NCCS; } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported Architecture'); } } @@ -361,7 +361,7 @@ class termios_ptr { } else if (Arch.isAmd64) { ptr = backing.cast().elementAt(index); } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported Architecture'); } return termios_ptr(allocator, ptr); } @@ -376,7 +376,7 @@ class termios_ptr { } else if (Arch.isAmd64) { return backing.cast().ref; } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported Architecture'); } } @@ -404,7 +404,7 @@ class termios_ptr { } else if (Arch.isAmd64) { return ffi.sizeOf(); } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported Architecture'); } } diff --git a/packages/_ardera_libc_bindings_generator/lib/src/libc_bindings_generator.dart b/packages/_ardera_libc_bindings_generator/lib/src/libc_bindings_generator.dart index e139998..7bcbf3b 100644 --- a/packages/_ardera_libc_bindings_generator/lib/src/libc_bindings_generator.dart +++ b/packages/_ardera_libc_bindings_generator/lib/src/libc_bindings_generator.dart @@ -109,7 +109,7 @@ class LibCPlatformBackendGenerator extends Generator { } else if (Platform.isLinux) { return _linuxLlvmPath; } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported platform'); } } diff --git a/packages/flutter_gpiod_test_app/lib/main.dart b/packages/flutter_gpiod_test_app/lib/main.dart index c6053d9..0a21dff 100644 --- a/packages/flutter_gpiod_test_app/lib/main.dart +++ b/packages/flutter_gpiod_test_app/lib/main.dart @@ -100,7 +100,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.headline4, + style: Theme.of(context).textTheme.headlineMedium, ), ], ), diff --git a/packages/flutterpi_gstreamer_video_player/pubspec.yaml b/packages/flutterpi_gstreamer_video_player/pubspec.yaml index 4677258..ff02a95 100644 --- a/packages/flutterpi_gstreamer_video_player/pubspec.yaml +++ b/packages/flutterpi_gstreamer_video_player/pubspec.yaml @@ -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' diff --git a/packages/linux_serial/lib/src/linux_serial.dart b/packages/linux_serial/lib/src/linux_serial.dart index 28ea724..93e034f 100644 --- a/packages/linux_serial/lib/src/linux_serial.dart +++ b/packages/linux_serial/lib/src/linux_serial.dart @@ -646,7 +646,7 @@ class SerialPort { } abstract class StringReader { - factory StringReader(Stream source, {Encoding encoding: utf8}) { + factory StringReader(Stream source, {Encoding encoding = utf8}) { return _StringReaderImpl(source, encoding: encoding); } diff --git a/packages/omxplayer_video_player/lib/src/omxplayer_video_player.dart b/packages/omxplayer_video_player/lib/src/omxplayer_video_player.dart index 5170267..09bce31 100644 --- a/packages/omxplayer_video_player/lib/src/omxplayer_video_player.dart +++ b/packages/omxplayer_video_player/lib/src/omxplayer_video_player.dart @@ -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); }