Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only single child? not children? #5

Closed
manondidi opened this issue Oct 29, 2018 · 8 comments
Closed

only single child? not children? #5

manondidi opened this issue Oct 29, 2018 · 8 comments
Labels
wontfix This will not be worked on

Comments

@manondidi
Copy link

Marquee(
child: Text('There once was a boy who told this story about a boy: "'),
)

i want marquee every time show some diffent thing not same thing?
such as ["aaa" ,"bbb","ccc"]
first time show Text("aaa");
second time show Text("bbb");
thrid time show Text("ccc");

i am not good at english ,thx

@MarcelGarus
Copy link
Owner

The main use case of this library is to display one child over and over again. If you want to display different children every time, for now you can pass a Row as a child, something in the form of:
Row(mainAxisSize: MainAxisSize.min, children: [ Text(...), SizedBox(width: blankSpace), Text(...), SizedBox(width: blankSpace), Text(...) ]). Anyways, I might consider adding a children property to the library in the future. Thanks for your feedback!

@manondidi
Copy link
Author

if i use Row() ,there will be a problem(not bug)
it will init many children of row,
it's better to init two children like recyclerView in android or tableview in ios
:)

@manondidi
Copy link
Author

when marquee is unvisiable ,do you pause the timer ?

@MarcelGarus
Copy link
Owner

It gets disposed when the Widget gets disposed, which to my understanding is when the widget is not visible.

@manondidi
Copy link
Author

but why it scroll fastly when i reopen the app?
because of timer?

@MarcelGarus
Copy link
Owner

Also, I thought about your case for some time and I decided I won't explicitly support multiple children... In fact, with the next version I'll not even accept a custom widget, only a text String and a TextStyle. The reason is that I'd argue your problem is a rare edge case and only allowing a single text String makes other features possible, like more efficient child generation, pausing every round trip as well as smooth acceleration and deceleration.

@MarcelGarus
Copy link
Owner

And yes, it scrolled fast because of the timer. It doesn't run in the background but because of the isochronousy of the timer, all the events are fired at once when the app resumes. Here's an issue about it dart-lang/sdk#23487 but it seems like it won't be changed any time soon. I'll try to address this problem in the next version by making the scrolling asynchronous and using Future.doWhile()

@MarcelGarus
Copy link
Owner

@manondidi
I just published version 1.0.0 of the widget. The fast-scrolling issue got resolved and several features were added. Have a look at the changelog!

However, as I explained above, my goal for this widget is to take as much work of most developers' mind as possible, so I made tradeoffs in comprehensiveness and functionality vs generalization, leaving edge cases like your unsatisfied.
I just can't see a future version of the Marquee supporting multiple texts, so I'll close this issue.
To not break your app, I released it as a new, major version, 1.0.0. If you want to continue working on supporting multiple children, feel free to get the source code from the git history and/or fork this repo.
Thank you for your undestanding!

Marcel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants