flir_plugin 0.1.0 copy "flir_plugin: ^0.1.0" to clipboard
flir_plugin: ^0.1.0 copied to clipboard

Flutter Plugin for FLIR Camera (USB)

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flir_plugin/flir_plugin.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _imageFile = "";
  // String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flir Plugin example app'),
        ),
        body: Center(
          child: _previewImage(),
        ),
        floatingActionButton: Column(
          mainAxisAlignment: MainAxisAlignment.end,
          children: [
            FloatingActionButton(
              onPressed: () {
                launchFlirCamera();
              },
              child: Icon(Icons.camera_alt),
            ),
          ],
        ),
      ),
    );
  }

  void launchFlirCamera() async {
    final file = await FlirPlugin.getCameraImage();
    setState(() {
      _imageFile = file;
    });
  }

  Widget _previewImage() {
    if (_imageFile != null && _imageFile.isNotEmpty) {
      return Semantics(
        child: Image.file(
          File(_imageFile),
        ),
        label: "flir_plugin_image",
      );
    } else {
      return Text("No image found!");
    }
  }
}
0
likes
30
pub points
30%
popularity

Publisher

unverified uploader

Flutter Plugin for FLIR Camera (USB)

Homepage

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flir_plugin