showBase64 static method

void showBase64(
  1. String base64, {
  2. Map<String, String>? header,
})

Implementation

static void showBase64(String base64, {Map<String, String>? header}) {
  showGeneralDialog(
    context: Get.context!,
    barrierColor: Colors.black.withOpacity(0.8),
    barrierDismissible: true,
    barrierLabel: 'Dialog',
    transitionDuration: Duration(milliseconds: 300),
    pageBuilder: (context, __, ___) {
      return Scaffold(
        backgroundColor: Colors.black.withOpacity(0.2),
        body: SafeArea(
          child: Stack(
            children: [
              PhotoView(
                backgroundDecoration:
                    BoxDecoration(color: Colors.transparent),
                imageProvider: Image.memory(base64Decode(base64)).image,
              ),
              HStack(
                [
                  Spacer(),
                  CloseButton(color: Colors.white).p8(),
                ],
              ),
            ],
          ),
        ),
      );
    },
  );
}