简体   繁体   中英

Countdown timer in streambuilder - Flutter

Hello everyone i'm a beginner on Flutter:), I want to create a countdown with a given time, but I can't update the value in my StreamBuilder.

this code is in my streambuilder:

 return Expanded(
                child: ListView(
              children: snapshot.data!.docs.map((DocumentSnapshot document) {
                Event event = Event.fromMap(
                    document.data() as Map<String, dynamic>, document.id);

                return Container(
                    color: Colors.green[400],
                    margin: const EdgeInsets.all(8),
                    child: Padding(
                        padding: const EdgeInsets.all(16),
                        child: Row(
                          children: [
                            Expanded(
                                child: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Text(event.name),
                                const SizedBox(height: 16),
                                Text(FormatDateHelper()
                                    .dateFormated(event.date)),
                                const SizedBox(height: 16),
                                Text(event.street),
                              ],
                            )),

                            ....

Could someone help me please?

I've Created a amazing timer without any plugin, here you can also get count down timer. And don't forget to stop the timer on back pressed.

Here is the link of my timer full Project.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM