小编kos*_*cki的帖子

Flutter - 代码签名错误:找不到“com.xxx.yourApp”的配置文件

IntelliJ CE 版本升级后,我开始在 Flutter 项目编译期间出错。

Code Signing Error: No profiles for 'com.xxx.yourApp' were found

完整的错误堆栈:

  Flutter
  Code Signing Error: No profiles for 'com.xxx.yourApp' were found


  === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
  Code Signing Error: No profiles for 'com.xxx.yourApp' were found:  Xcode couldn't find any iOS App Development provisioning profiles matching 'com.xxx.yourApp'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
  The use of Swift 3 @objc …
Run Code Online (Sandbox Code Playgroud)

iphone compiler-errors ios flutter

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

使用 kotlin-android-extensions 从子模块导入视图时未解析的引用

当我尝试在多模块应用程序中使用 kotlin-android-extendions 的视图注入时,从 android.library 子模块注入视图时出现错误:

Unresolved reference: component_xyz_user_name
Run Code Online (Sandbox Code Playgroud)

我们有一个主应用模块和一个 android.library 子模块subm。应用模块引用 subm。这两个模块都使用数据绑定、kapt 和 android-extensions。

在两个模块中,gradle 文件都包含:

apply plugin: 'com.android.library' //or com.android.application
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    [...]

    dataBinding.enabled = true
    androidExtensions.experimental = true
}
Run Code Online (Sandbox Code Playgroud)

在 subm 库中,我们定义component_user_info.xml视图,定义如下:

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools">

    <data> [...] </data>

    <android.support.constraint.ConstraintLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
            android:id="@+id/component_xyz_user_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </android.support.constraint.ConstraintLayout>
</layout>
Run Code Online (Sandbox Code Playgroud)

其中component_xyz_user_name认为,我们在下一步会注入。

在主应用程序中,我们定义了一个fragment_main.xml视图,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<layout …
Run Code Online (Sandbox Code Playgroud)

android module inject kotlin kotlin-android-extensions

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

Flutter - 防止点击/点击事件通过视图层次结构传递

我正在寻找阻止点击/点击事件在视图层次结构中传播的最佳方法。假设我们有一个简单的场景,其中TextField装饰有一个“X”明文按钮

当我单击“X”按钮时,单击事件会传播到 TextField 的 onPressed()。

final _textEditingController = TextEditingController(text: "");

@override
Widget build(BuildContext context) {
  return TextFormField(
    controller: _textEditingController,
    onTap: onEditTextTapped,
    decoration: InputDecoration(
      suffixIcon: IconButton(
        onPressed: onClearTextClick,
        icon: Icon(
          Icons.clear,
          size: 20.0,
        ),
      ),
    ),
    style: TextStyle(fontWeight: FontWeight.normal, fontSize: 18),
  );
}

void onEditTextTapped() {
  print('TextField tapped');
}

void onClearTextClick() {
  print('clear text clicked');
}
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

结果是:

flutter: clear text clicked
flutter: TextField tapped
Run Code Online (Sandbox Code Playgroud)

我需要类似于 Androidandroid:clickable="true"或 Flutter 的东西AbsorbPointer …

onclick hierarchy onclicklistener flutter flutter-layout

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

所有子包的IntelliJ IDEA @ParametersAreNonnullByDefault

我使用IntelliJ的空检查机制来防止nullpointer崩溃.我已经使用答案成功将所有Java方法参数设置为@NonNull .

创建package-info.java之后,用于在Java中定义包注释.作为该包的直接后代的所有java文件都具有在我的Android Studio项目中具有默认@NonNull参数的方法.

在此输入图像描述

显而易见的问题是我需要为该包中的所有Java类定义@ParametersAreNonnullByDefault,即包括所有子包.

如何定义@ParametersAreNonnullByDefault以便它传播到所有子包java文件?我想默认使用@NonNull注释我的所有内部代码方法.

在此输入图像描述

