hey guys I'm facing some problems adding this custom widget to my project
I'm using the photo_gallery package but the parameter Album isn't supported within Flutterflow
is there any workaround for this issue?
Custom widget GridItem cannot be parsed.
Unable to process Parameter album
// Automatic FlutterFlow imports
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 'package:transparent_image/transparent_image.dart';
import 'package:photo_gallery/photo_gallery.dart';
class GridItem extends StatefulWidget {
const GridItem({
Key? key,
this.width,
this.height,
required this.album
}) : super(key: key);
final double? width;
final double? height;
final Album album;
@override
_GridItemState createState() => _GridItemState();
}
class _GridItemState extends State<GridItem> {
late Album album; // Declare album as a late variable
@override
void initState() {
super.initState();
album = widget.album; // Assign widget.album in the initState method
}
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(5.0),
child: Container(
color: Colors.grey[300],
height: 120,
width: 120,
child: FadeInImage(
fit: BoxFit.cover,
placeholder: MemoryImage(kTransparentImage),
image: AlbumThumbnailProvider(album: album, highQuality: true),
),
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.only(left: 2.0),
child: Text(
album.name ?? "Recovered Files",
maxLines: 1,
textAlign: TextAlign.start,
style: TextStyle(
height: 1.2,
fontSize: 16,
),
),
), // Album name
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.only(left: 2.0),
child: Text(
album.count.toString(),
textAlign: TextAlign.start,
style: TextStyle(
height: 1.2,
fontSize: 12,
),
),
), // Items count
],
);
}
}
// Set your widget name, define your parameter, and then add the
// boilerplate code using the button on the right!