Note: Before Getting into the question,I would like to get everyone into the scope of the problem, Here's my ultimate goal:
- Developing a reactive
ListTileWidget that responds to the events coming from the backend by changing it's current state.
I'll leave that for another question. for now, Here's my Goal from this question
Goal: Designing a statefull widget that has multiple custom components like a Circle and timeline-related widgets
and placing it inside a Dismissable Listile alongside other components as shown in the following screenshot
I have so far implemented the ListView Screen with the Dismissable ListTile that contains the Text widgets that are shown in the previous design.
Here's the code for what I have currently:
ListView.builder(
itemCount: _items.length,
itemBuilder: (context, index) {
final String item = _items[index];
return Dismissible(
direction: DismissDirection.startToEnd,
key: Key(item),
onDismissed: (DismissDirection dir) {
setState(() => this._items.removeAt(index));
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text(dir == DismissDirection.startToEnd
? '$item removed.'
: '$item liked.'),
action: SnackBarAction(
label: 'UNDO',
onPressed: () {
setState(() => this._items.insert(index, item));
},
),
),
);
},
background: Container(
color: Colors.red,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FaIcon(
FontAwesomeIcons.times,
color: kWhite,
),
SizedBox(
height: 10,
),
Text(
'Cancel Order',
style: TextStyle(color: kWhite),
)
],
),
alignment: Alignment.centerLeft,
),
child: ListTile(
//CustomeTimeLineWidget goes here innstead of the container
title: Container(
child: Column(
children: <Widget>[
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'Order No: 002345',
),
Text('items no: 12'),
],
),
SizedBox(
height: 20,
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'Order Total: 20000',
),
Text('17/04/2020'),
],
),
],
),
),
),
);
},
),
And Here's the resulting Design from that code
Tried-Solutions: I have considered using the Timeline Package, but it shows the vertical timeline instead of Horizontal one.
Problem: I need to implement the timeline (The Circles in each ListTile)