/**
  * File: package-info.java
  * Make all method parameters @NonNull by default
  */
  @ParametersAreNonnullByDefault
  package com.intive.nearbyplaces.main;

  import javax.annotation.ParametersAreNonnullByDefault;
Run Code Online (Sandbox Code Playgroud)

java nullable intellij-idea non-nullable android-studio

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

Flutter:AnimatedContainer - 子部件的属性没有动画

我有一个简单的AnimatedWidget只有一个子小部件。

AnimatedContainer(
   duration: Duration(milliseconds: 2000),
   curve: Curves.bounceOut,
   decoration: BoxDecoration(
      color: Colors.purple,
   ),
   child: FlutterLogo(
     size: _boxSize,
   ),
),
Run Code Online (Sandbox Code Playgroud)

哪里_boxSize像这样被动画化:

void _startAnimation() => setState(() {
    _boxSize *= 1.7;
  });
Run Code Online (Sandbox Code Playgroud)

AnimatedContainer 然而,不适用于部件。您需要更改 的直接属性AnimatedContainer才能使动画正常工作。

这符合文档:

The [AnimatedContainer] will automatically animate between the old 
and new values of properties when they change using the provided curve 
and duration. Properties that are null are not animated. 
Its child and descendants are not animated.
Run Code Online (Sandbox Code Playgroud)

与 ALSO ABLE …

dart flutter flutter-animation

5
推荐指数
2
解决办法
4666
查看次数

在离子输入中强制2位小数精度

我想在离子输入中始终显示精确两位小数的数字.以便:

1.01
1.10
1.20
1.23
Run Code Online (Sandbox Code Playgroud)

显示为:1.1和1.2,但显示为1.10和1.20

我的模型是:

export class HomePage {
   public myValue:number;
}
Run Code Online (Sandbox Code Playgroud)

使用html文件如下:

<ion-content padding>
  <h3>Hello</h3>
  <ion-row margin-right="50px" margin-left="50px">
      <ion-input type="number" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" step="0.01"
                 [(ngModel)]="myValue" placeholder="0.00"></ion-input>
  </ion-row>
</ion-content>
Run Code Online (Sandbox Code Playgroud)

我也尝试过:

<ion-input type="number" step="0.01"
                     [(ngModel)]="myValue" placeholder="0.00"></ion-input>
Run Code Online (Sandbox Code Playgroud)

它适用于Web浏览器(MacOS,55.0.2883.95(64位)),但不适用于Android(在7.1上测试)

有什么建议?

typescript ionic-framework ionic2 ionic3 angular

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

Flutter:带有hintText的Cupertino TextField

我想在不导入材料主题的情况下添加提示文本CupertinoTextField。到现在为止我试过混合CupertinoTextField使用InputDecoration,如下所示:

CupertinoTextField(
   decoration: InputDecoration.collapsed(
       hintText: 'Enter you email'
   )
)
Run Code Online (Sandbox Code Playgroud)

导致以下错误:

The argument type 'InputDecoration' can't be assigned to the parameter type 'BoxDecoration'

在此处输入图片说明

hint flutter flutter-layout

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

RestController 中的 Spring SCALA 返回列表

如何在 Sprint @RestController 中返回 SCALA列表或序列。列表返回值未正确序列化

结果是:

[GET] http://localhost:9090/devices

{"empty":false,"traversableAgain":true}
Run Code Online (Sandbox Code Playgroud)

我是否需要导入 Jackson ObjectMappercom.fasterxml.jackson才能在列表上进行正确的 REST 获取结果序列化?

我的 RestController 看起来像这样:

@RestController
class DeviceController {

  var devices = Set[Device]()

  @RequestMapping(value = Array("/devices"), method = Array(RequestMethod.GET))
  def accounts() : List[Device] =  devices.toList
}
Run Code Online (Sandbox Code Playgroud)

rest serialization spring json scala

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

Vaadin 8 - 包含字符串内容的文本文件的下载按钮

我想将String内容分配给变量并使用户能够将该字符串下载为文本文件。我知道FileDownloader我可以使用 Vaadin 8 中的内容,但我不需要静态文件/图像下载功能,而是需要可以在浏览器中下载文本文件的动态字符串内容。

