小编pro*_*ion的帖子

如何检查相机是否在颤动中自动对焦?

我正在为我的颤振应用程序使用相机插件,如何检查相机预览是否聚焦?

camera autofocus flutter

6
推荐指数
1
解决办法
3089
查看次数

如何使用 firebase_auth(电话身份验证)在 Flutter 应用程序中添加短信自动验证?

在我的 flutter 应用程序中,我使用Firebase电话身份验证进行登录。总而言之,它完美地工作。通过使用我当前的代码,我必须在收到代码时明确添加短信代码。

如何在我的 Flutter 应用程序中自动进行此短信验证?

    Future<void> _sendCodeToPhoneNumber() async {

    final String phone = country + phoneNumberController.text;

    final PhoneVerificationCompleted verificationCompleted =
        (AuthCredential credential) {
      setState(() {
        print(
            'Inside _sendCodeToPhoneNumber: signInWithPhoneNumber auto succeeded: $credential');
      });
    };

    final PhoneVerificationFailed verificationFailed =
        (AuthException authException) {
      setState(() {
        print(
            'Phone number verification failed. Code: ${authException.code}. Message: ${authException.message}');
      });
    };

    final PhoneCodeSent codeSent =
        (String verificationId, [int forceResendingToken]) async {
      this._verificationId = verificationId;
      print("code sent to " + phone);
      setState(() { …
Run Code Online (Sandbox Code Playgroud)

dart firebase-authentication flutter

5
推荐指数
1
解决办法
8456
查看次数

Apple开发者协议中的提交按钮没有响应

ScreenShot我尝试为我的mac下载Xcode,在安装过程中我必须确认苹果开发者协议.但在同意条款和条件后,提交按钮没有响应.我使用的是OS 10.10.5和safari 10.0.2版本.所以我无法继续下载相同的内容.你能帮助我吗?

safari xcode ios xcode7

4
推荐指数
1
解决办法
2411
查看次数

如何从flutter应用程序将图像共享到whatsapp?

我必须将我的颤振应用程序中的图像直接发送到 whatsapp。启动whatsapp后,我想选择要分享图像的联系人。这在颤振中怎么可能?

我尝试使用 url_launcher,但它正在启动指定的联系人。而且我在任何地方都找不到共享选项。

  const url = 'whatsapp://send?phone=$phone';
   if (await URLLauncher.canLaunch(url)) {
     await URLLauncher.launch(url);
   } 
   else {
     throw 'Could not launch $url';
   }
Run Code Online (Sandbox Code Playgroud)

whatsapp flutter

4
推荐指数
1
解决办法
9274
查看次数

如何在颤振中解析地图 Json 列表?

在此处输入图片说明在此处输入图片说明在此处输入图片说明我有一个带有三张地图的 Json 结构,一个是产品列表,然后是总计和税收。我必须在颤振中解析这个 json 结构。我在模型类上创建。现在我在类型转换中遇到错误。

如何解决这个问题?

JSON 结构:

{
  "products" : [
     {                  
       "cart_id": "7",      
     },          
     {                  
       "cart_id": "7",
     }     
  ],
  "total": 100,
  "tax": 100
}
Run Code Online (Sandbox Code Playgroud)

模型类:

class CartModel {   
    List<Product> produtcts;
    double total;

    CartModel({this.produtcts, this.total});

    factory CartModel.fromJson(Map<String, dynamic> json) {
        var list = json['products'] as List;
        print(list.runtimeType);
        List<Product> products = list.map((i) => 
           Product.fromJson(i)).toList();

        return CartModel(
            produtcts: products, total: json['total'],);
    }
}

class Product {
    String cartId;

    Product({this.cartId,});

    factory Product.fromJson(Map<String, dynamic> json) {
        return Product(     
            productId: json['cart_id'],
        );
    }
}
Run Code Online (Sandbox Code Playgroud)

json flutter

2
推荐指数
1
解决办法
8521
查看次数

当我尝试运行应用程序时,构建失败

我有错误,如"错误:任务执行失败":app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/google/android/gms/internal/zzpm $ zza $ zza.class"

我该怎么做才能消除这个错误

gradle这个

apply plugin: 'com.android.application'


 android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"



defaultConfig {
    applicationId "com.example.user.merchant"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

  dependencies {
   compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.0'
   compile 'com.android.support:design:23.2.0'
   compile 'com.android.support:support-v4:23.2.0'
   compile 'com.android.volley:volley:1.0.0'
   compile 'com.google.android.gms:play-services-appindexing:8.4.0'
   compile 'com.google.android.gms:play-services-gcm:8.4.0'
    //compile files('libs/google-play-services.jar')

   }
Run Code Online (Sandbox Code Playgroud)

android google-cloud-messaging

1
推荐指数
1
解决办法
1284
查看次数