Flutter - How to make ListView inside of AnimatedBuilder?

Multi tool use
Multi tool use












0














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'),
)
],
),
],
),
),
],
),
),
],
));
});


}
}










share|improve this question
























  • 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


















0














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'),
)
],
),
],
),
),
],
),
),
],
));
});


}
}










share|improve this question
























  • 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
















0












0








0







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'),
)
],
),
],
),
),
],
),
),
],
));
});


}
}










share|improve this question















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'),
)
],
),
],
),
),
],
),
),
],
));
});


}
}







dart flutter






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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




















  • 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














1 Answer
1






active

oldest

votes


















0














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>[





share|improve this answer























    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    0














    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>[





    share|improve this answer




























      0














      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>[





      share|improve this answer


























        0












        0








        0






        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>[





        share|improve this answer














        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>[






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 28 '18 at 3:34

























        answered Dec 28 '18 at 3:29









        Haikal Permana

        254




        254






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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
            jqsVdyr3g3xgomJ6hA4V6d9QuLzzcUrDV

            Popular posts from this blog

            Monofisismo

            compose and upload a new article using a custom form

            “attempting to read past stream EOM” using Sybase.AdoNet4.AseClient