selectedFileView method

Widget selectedFileView(
  1. ValueNotifier<List<PlatformFile>> selectedFiles,
  2. BuildContext context
)

Implementation

Widget selectedFileView(
    ValueNotifier<List<PlatformFile>> selectedFiles, BuildContext context) {
  return Expanded(
    child: Padding(
      padding: const EdgeInsets.symmetric(horizontal: 10),
      child: GestureDetector(
        onTap: () {
          if (selectedFiles.value.isNotEmpty) {
            openMultipleFiles(selectedFiles, context);
          } else {
            showActionSheet(
                context: context,
                actions: buildSourceList(
                    selectedFiles: selectedFiles, context: context));
          }
        },
        child: Container(
          padding: const EdgeInsets.all(5),
          height: 40,
          decoration: BoxDecoration(
              border: Border.all(color: outlineColor),
              borderRadius: BorderRadius.circular(10)),
          child: Row(children: [
            CircleAvatar(
              backgroundColor: Colors.blue,
              radius: 15,
              child: Text(
                "${selectedFiles.value.length > 99 ? "99+" : selectedFiles.value.length}",
                style: const TextStyle(
                    fontSize: 12, height: 1.5, fontWeight: FontWeight.w600),
              ),
            ),
            const SizedBox(width: 10),
            // Text("${}"),
            Expanded(
              child: Text(
                selectedFiles.value.map((PlatformFile e) => e.name).join(','),
                maxLines: 1,
                softWrap: false,
                style: const TextStyle(
                  overflow: TextOverflow.ellipsis,
                ),
              ),
            ),
          ]),
        ),
      ),
    ),
  );
}