

import 'package:flutter/material.dart';
import 'package:liftmanager/res/resources.dart';
import 'package:liftmanager/utils/image_utils.dart';
import 'package:liftmanager/utils/theme_utils.dart';

class SelectedVideo extends StatelessWidget {

  const SelectedVideo({
    Key key,
    this.size : 100.0,
    this.onTap,
    this.image,
    this.index,
    this.videoPlay
  }): super(key: key);

  final double size;
  final GestureTapCallback onTap;
  final String image;
  final int index;
  final Widget videoPlay;
  
  @override
  
  Widget build(BuildContext context) {
    double width = MediaQuery.of(context).size.width;
    
    return InkWell(
      borderRadius: BorderRadius.circular(16.0),
      onTap: onTap,
      child: image == null?
      Container(
        width: width*0.5,
        height: width*0.5,
        decoration: BoxDecoration(
          // 图片圆角展示
          borderRadius: BorderRadius.circular(0),
          image: DecorationImage(
              image: ImageUtils.getAssetImage("img_add"),
              fit: BoxFit.fitHeight,
              colorFilter: ColorFilter.mode(ThemeUtils.getDarkColor(context, Colours.dark_unselected_item_color), BlendMode.srcIn)
          ),
        ),
      ):videoPlay
      
    );
  }
}

