selectedOverlay method

Widget selectedOverlay(
  1. BuildContext context,
  2. AssetEntity asset
)

Overlays imageItemBuilder amd videoItemBuilder to display the slected state

Implementation

Widget selectedOverlay(BuildContext context, AssetEntity asset){

  //Width of the screen
  var width = MediaQuery.of(context).size.width;

  return Stack(
    children: [
      Positioned.fill(
        child: Opacity(
          opacity: 0.4,
          child: Container(
            height: width / 3,
            width: width / 3,
            color: Colors.black,
          ),
        ),
      ),
      Align(
        alignment: Alignment.center,
        child: Container(
          height: 30,
          width: 30,
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius:BorderRadius.circular(30)),
          child: Center(
            child: Text(
              (provider.selectedAssets.indexOf(asset) + 1).toString(),
              style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.black),
        )),
      )),
    ],
  );
}