openMultipleFiles method

Future openMultipleFiles(
  1. ValueNotifier<List<PlatformFile>> files,
  2. BuildContext context
)

Implementation

Future<dynamic> openMultipleFiles(
    ValueNotifier<List<PlatformFile>> files, BuildContext context) {
  return fileViewInModal
      ? showModalBottomSheet(
          isScrollControlled: true,
          backgroundColor: Colors.white,
          shape: const RoundedRectangleBorder(
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(15.0),
                topRight: Radius.circular(15.0)),
          ),
          context: context,
          builder: (BuildContext ctx) {
            return DraggableScrollableSheet(
              maxChildSize: 0.9,
              expand: false,
              builder:
                  (BuildContext context, ScrollController scrollController) {
                return FilesPage(
                    controller: scrollController,
                    files: files.value,
                    onEditingFile: (List<PlatformFile> newList) {
                      // print('object');
                      files.value = newList;
                    });
              },
            );
          })
      : Navigator.of(context).push(MaterialPageRoute(
          builder: (BuildContext context) => Scaffold(
            body: Padding(
              padding:
                  EdgeInsets.only(top: MediaQuery.of(context).padding.top),
              child: FilesPage(
                  files: files.value,
                  onEditingFile: (List<PlatformFile> newList) {
                    // print('object');
                    files.value = newList;
                  }),
            ),
          ),
        ));
}