Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

preview test for SC2

RICOH THETA SC2 Live Preview Tester

For V/Z1, see my other project using dio as the HTTP library.

Save Frames to Disk for Inspection

Use Within Flutter

Usage

  1. create a stream (for Flutter, it is easier to use StreamController
  2. pass stream to library
  3. specify number of frames to capture
  4. listen to stream and either write frames to disk or display to screen

Example

Code example with Flutter

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    StreamController controller = StreamController();
    sc2GetLivePreview(controller, frames: 300);
    return Scaffold(
// your ui
//
Expanded(
    flex: 8,
    child: StreamBuilder(
        stream: controller.stream,
        builder: (BuildContext context, AsyncSnapshot snapshot) {
        if (snapshot.hasData) {
            var imageData = Uint8List.fromList(snapshot.data);
            return Image.memory(
            imageData,
            gaplessPlayback: true,
            );
        } else {
            return Container();
        }
        }),
),

Source code on GitHub

https://github.com/codetricity/sc2_preview
Exit mobile version