@@ -20,10 +20,11 @@ String albumSubCount(dynamic album, context) {
2020}
2121
2222class AlbumListItem extends StatefulWidget {
23- const AlbumListItem (this .album, {Key key, this .isAdmin = false , this .onClose, this .onOpen}) : super (key: key);
23+ const AlbumListItem (this .album, {Key key, this .isAdmin = false , this .onClose, this .onOpen, this .canUpload = false }) : super (key: key);
2424
2525 final dynamic album;
2626 final bool isAdmin;
27+ final bool canUpload;
2728 final Function () onClose;
2829 final Function () onOpen;
2930
@@ -138,37 +139,40 @@ class _AlbumListItemState extends State<AlbumListItem> {
138139 borderRadius: BorderRadius .circular (10 ),
139140 child: Slidable (
140141 enabled: widget.isAdmin,
141- child: AlbumListCard (widget.album, isAdmin: widget.isAdmin),
142+ child: AlbumListCard (widget.album, isAdmin: widget.isAdmin, canUpload : widget.canUpload, ),
142143 endActionPane: ActionPane (
143144 motion: DrawerMotion (),
144145 children: [
145146 CustomSlidableAction (
146147 backgroundColor: Theme .of (context).colorScheme.primary,
147- onPressed: (_) {
148- _onEditAlbum ();
149- },
150- child: Center (
151- child: Icon (Icons .edit, size: 38 , color: Colors .white),
148+ onPressed: (_) => _onEditAlbum (),
149+ child: SizedBox .expand (
150+ child: FittedBox (
151+ fit: BoxFit .contain,
152+ child: Icon (Icons .edit, color: Colors .white),
153+ ),
152154 ),
153155 ),
154156 CustomSlidableAction (
155157 backgroundColor: Color (0xFF4B4B4B ),
156- child: Center (
157- child: Icon (Icons .reply, size: 38 , color: Colors .white),
158+ onPressed: (_) => _onMoveAlbum (),
159+ child: SizedBox .expand (
160+ child: FittedBox (
161+ fit: BoxFit .contain,
162+ child: Icon (Icons .reply, color: Colors .white),
163+ ),
158164 ),
159- onPressed: (_) {
160- _onMoveAlbum ();
161- },
162165 ),
163166 CustomSlidableAction (
164167 backgroundColor: Colors .red,
165- child: Center (
166- child: Icon (Icons .delete, size: 38 , color: Colors .white),
167- ),
168168 autoClose: true ,
169- onPressed: (_) {
170- _onDeleteAlbum ();
171- },
169+ onPressed: (_) => _onDeleteAlbum (),
170+ child: SizedBox .expand (
171+ child: FittedBox (
172+ fit: BoxFit .contain,
173+ child: Icon (Icons .delete, color: Colors .white),
174+ ),
175+ ),
172176 ),
173177 ],
174178 ),
@@ -179,10 +183,11 @@ class _AlbumListItemState extends State<AlbumListItem> {
179183}
180184
181185class AlbumListCard extends StatelessWidget {
182- const AlbumListCard (this .album, {Key key, this .isAdmin = false }) : super (key: key);
186+ const AlbumListCard (this .album, {Key key, this .isAdmin = false , this .canUpload = false , }) : super (key: key);
183187
184188 final dynamic album;
185189 final bool isAdmin;
190+ final bool canUpload;
186191
187192 @override
188193 Widget build (BuildContext context) {
@@ -244,7 +249,7 @@ class AlbumListCard extends StatelessWidget {
244249 maxLines: 1 ,
245250 ),
246251 ),
247- if (album[ "can_upload" ] ?? false ) Padding (
252+ if (canUpload ) Padding (
248253 padding: const EdgeInsets .only (left: 5 ),
249254 child: Icon (Icons .upload, size: 18 ,),
250255 ),
0 commit comments