2

Image understands you the purpose better

https://i.stack.imgur.com/Z45YH.jpg I tried everything but failed!

asim
  • 17
  • 3

1 Answers1

1

Navigating

Navigating to a new Page is easy

Navigator.push(
    context,
    MaterialPageRoute(builder: (context) => SecondRoute()),
  );

"SecoundRoute" is the Widget you will open in a new Window. More information about this here.

Swipe gesture

This is a bit more complicated. There is a widget called "Dismissible" but like the name say its to dismiss something from a List. There is an issue which suggests to make it possible to avoid deleting the entry from the ListView directly. However, this is inactive. I don't know whether this feature is there or where it is on the priority list.

dismissible

If you use a prebuild and static list of widgets you can maybe get around it, by navigating to the naw page in the onDismissed: callback and using pushReplacement in the rout back. This will case your main page to get Rebuild. Because your Widgets are static I think they will be their again.

Navigator.pushReplacement(
  context,
  MaterialPageRoute(
    builder: (context) => Page1(),
  ),
);

flutter_slidable

There is a plugin called flutter_slidable perhaps a solution can be found with this plugin.

flutter_slidable

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
m123
  • 2,824
  • 1
  • 11
  • 29
  • Thanks for answering. I want to navigate to a new screen while swiping a card . Like this : swiping first card in the list open screen 1 , swiping second card open screen 2. But it got really complex when there is vertical padding between cards as in the picture i gave, Swiping on that padding should not navigate to other page. To be more simple swiping Each card deliver Screen of content related to that card. – asim Oct 10 '20 at 17:47
  • 1
    Please specify more what your problem is and what you want to achieve. 1: Should each card lead to a different page or should the card simply be built on the contents of the card? (As with Snapchat, for example, where every chat is the same window, only the messages are built responsive.) 2: Do you also have a problem with swiping or do you already have a solution. 3: Is the list of cards that are swiped by you, or is it extended by the user, and if so, in which way. Please edit your question, then I'll try to help you. :) – m123 Oct 18 '20 at 11:34