scala stream vaadin vaadin8

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

Kotlin - nullable属性默认为null值

假设我定义了一个具有可空属性的类

class ABC {
   var myProperty: String? = null
}
Run Code Online (Sandbox Code Playgroud)

有没有办法将其默认为空值?也许类似于SCALA?

var myProperty: String? = _  // compilation error
Run Code Online (Sandbox Code Playgroud)

或者干脆:

var myProperty: String?  // compilation error
Run Code Online (Sandbox Code Playgroud)

我知道我们可以使用一个来自Kotlin 1.2 的lateinit变量,可以稍后检查启动,如下所示:

lateinit var myProperty: String

if (::myProperty.isInitialized) {
   //value is not-null
}
Run Code Online (Sandbox Code Playgroud)

那么晚了首选的方式呢?是否可以默认为空值或者故意省略它?

nullable properties kotlin

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

Flutter 强制更高的包依赖版本

TLDR:如何为整个应用程序强制使用特定的Flutter(库)版本

假设我的pubspec.yaml文件中有以下依赖项:

dependencies:
  flutter:
    sdk: flutter

  datetime_picker_formfield: 0.4.3
  date_utils: 0.1.0+3
  intl: 0.15.8
Run Code Online (Sandbox Code Playgroud)

这给了我一个版本冲突错误:

Because flutter_app depends on date_utils 0.1.0+3 
which depends on intl ^0.16.0, intl ^0.16.0 is required.
Run Code Online (Sandbox Code Playgroud)

但是当我们将 intl 更改为时,intl: 0.15.8我们得到:

Because flutter_app depends on datetime_picker_formfield 0.4.3 
which depends on intl ^0.15.8, intl ^0.15.8 is required.
Run Code Online (Sandbox Code Playgroud)

如何强制intl: 0.16.0datetime_picker_formfielddate_utils包?

versioning version flutter flutter-dependencies flutter-packages

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

Flutter:DateTime 作为改造方法中的参数;DateTime ISO 8061 序列化;改造日期iso8061格式

我想定义一个方法如下:

@GET("/users")
@Headers(<String, dynamic>{"Accept": "application/json", "Authorization": "Basic " + authKey})
Future<List<User>> getUsers(@Query("fromDate") DateTime from, @Query("toDate") DateTime to);
Run Code Online (Sandbox Code Playgroud)

这样DateTime 参数就被序列化为 ISO8061格式,输出查询如下所示:

[获取] https://address.com/users?fromDate=2021-02-21T12:00:00.000Z&toDate=2021-02-27T12:00:00.000Z

我已经在使用 Flutter Retrofit lib (内部使用 Flutter dio)。

我怎样才能做到这一点?

rest datetime retrofit flutter dio

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

Flutter中的JSON ObjectMapper

我想在Flutter中从JSON序列化/反序列化对象.我知道我可以使用来自这给我字符串基于密钥的LinkedHashMap,但我更感兴趣的是ObjectMapper的方法,使我能够得到输入从反序列化反应.JsonDecoderjson.dart

我尝试使用Flutter的redstone mapper(链接)和可导出的库(链接) - 这两个我都无法正确编译.我相信这个问题与Dart的反射库有关.

如何使用Flutter实现工作的Object-Json Mapper?

示例代码:

class A {

  @Field()
  String b;
}

import 'package:redstone_mapper/mapper.dart';
import 'package:redstone_mapper/mapper_factory.dart';

bootstrapMapper();
var desObj = decodeJson(jsonString, A);
Run Code Online (Sandbox Code Playgroud)

错误:

Starting device daemon...
Running lib/main.dart on Nexus 5X...
Dart snapshot generator failed with exit code 254
Errors encountered while loading: 'dart:mirrors': error: line 1 pos 1: unexpected token 'Unhandled'
Run Code Online (Sandbox Code Playgroud)

或者这个:

Error detected in application source code: …
Run Code Online (Sandbox Code Playgroud)

json jsonserializer dart flutter objectmapper

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