Flutter - How to make ListView inside of AnimatedBuilder?

Multi tool use
I'm practicing an animated text tutorial from Youtube, and i want to implement it inside my Layout. In my layout, i have a background image.. so i'm using Stack so that my Animated Text is above the background image, and it must be scrollable.
it's work perfectly without the ListView. But, When i wrapped the Stack inside of ListView...all of the widgets are disappear, it's blank. Please help me
This is the code:
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return AnimatedBuilder(
animation: animationController,
builder: (BuildContext context, Widget child) {
return Scaffold(
appBar: new AppBar(....),
//BODY
body: new ListView {
children: <Widget>[
new Stack(
children: <Widget>[
new AspectRatio(
aspectRatio: 100 / 100,
child: new Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/dashboard.png'),
alignment: Alignment.topCenter)),
),
),
new Transform(
transform: Matrix4.translationValues(
animation.value * width,
0.0,
0.0,
),
child: ListView{
children:<Widget>[
new Container(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Text(
'Have you subscribe',
style: TextStyle(
color: Colors.black,
fontSize: 28.0,
fontFamily: 'Sego'),
)
],
),
],
),
),
],
),
),
],
));
});
}
}


add a comment |
I'm practicing an animated text tutorial from Youtube, and i want to implement it inside my Layout. In my layout, i have a background image.. so i'm using Stack so that my Animated Text is above the background image, and it must be scrollable.
it's work perfectly without the ListView. But, When i wrapped the Stack inside of ListView...all of the widgets are disappear, it's blank. Please help me
This is the code:
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return AnimatedBuilder(
animation: animationController,
builder: (BuildContext context, Widget child) {
return Scaffold(
appBar: new AppBar(....),
//BODY
body: new ListView {
children: <Widget>[
new Stack(
children: <Widget>[
new AspectRatio(
aspectRatio: 100 / 100,
child: new Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/dashboard.png'),
alignment: Alignment.topCenter)),
),
),
new Transform(
transform: Matrix4.translationValues(
animation.value * width,
0.0,
0.0,
),
child: ListView{
children:<Widget>[
new Container(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Text(
'Have you subscribe',
style: TextStyle(
color: Colors.black,
fontSize: 28.0,
fontFamily: 'Sego'),
)
],
),
],
),
),
],
),
),
],
));
});
}
}


Please post the error you got.
– Jerome Escalante
Dec 28 '18 at 3:16
not error sorry, it's just blank. every widget are disappear(except appbar)
– Haikal Permana
Dec 28 '18 at 3:17
add a comment |
I'm practicing an animated text tutorial from Youtube, and i want to implement it inside my Layout. In my layout, i have a background image.. so i'm using Stack so that my Animated Text is above the background image, and it must be scrollable.
it's work perfectly without the ListView. But, When i wrapped the Stack inside of ListView...all of the widgets are disappear, it's blank. Please help me
This is the code:
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return AnimatedBuilder(
animation: animationController,
builder: (BuildContext context, Widget child) {
return Scaffold(
appBar: new AppBar(....),
//BODY
body: new ListView {
children: <Widget>[
new Stack(
children: <Widget>[
new AspectRatio(
aspectRatio: 100 / 100,
child: new Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/dashboard.png'),
alignment: Alignment.topCenter)),
),
),
new Transform(
transform: Matrix4.translationValues(
animation.value * width,
0.0,
0.0,
),
child: ListView{
children:<Widget>[
new Container(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Text(
'Have you subscribe',
style: TextStyle(
color: Colors.black,
fontSize: 28.0,
fontFamily: 'Sego'),
)
],
),
],
),
),
],
),
),
],
));
});
}
}


I'm practicing an animated text tutorial from Youtube, and i want to implement it inside my Layout. In my layout, i have a background image.. so i'm using Stack so that my Animated Text is above the background image, and it must be scrollable.
it's work perfectly without the ListView. But, When i wrapped the Stack inside of ListView...all of the widgets are disappear, it's blank. Please help me
This is the code:
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return AnimatedBuilder(
animation: animationController,
builder: (BuildContext context, Widget child) {
return Scaffold(
appBar: new AppBar(....),
//BODY
body: new ListView {
children: <Widget>[
new Stack(
children: <Widget>[
new AspectRatio(
aspectRatio: 100 / 100,
child: new Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/dashboard.png'),
alignment: Alignment.topCenter)),
),
),
new Transform(
transform: Matrix4.translationValues(
animation.value * width,
0.0,
0.0,
),
child: ListView{
children:<Widget>[
new Container(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Text(
'Have you subscribe',
style: TextStyle(
color: Colors.black,
fontSize: 28.0,
fontFamily: 'Sego'),
)
],
),
],
),
),
],
),
),
],
));
});
}
}




edited Dec 28 '18 at 3:24
asked Dec 28 '18 at 3:10


Haikal Permana
254
254
Please post the error you got.
– Jerome Escalante
Dec 28 '18 at 3:16
not error sorry, it's just blank. every widget are disappear(except appbar)
– Haikal Permana
Dec 28 '18 at 3:17
add a comment |
Please post the error you got.
– Jerome Escalante
Dec 28 '18 at 3:16
not error sorry, it's just blank. every widget are disappear(except appbar)
– Haikal Permana
Dec 28 '18 at 3:17
Please post the error you got.
– Jerome Escalante
Dec 28 '18 at 3:16
Please post the error you got.
– Jerome Escalante
Dec 28 '18 at 3:16
not error sorry, it's just blank. every widget are disappear(except appbar)
– Haikal Permana
Dec 28 '18 at 3:17
not error sorry, it's just blank. every widget are disappear(except appbar)
– Haikal Permana
Dec 28 '18 at 3:17
add a comment |
1 Answer
1
active
oldest
votes
Holy moly, it's actually just a simple blunder. My mistake is making ListView inside of ListView, which make it throws exception error. I just need to delete ListView inside the Stack..
Stack(
//(.....)
child: ListView{
children:<Widget>[
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53953265%2fflutter-how-to-make-listview-inside-of-animatedbuilder%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Holy moly, it's actually just a simple blunder. My mistake is making ListView inside of ListView, which make it throws exception error. I just need to delete ListView inside the Stack..
Stack(
//(.....)
child: ListView{
children:<Widget>[
add a comment |
Holy moly, it's actually just a simple blunder. My mistake is making ListView inside of ListView, which make it throws exception error. I just need to delete ListView inside the Stack..
Stack(
//(.....)
child: ListView{
children:<Widget>[
add a comment |
Holy moly, it's actually just a simple blunder. My mistake is making ListView inside of ListView, which make it throws exception error. I just need to delete ListView inside the Stack..
Stack(
//(.....)
child: ListView{
children:<Widget>[
Holy moly, it's actually just a simple blunder. My mistake is making ListView inside of ListView, which make it throws exception error. I just need to delete ListView inside the Stack..
Stack(
//(.....)
child: ListView{
children:<Widget>[
edited Dec 28 '18 at 3:34
answered Dec 28 '18 at 3:29


Haikal Permana
254
254
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53953265%2fflutter-how-to-make-listview-inside-of-animatedbuilder%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
m3gpIOK,ZpbQbHArdVuuvph78Hq8S7b qdWsIzFNdN99l 05Ro2lUVhepJ6sTaGi6TFn,VZva,VUAIP
Please post the error you got.
– Jerome Escalante
Dec 28 '18 at 3:16
not error sorry, it's just blank. every widget are disappear(except appbar)
– Haikal Permana
Dec 28 '18 at 3:17