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

Dynamic list of bubbles #35

Open
dweberlj opened this issue May 30, 2021 · 0 comments
Open

Dynamic list of bubbles #35

dweberlj opened this issue May 30, 2021 · 0 comments

Comments

@dweberlj
Copy link

Hello,

I have the following code to implement a dynamic list of chat bubbles. The issue is that in the setState the bubbles are not redrawn. Could you please provide an example of dynamically generating bubbles.

Also, how do I autoscroll to the bottom that new bubbles are added?

Thank you.

List<Widget> bubbles = <Widget>[];

void onSomeEvent() {
    setState(() {
        bubbles.add(new Bubble(color: Colors.blue, child: new Text('Hello Bubble');
    }
}

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Quantum AI Scribe"),
      ),
      body: Container(
        color: Colors.black12,
        child: ListView(
          padding: const EdgeInsets.all(8),
          children: bubbles,
        ),
      )
    );
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant