Search code examples
flutterresponsive-designslider

how can i have a responsive text slider in flutter?


I am a beginner in Flutter. I want to create this text slider and I'm having trouble with slider part. image address: https://i.sstatic.net/vsMqg.png

The design text comes from the database and we don't know how many characters it may have. Challenges and issues:

  1. We want to adjust the program in such a way that it can create the required number of sliders so that if the text does not fit on the screen of the person's phone due to its length and responsiveness, the text will be moved to the next slide.
  2. TextOverflow.Ellipsis has a problem with flapping, which sometimes summarizes the end of the text in such a way that the last word becomes broken and meaningless.

Solution

  • Take the entire string of words and chop it into sections per 100 (or whatever) characters. create an object for each one of those sections, then load each object on a slide. Probably should use FittedBox.scaleDown also for legibility.