我尝试添加文本编辑格式选项,就像在 Gmail 应用程序中一样。但是当突出显示文本时,没有格式选项。是否可以处理选择警报?(复制/剪切/粘贴)。或者有没有办法像gmail一样添加格式栏?
TextField(
controller: _categoryController,
decoration: InputDecoration(
border: InputBorder.none,
hintText: "Enter Category Name",
),
),
Run Code Online (Sandbox Code Playgroud)
我添加了屏幕截图和 gif 文件以更好地理解我的问题。
在我的 Flutter 应用程序上选择选项
在 Gmail 应用程序上选择选项
$ flutter devices
显示以下结果。
$ flutter devices\n1 connected device:\n\nmy_iPhone \xe2\x80\xa2 <UDID> \xe2\x80\xa2 ios \xe2\x80\xa2 iOS 12.3.1\n
Run Code Online (Sandbox Code Playgroud)\n\n但是,Android Studio 未检测到此 iphone。\nAndroid Studio GUI 显示 。\n我可以知道如何修复它吗???
\n\n$ flutter doctor
显示没有问题。
如何创建上面的自定义clipPath小部件?(我附上了截图)
我试过了,但它不是确切的输出
快船类
class MessageClipper extends CustomClipper<Path> {
final double borderRadius = 15;
@override
Path getClip(Size size) {
double width = size.width;
double height = size.height;
double rheight = height - height / 3;
double oneThird = width / 3;
final path = Path()
..lineTo(0, rheight - borderRadius)
..cubicTo(0, rheight - borderRadius, 0, rheight, borderRadius, rheight)
..lineTo(oneThird, rheight)
..lineTo(width/2-borderRadius, height-borderRadius)
..cubicTo(width / 2 - borderRadius, height - borderRadius, width / 2,
height, width / 2 + borderRadius, height - borderRadius …
Run Code Online (Sandbox Code Playgroud) 有没有办法在不使用循环的情况下在两个列表之间找到唯一值?
List<String> first = ['A','B','C','D'];
List<String> second = ['B','D'];
Run Code Online (Sandbox Code Playgroud)
我需要的结果是这样的:
result = ['A','C'];
Run Code Online (Sandbox Code Playgroud) 是否可以使用 Jenkins 和 Flutter 创建构建发布到 Play 商店的管道?我需要为生产/开发构建一个版本来播放商店。
我真的开始使用python了。我从互联网下载项目。但是当我尝试运行时,出现了这些错误。我认为该项目不支持我的安装模块。如何解决这个问题?
错误
回溯(最近一次调用):文件“compare.py”,第 20 行,在 sift = cv2.xfeatures2d.SIFT_create() cv2.error: OpenCV(4.2.0) /Users/travis/build/skvark/opencv-python /opencv_contrib/modules/xfeatures2d/src/sift.cpp:1210: error: (-213:The function/feature is not implementation) 这个算法是专利的,被排除在这个配置中;设置 OPENCV_ENABLE_NONFREE CMake 选项并在函数“create”中重建库
完整代码
import cv2
import numpy as np
original = cv2.imread("images/original_golden_bridge.jpg")
image_to_compare = cv2.imread("images/george-washington-bridge.jpg")
# 1) Check if 2 images are equals
if original.shape == image_to_compare.shape:
print("The images have same size and channels")
difference = cv2.subtract(original, image_to_compare)
b, g, r = cv2.split(difference)
if cv2.countNonZero(b) == 0 and cv2.countNonZero(g) == 0 and cv2.countNonZero(r) == 0:
print("The images are completely Equal") …
Run Code Online (Sandbox Code Playgroud) 我目前正在手动执行此过程。这是一个示例数据类。有没有办法自动生成?
class RideModel {
final String docId;
final bool hasRequest;
final String rideCollectionId;
final String vehicleTypeId;
final double corporationRate;
final double driverRate;
final double driverInsurance;
final double passengerInsurance;
final List startUpCharge;
final double waitingCharge;
final double normalCharge;
RideModel({this.docId, this.hasRequest, this.rideCollectionId,this.vehicleTypeId, this.corporationRate, this.driverRate, this.driverInsurance, this.passengerInsurance, this.startUpCharge, this.waitingCharge, this.normalCharge});
factory RideModel.fromFirestore(DocumentSnapshot doc) {
var data = doc.data;
return RideModel(
docId: data['docId'],
hasRequest: data['hasRequest'],
rideCollectionId: data['rideCollectionId'],
vehicleTypeId: data['tripDetails']['vehicleType']['vehicleTypeId'],
corporationRate: data['tripDetails']['vehicleType']['corporation'].toDouble()??0.0,
driverRate: data['tripDetails']['vehicleType']['driver'].toDouble()??0.0,
driverInsurance: data['tripDetails']['vehicleType']['driverInsurance'].toDouble()??0.0,
passengerInsurance: data['tripDetails']['vehicleType']['passengerInsurance'].toDouble()??0.0,
normalCharge: data['tripDetails']['vehicleType']['normalCharge'].toDouble()??0.0,
startUpCharge: data['tripDetails']['vehicleType']['startUpCharge']??[],
waitingCharge: data['tripDetails']['vehicleType']['waitingCharge'].toDouble()??0.0);
} …
Run Code Online (Sandbox Code Playgroud) 是否可以添加相同类型的多个 ChangeNotifierProvider?
return MultiProvider(
providers: [
ChangeNotifierProvider<ValueNotifier<double>>(
create: (_) => ValueNotifier<double>(0.0),
),
ChangeNotifierProvider<ValueNotifier<double>>(
create: (_) => ValueNotifier<double>(0.0),
),
],
Run Code Online (Sandbox Code Playgroud)
在我的构建方法中
@override
Widget build(BuildContext context) {
ValueNotifier<double> firstNotifier = Provider.of(context, listen: true);
ValueNotifier<double> secondNotifier = Provider.of(context, listen: true);
print('First value ${firstNotifier.value} Second value ${secondNotifier.value}');
...
onTap:(){
firstNotifier.value = 10.0;
secondNotifier.value = 30.0;
}
Run Code Online (Sandbox Code Playgroud)
两个打印值相同 第一个值为 10 第二个值为 10
如何禁用从 firestore 上的缓存获取/流数据?
我看到了这篇文章。该功能默认启用PersistenceEnabled
这样是不是就可以清除缓存了?
void main() async {
await Firebase.initializeApp();
await FirebaseFirestore.instance.clearPersistence();
Run Code Online (Sandbox Code Playgroud)
或者
是否需要添加到每个查询中?
Future<List<BookModel>> _getBooks() async {
await FirebaseFirestore.instance.clearPersistence();
return _db.collection('books')...
}
Run Code Online (Sandbox Code Playgroud)
或者
如何始终禁用 firestore 上的缓存?
这是对的吗?
void main() async {
await Firebase.initializeApp();
FirebaseFirestore.instance.settings =
Settings(
persistenceEnabled: false,
cacheSizeBytes: ?,//is it need add this fields too?
host: ?,
sslEnabled: ?
Run Code Online (Sandbox Code Playgroud)
);
我使用firebase_auth
package 来处理 flutter。我使用电话身份验证进行登录。一切正常。但是当注销用户不会在 firebase 上删除时。
是否可以删除firebase用户?
RaisedButton(
onPressed: () async {
await FirebaseAuth.instance.signOut();
}
)
Run Code Online (Sandbox Code Playgroud)
我尝试了这种方法,但错误来了..
删除名为 null
_auth.onAuthStateChanged.listen((currentUser)=>{
currentUser.delete()
}).onError((e)=>print("Error is $e"));
Run Code Online (Sandbox Code Playgroud) flutter ×9
dart ×7
firebase ×3
android ×1
ios ×1
jenkins ×1
opencv ×1
python ×1
python-2.7 ×1
python-3.x ×1