I wanted to make a page which shows a timer of 2 minutes and then the users can click on the button and move on to the next page. So for this I used the TweenAnimationBuilder and it works properly as long as the timer is not 0. As soon as it becomes zero it gives the following error.
======== Exception caught by widgets library =======================================================
The following _CastError was thrown building TweenAnimationBuilder<num>(duration: 120000ms, dirty, state: _TweenAnimationBuilderState<num>#9c4a1(ticker inactive)):
type 'int' is not a subtype of type 'double' in type cast
The relevant error-causing widget was:
TweenAnimationBuilder<num> TweenAnimationBuilder:file:///C:/Users/Vedant/StudioProjects/activepeers_app_internship/lib/introduction/introPage.dart:60:13
When the exception was thrown, this was the stack:
#0 _IntroPageState.build.<anonymous closure> (package:activepeers_app_internship/introduction/introPage.dart:64:33)
#1 _TweenAnimationBuilderState.build (package:flutter/src/widgets/tween_animation_builder.dart:201:26)
#2 StatefulElement.build (package:flutter/src/widgets/framework.dart:4919:27)
#3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4806:15)
#4 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#5 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#6 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#7 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#8 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5825:32)
#9 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6375:17)
#10 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#11 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#12 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#14 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#15 StatelessElement.update (package:flutter/src/widgets/framework.dart:4883:5)
#16 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#17 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#18 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#19 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#20 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#21 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#22 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#23 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#24 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#25 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5825:32)
#26 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6375:17)
#27 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#29 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#30 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#31 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#32 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#33 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#34 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#35 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#36 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#37 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#38 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#39 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#40 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#41 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#42 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#43 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#44 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#45 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#46 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#47 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#48 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#49 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#50 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#51 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#52 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#53 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#54 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#55 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#56 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#57 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#58 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#59 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#60 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#61 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#62 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#63 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#64 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#65 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#66 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#67 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#68 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#69 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#70 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#71 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#72 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#73 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#74 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#75 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#76 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#77 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#78 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#79 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#80 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#81 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#82 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#83 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#84 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#85 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#86 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#87 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#88 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#89 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#90 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#91 StatelessElement.update (package:flutter/src/widgets/framework.dart:4883:5)
#92 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#93 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#94 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#95 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#96 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#97 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#98 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#99 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#100 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#101 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#102 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#103 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#104 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#105 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#106 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#107 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#108 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#109 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#110 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#111 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#112 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#113 StatelessElement.update (package:flutter/src/widgets/framework.dart:4883:5)
#114 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#115 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#116 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#117 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#118 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#119 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#120 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#121 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#122 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#123 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#124 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#125 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#126 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#127 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#128 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#129 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#130 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#131 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#132 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#133 StatelessElement.update (package:flutter/src/widgets/framework.dart:4883:5)
#134 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#135 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#136 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#137 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#138 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#139 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#140 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#141 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#142 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#143 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#144 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#145 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#146 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#147 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#148 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#149 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#150 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#151 StatelessElement.update (package:flutter/src/widgets/framework.dart:4883:5)
#152 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#153 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#154 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#155 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#156 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#157 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#158 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#159 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#160 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#161 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#162 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#163 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#164 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#165 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#166 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#167 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#168 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#169 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#170 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#171 StatelessElement.update (package:flutter/src/widgets/framework.dart:4883:5)
#172 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#173 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#174 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#175 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#176 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#177 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#178 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#179 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#180 StatelessElement.update (package:flutter/src/widgets/framework.dart:4883:5)
#181 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#182 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#183 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#184 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#185 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#186 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#187 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#188 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#189 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#190 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#191 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#192 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#193 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#194 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:108:11)
#195 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#196 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#197 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#198 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#199 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#200 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#201 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#202 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#203 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#204 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#205 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#206 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#207 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#208 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#209 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#210 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#211 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#212 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#213 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#214 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#215 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#216 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#217 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#218 StatelessElement.update (package:flutter/src/widgets/framework.dart:4883:5)
#219 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#220 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#221 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#222 StatelessElement.update (package:flutter/src/widgets/framework.dart:4883:5)
#223 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#224 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6222:14)
#225 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#226 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#227 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#228 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#229 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#230 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#231 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#232 ProxyElement.update (package:flutter/src/widgets/framework.dart:5154:5)
#233 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#234 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#235 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#236 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#237 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#238 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#239 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#240 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#241 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#242 StatefulElement.update (package:flutter/src/widgets/framework.dart:5009:5)
#243 Element.updateChild (package:flutter/src/widgets/framework.dart:3530:15)
#244 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#245 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#246 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#247 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2659:19)
#248 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:891:21)
#249 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:370:5)
#250 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1146:15)
#251 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1083:9)
#252 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:864:7)
(elided 4 frames from class _RawReceivePortImpl, class _Timer, and dart:async-patch)
====================================================================================================
======== Exception caught by rendering library =====================================================
The following assertion was thrown during layout:
A RenderFlex overflowed by 99781 pixels on the bottom.
The relevant error-causing widget was:
Column Column:file:///C:/Users/Vedant/StudioProjects/activepeers_app_internship/lib/introduction/introPage.dart:32:16
The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.
The specific RenderFlex in question is: RenderFlex#5298b relayoutBoundary=up2 OVERFLOWING
... needs compositing
... parentData: offset=Offset(0.0, 0.0) (can use size)
... constraints: BoxConstraints(0.0<=w<=392.7, 0.0<=h<=803.6)
... size: Size(392.7, 803.6)
... direction: vertical
... mainAxisAlignment: start
... mainAxisSize: max
... crossAxisAlignment: center
... verticalDirection: down
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
====================================================================================================
Reloaded 19 of 804 libraries in 1,051ms.
So since it said type 'int' in not a subset of type 'double' I changed the variables to num but still this error is coming.
This is my code-
import 'package:flutter/material.dart';
import 'package:activepeers_app_internship/quizScreens/quiz_screen.dart';
class IntroPage extends StatefulWidget {
const IntroPage({Key? key}) : super(key: key);
@override
State<IntroPage> createState() => _IntroPageState();
}
class _IntroPageState extends State<IntroPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body:
Center(
child: Column(
children: [
SizedBox(
height: 70,
),
Padding(padding: EdgeInsets.all(16),
child: Image.asset("assets/logo3.png", fit: BoxFit.cover)),
SizedBox(
height: 70,
),
Text(
"Introduction",
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 20,
),
Text("Take a couple minutes to\n introduce yourselves.",
style: TextStyle(
fontSize: 26,
),
),
SizedBox(
height: 70,
),
TweenAnimationBuilder(
tween: Tween(begin: 120.0, end: 0),
duration: Duration(seconds: 120),
builder: (context, value, child) {
num val = value as double;
num time = val;
num min = (time/60).floor();
num sec = (time`).floor();
return Text(
sec>=0 && sec<10?"$min:0$sec":"$min:$sec",
style: TextStyle(
fontSize: 80,
fontWeight: FontWeight.bold,
),
);
},
onEnd: () {
print('all done');
},
),
SizedBox(
height: 70,
),
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Color(0xff16A085),
padding:
EdgeInsets.symmetric(horizontal: 50, vertical: 20),
textStyle:
TextStyle(fontSize: 30, fontWeight: FontWeight.bold)),
onPressed: () {Navigator.push(
context,
MaterialPageRoute(builder: (context) => QuizScreen()),
);},
child: Text(
"Ready now! First question please!",
style: TextStyle(
fontSize: 24,
),
)),
],
),
)
);
}
}
What am I doing wrong? Or is there another simpler way of showing the countdown timer?
CodePudding user response:
You have to write this statement like this
Tween(begin: 120.0, end: 0.0)
instead of it
Tween(begin: 120.0, end: 0)
because any Tween animation accept only double value not int value so modify it then check output