import 'dart:typed_data';

import 'package:fis_common/env/env.dart';
import 'package:fis_measure/view/frame_view/interface/frame_view.dart';
import 'package:fis_vid/common/env.dart';
import 'package:fis_vid/processors/base.dart';
import 'package:flutter/material.dart';

part 'browser.dart';
part 'shell.dart';

class VidFrameView extends StatelessWidget implements VidFrameViewInterface {
  const VidFrameView(
    this.data, {
    Key? key,
    this.width,
    this.height,
    this.processors,
  }) : super(key: key);

  @override
  final Uint8List data;

  @override
  final double? height;

  @override
  final double? width;

  @override
  final List<VidFrameProcessor>? processors;

  @override
  Widget build(BuildContext context) {
    return VidDataHostEnv.isShell
        ? _VidFrameViewShell(
            data,
            width: width,
            height: height,
            processors: processors,
          )
        : _VidFrameViewBroswer(
            data,
            width: width,
            height: height,
            processors: processors,
          );
  }
}
