Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Draggable buildRecursiveStack(List<PCard> cards, int depth) {
- if (cards.length == 0) {
- return null;
- }
- PCard card = cards.first;
- List<PCard> ncards = new List<PCard>.from(cards);
- ncards.removeAt(0);
- return Draggable(
- childWhenDragging: Container(),
- feedback: Container(
- height: 300,
- width: 50,
- child: Stack(
- children: cards.map((card) {
- return Positioned(
- top: 20.0 * depth + 20.0 * cards.indexOf(card),
- child: Container(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(4.0),
- color: Colors.white,
- border: Border.all(color: Colors.black),
- ),
- child: Image.asset(
- card.AsettName,
- scale: 6,
- )));
- }).toList(),
- ),
- ),
- child: Stack(children: () {
- List<Widget> a = [
- Positioned(
- top: 20.0 * depth,
- child: Container(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(4.0),
- color: Colors.white,
- border: Border.all(color: Colors.black),
- ),
- child: Image.asset(
- card.AsettName,
- scale: 6,
- ))),
- buildRecursiveStack(ncards, depth + 1)
- ];
- a.removeWhere((value) => value == null);
- return a;
- }()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement