Mij*_*man 2 dart flutter rxdart flutter-getx
我正在玩扑扑,
\n我遇到错误并且没有得到任何正确的解决方案
\n在我的应用程序中,我的GetX控制器中有一些可观察的变量,当尝试应用某种格式然后在此处获取日志时
\n======== Exception caught by widgets library =======================================================\nThe following _TypeError was thrown building Obx(dirty, state: _ObxState#76641):\ntype \'int\' is not a subtype of type \'RxInt\' of \'function result\'\n\nThe relevant error-causing widget was: \n Obx file:///D:/flutter/mini_rupiya/lib/views/screens/payment.dart:84:17\nWhen the exception was thrown, this was the stack: \n#0 DepositController.total (package:mini_rupiya/controllers/deposit_controller.dart)\n#1 _PaymentState.build.<anonymous closure> (package:mini_rupiya/views/screens/payment.dart:84:145)\n#2 Obx.build (package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart:84:28)\n#3 _ObxState.notifyChilds (package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart:52:27)\n#4 _ObxState.build (package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart:68:41)\n...\n====================================================================================================\nReloaded 7 of 1033 libraries in 2,688ms.\n\n======== Exception caught by rendering library =====================================================\nThe following assertion was thrown during layout:\nA RenderFlex overflowed by 99736 pixels on the bottom.\n\nThe relevant error-causing widget was: \n Column file:///D:/flutter/mini_rupiya/lib/views/screens/payment.dart:38:20\nThe overflowing RenderFlex has an orientation of Axis.vertical.\nThe 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.\n\nConsider 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.\nThis 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.\n\nThe specific RenderFlex in question is: RenderFlex#d0b84 relayoutBoundary=up3 OVERFLOWING\n... needs compositing\n... parentData: offset=Offset(26.0, 26.0) (can use size)\n... constraints: BoxConstraints(0.0<=w<=359.4, 0.0<=h<=507.7)\n... size: Size(359.4, 507.7)\n... direction: vertical\n... mainAxisAlignment: center\n... mainAxisSize: max\n... crossAxisAlignment: center\n... verticalDirection: down\n\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\n====================================================================================================\nRun Code Online (Sandbox Code Playgroud)\n这是出现此错误的行
\nObx(() => Text("You will get : ${NumberFormat.currency(locale: \'HI\', name: "INR", symbol: "\\u{20B9}").format(_depositController.total.value.round()/100)}"))\nRun Code Online (Sandbox Code Playgroud)\n我正在使用intl包,在NumberFormat我将其转为.obs()在控制器上使用之前它工作正常
如果有人可以描述这一点,这将是一个很大的帮助
\ntype 'int' is not a subtype of type 'RxInt' of 'function result'
Run Code Online (Sandbox Code Playgroud)
表示该函数返回一个整数。不是 RxInt。
当给 Rx 类型赋值时,使用 value 属性。例子:
myInteger.value = 100;
Run Code Online (Sandbox Code Playgroud)
从 Rx Type 获取值时,
myInteger.value
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10422 次 |
| 最近记录: |