xuiGetDocsGallery function

List<Widget> xuiGetDocsGallery({
  1. required BuildContext context,
  2. required List docsFileList,
  3. required void onDelete(
    1. dynamic
    ),
  4. dynamic onPressedEdit(
    1. dynamic i
    )?,
  5. String? urlToOpenFile,
})

utilizzalo per avere una lista di documenti

Implementation

List<Widget> xuiGetDocsGallery({required BuildContext context, required List<dynamic> docsFileList, required void Function(dynamic) onDelete, Function(dynamic i)? onPressedEdit, String? urlToOpenFile}) {
  var retval = <Widget>[];
  if (docsFileList.isNotEmpty) {
    for (var i in docsFileList) {
      retval.add(GestureDetector(
          onTap: () => XUtils.launchURLBrowser(i.blobContainer, i.id, urlToOpenFile),
          child: Card(
              color: Colors.grey[850],
              child: Row(children: [
                Expanded(flex: 2, child: Container(padding: EdgeInsets.only(top: 5, left: 5, bottom: 5), child: Text(i.fileName!))),
                SizedBox(width: 10),
                Container(padding: EdgeInsets.only(top: 5, left: 5, bottom: 5), width: 80, child: Text(XUtils.dateToString(i.dtFile!))),
              ]))));
    }
  } else {
    retval.add(Container());
  }
  return retval;
}