Skip to content

Goddchen/flutter-rfb

Repository files navigation

flutter_rfb

A VNC / Remote Framebuffer / RFC 6143 client purely written in Dart/Flutter.

Motivation

We were searching a VNC viewer package for Flutter - without success. Then there was a discussion about how complex the protocol is and wether we should implement it ourself. Estimations ranged from 5 days to 100 days and we began joking that I'd be able to do it "after the weekend". And here we are, after a weekend, with the first, minimal, VNC viewer implementation.

Supported Features

For a list of currently supported protocol features please head over to the dart_rfb package.

Installation

As simple as dart pub add flutter_rfb.

Or manually add flutter_rfb: ^<latest-version> to your pubspec.yaml.

Usage

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(final BuildContext context) => MaterialApp(
        home: Scaffold(
          appBar: AppBar(
            title: const Text('Flutter RFB Example'),
          ),
          body: Center(
            child: InteractiveViewer(
              constrained: true,
              maxScale: 10,
              child: RemoteFrameBufferWidget(
                hostName: '127.0.0.1',
                onError: (final Object error) {
                  ScaffoldMessenger.of(context).showSnackBar(
                    SnackBar(
                      content: Text('Error: $error'),
                    ),
                  );
                },
                password: 'password',
              ),
            ),
          ),
        ),
      );
}

Learn More

https://pub.dev/packages/dart_rfb

https://www.rfc-editor.org/rfc/rfc6143