showSelectedFile static method

Column showSelectedFile(
  1. String value,
  2. FormFieldState<List<String>> state
)

Implementation

static Column showSelectedFile(
  String value,
  FormFieldState<List<String>> state,
) {
  return Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
    children: [
      // ignore: sized_box_for_whitespace
      Container(
        width: 90,
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            RawMaterialButton(
              onPressed: () {
                launchUrlString(value);
              },
              // fillColor: Colors.black,
              highlightColor: midleLightGreyColor.withValues(alpha: .8),
              splashColor: midleLightGreyColor.withValues(alpha: .8),
              padding: const EdgeInsets.all(20),
              shape: const CircleBorder(),
              child: const Icon(
                Icons.file_present_outlined,
                size: 25,
                color: Colors.black,
              ),
            ),
            const SizedBox(width: 5),
            // ignore: sized_box_for_whitespace
            Container(
              height: 40,
              child: Text(
                value.split('/').last,
                style: smallMutedText,
                textAlign: TextAlign.center,
                overflow: TextOverflow.fade,
                maxLines: 3,
              ),
            ),
          ],
        ),
      ),
      // ignore: sized_box_for_whitespace
      Container(
        width: 150,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            RawMaterialButton(
              onPressed: () {
                fileHasBeenDeleted = true;
                state.value!.remove(value);
                state.didChange([...state.value!]);
              },
              // fillColor: midleLightGreyColor,
              highlightColor: midleLightGreyColor.withValues(alpha: .8),
              splashColor: midleLightGreyColor.withValues(alpha: .8),
              // padding: EdgeInsets.all(20),
              shape: const CircleBorder(),
              child: const Icon(
                Icons.delete_outline_outlined,
                color: Colors.black,
                size: 25,
              ),
            ),
            const SizedBox(width: 5),
            // ignore: sized_box_for_whitespace
            Container(
              height: 40,
              child: const Text(
                'delete',
                style: smallMutedText,
                textAlign: TextAlign.center,
                overflow: TextOverflow.fade,
              ),
            ),
          ],
        ),
      ),
    ],
  );
}