I don't know why the custom widget says
"import '/flutter_flow/flutter_flow_expanded_image_view.dart';" is not valid
I have to exclude from compilation. is there another way so that I don't need to enable exclude from compilation?
// Automatic FlutterFlow imports
import '/backend/schema/structs/index.dart';
import '/backend/schema/enums/enums.dart';
import '/backend/supabase/supabase.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/widgets/index.dart'; // Imports other custom widgets
import '/custom_code/actions/index.dart'; // Imports custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom widget code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'dart:convert';
import '/flutter_flow/flutter_flow_expanded_image_view.dart';
class Base64Image extends StatefulWidget {
const Base64Image({
Key? key,
this.width,
this.height,
required this.base64,
}) : super(key: key);
final double? width;
final double? height;
final String? base64;
@override
_Base64ImageState createState() => _Base64ImageState();
}
class _Base64ImageState extends State<Base64Image> {
@override
Widget build(BuildContext context) {
Uint8List? imageBytes;
imageBytes = widget.base64 != null ? base64Decode(widget.base64!) : null;
return imageBytes != null
? InkWell(
onTap: () {
// Your tap action here
Navigator.push(
context,
PageTransition(
type: PageTransitionType.fade,
child: FlutterFlowExpandedImageView(
image: Image.memory(
imageBytes!,
fit: BoxFit.contain,
errorBuilder: (context, error, stackTrace) => Image.asset(
'assets/images/error_image.png',
fit: BoxFit.contain,
),
),
allowRotation: false,
tag: 'imageTag',
useHeroAnimation: true,
),
),
);
},
child: Image.memory(
imageBytes,
width: widget.width,
height: widget.height,
fit: BoxFit.cover,
),
)
: Container();
}
}
// Set your widget name, define your parameter, and then add the
// boilerplate code using the green button on the right!