简体   繁体   English

如何从 dartz 只获得右手边的值?

[英]How to obtain only the right hand side value from dartz?

How to obtain only the right hand side value from dartz?如何从 dartz 只获得右手边的值?

the code is代码是

Some(EitherValue)

the output is: output 是:

Some(Right("hi")) 

How to get the value of hi without "Some(Right"?如何在没有“Some(Right”)的情况下获得 hi 的值?

EitherValue.getOrElse(() => ""); // the function should return the same type of Right hand side

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 Dart 中的 Either 类型轻松提取 Left 或 Right (Dartz) - How to extract Left or Right easily from Either type in Dart (Dartz) 如何在 Flutter App 的文本域右侧添加美元符号 - How to Add Dollar Sign on the RIght hand Side of the Textfield in Flutter App 如何从 flutter 中的 dartz package 为 Either<> 编写测试 - How to write tests for Either<> from dartz package in flutter 是否有任何类似的小部件或 function 从 flutter 的右侧从屏幕上弹出的“showModelBottomSheet”? - Is there any similar widget or function like 'showModelBottomSheet' that pop on screen from right hand side in flutter? 如何使用 Dartz“连接”Lefts - How to "concatenate" Lefts using Dartz Dart / Flutter列表中的左侧,右侧编译器错误 - Left Hand Side , Right Hand Side Compiler Errors in Dart / Flutter List 为什么我的 Stack 剪裁了图像的右侧? - Why is my Stack clipping the right-hand side of images? Flutter - 自定义小部件 - 如何从中获取值 - Flutter - Custom Widget - How to obtain a value from 如何使用 dartz 重构 flutter 中的功能错误处理 - How to refactor functional error handling in flutter with dartz 与 expect() function 比较时,包含 List 的 Dartz Right 会抛出错误 - Dartz Right containing List throws Error when comparing with expect() function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM