Skip to content

Commit bc5cbbe

Browse files
committed
Fix padding rules
Draw Arbitrary number of spacing when index > 1
1 parent 3320644 commit bc5cbbe

1 file changed

Lines changed: 51 additions & 66 deletions

File tree

lib/components/modals/select_move_or_copy_modal.dart

Lines changed: 51 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -200,79 +200,64 @@ class _ExpansionAlbumTileState extends State<ExpansionAlbumTile> {
200200
widget.onTap?.call(widget.album);
201201
},
202202
child: SizedBox(
203-
height: 48.0,
204-
child: Row(
205-
crossAxisAlignment: CrossAxisAlignment.stretch,
206-
children: [
207-
if (widget.album.children.isNotEmpty && !widget.isParent)
208-
GestureDetector( // Add chevron
209-
behavior: HitTestBehavior.opaque,
210-
onTap: () => setState(() {
211-
_expanded = !_expanded;
212-
}),
213-
child: Padding(
214-
padding: const EdgeInsets.symmetric(horizontal: 16),
203+
height: 48.0,
204+
child: Row(
205+
spacing: 2,
206+
children: [
207+
Padding(padding: EdgeInsetsGeometry.only(left: 10.0)),
208+
if (widget.index > 1) ...[
209+
Padding(padding: EdgeInsetsGeometry.only(
210+
left: 30.0*(widget.index-1)
211+
))
212+
],
213+
if (widget.album.children.isNotEmpty && !widget.isParent) ...[
214+
GestureDetector(
215+
behavior: HitTestBehavior.opaque,
216+
onTap: () => setState(() {
217+
_expanded = !_expanded;
218+
}),
215219
child: AnimatedRotation(
220+
turns: _expanded ? 0.25 : 0, //Rotate by 90°,
216221
duration: const Duration(milliseconds: 200),
217-
turns: _expanded ? 0.25 : 0, //Rotate by 90°
218222
child: Icon(Icons.chevron_right),
219223
)),
220-
),
221-
Expanded(
222-
child: Padding(
223-
padding: const EdgeInsets.symmetric(horizontal: 16.0),
224-
child: Align(
225-
alignment: Alignment.centerLeft,
224+
],
225+
Expanded(
226226
child: Text(
227-
"${widget.album.name}",
228-
overflow: TextOverflow.ellipsis,
229-
style: _disabled
230-
? Theme.of(context).textTheme.bodySmall
231-
: Theme.of(context).textTheme.bodyMedium,
232-
),
233-
),
234-
),
235-
),
236-
if (widget.album.children.isNotEmpty && !widget.isParent)
237-
Padding( //Folder box
238-
padding: const EdgeInsets.symmetric(horizontal: 16.0),
239-
child: Row(
240-
crossAxisAlignment: CrossAxisAlignment.stretch,
241-
children: [
242-
Center(
243-
child: DecoratedBox(
244-
decoration: BoxDecoration(
245-
color: Color.fromARGB(255, 196, 196, 196),
246-
borderRadius: BorderRadius.circular(5)),
247-
child: Padding(
248-
padding:
249-
EdgeInsetsGeometry.symmetric(horizontal: 8),
250-
child: Row(
251-
spacing: 2.0,
252-
children: [
253-
Text(
254-
'${widget.album.nbCategories}',
255-
style: TextStyle(
256-
color: Colors.white,
257-
fontSize: 14,
258-
),
259-
),
260-
Icon(
261-
Icons.folder,
262-
size: 15,
263-
color: Colors.white,
264-
),
265-
],
227+
"${widget.album.name}",
228+
overflow: TextOverflow.ellipsis,
229+
style: _disabled
230+
? Theme.of(context).textTheme.bodySmall
231+
: Theme.of(context).textTheme.bodyMedium,
232+
)),
233+
if (widget.album.children.isNotEmpty && !widget.isParent) ...[
234+
DecoratedBox(
235+
decoration: BoxDecoration(
236+
color: Color.fromARGB(255, 196, 196, 196),
237+
borderRadius: BorderRadius.circular(5)),
238+
child: Padding(
239+
padding: EdgeInsetsGeometry.symmetric(
240+
horizontal: 8,
241+
),
242+
child: Row(children: [
243+
Text(
244+
'${widget.album.nbCategories}',
245+
style: TextStyle(
246+
color: Colors.white,
247+
fontSize: 14,
266248
),
267249
),
268-
),
269-
),
270-
],
271-
),
272-
)
273-
],
274-
),
275-
),
250+
Icon(
251+
Icons.folder,
252+
size: 15,
253+
color: Colors.white,
254+
),
255+
]),
256+
)),
257+
Padding(padding: EdgeInsetsGeometry.only(right: 8))
258+
],
259+
],
260+
)),
276261
);
277262

278263
Widget get _divider => Divider(

0 commit comments

Comments
 (0)