小编Ita*_*igo的帖子

Flutter 需要 SDK 版本

我有这个错误:

在bingo360 中运行“flutter 包升级”...
当前 Dart SDK 版本为 2.1.2-dev.0.0.flutter-0a7dcf17eb。由于bingo360依赖flutter_launcher_icons >=0.7.1,需要SDK版本>=2.2.0 <3.0.0,版本解析失败。pub 升级失败 (1)

我的 pubspec.yaml 是:

environment:
sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

cupertino_icons: ^0.1.2
http: ^0.12.0+1
flutter_launcher_icons: "^0.7.2"

dev_dependencies:
  flutter_test:
  sdk: flutter
Run Code Online (Sandbox Code Playgroud)

我尝试更改为sdk: ">2.2.0 <3.0.0"但不起作用。

有什么建议吗?

flutter

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

如何使用 axios 获取本地文件?

我正在尝试获取本地文件:

结果.js:

componentWillMount(){
  axios.get('../config/db.json')
  .then(function(response){
    alert('ok');
  })
  .catch(function(error){
    alert('error');
  });
}
Run Code Online (Sandbox Code Playgroud)

但是,我收到一个错误:

尝试在空对象引用上调用虚拟方法 'boolean java.lang.String.equals(java.lang.Object)'

在此处输入图片说明

该文件存在于路径上

我的文件 db.json:

[{"id":"87","codigo":"00504.050.000.00.00","nomeCadastro":"GOIVO DOBRADO"},{"id":"86","codigo":"02023.050.000.10.02","nomeCadastro":"GERB ONEDIN"},{"id":"85","codigo":"00212.070.999.00.00","nomeCadastro":"CRIS SANT REAN"},{"id":"84","codigo":"01297.019.000.00.00","nomeCadastro":"ANTH VARIADO"}]
Run Code Online (Sandbox Code Playgroud)

react-native axios

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

停止setInterval,如果不起作用,则在本机函数中运行

我有下面的代码:

contaTempo(){
  setInterval(() => this.setState({tempo: this.state.tempo+1}), 1000)
  if (this.state.tempo >= 5) {
    this.props.navigation.navigate('Sobre')
  }
}
Run Code Online (Sandbox Code Playgroud)

setInterval正常工作,但if不起作用。此外,计时器必须停止。有什么帮助吗?

reactjs react-native

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

如何查看已安装的模块?

如何查看“npm install”命令安装的模块的完整列表?

例子: npm list react-native-modules

react-native

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

底部溢出使用 SingleChildScrollView

@override
Widget build(BuildContext context) {
return Scaffold(
  backgroundColor: Color(0xff003859),
  appBar: AppBar(
    title: Text(
      "Conversor de moedas 360",
      style: TextStyle(
        color: Color(0xff003859)
      )
    ),
    backgroundColor: Color(0xffffa300),
  ),
  body: FutureBuilder<Map>(
    future: getData(),
    builder: (context, snapshot) {
      switch(snapshot.connectionState){
        case ConnectionState.none:
        case ConnectionState.waiting:
        return Center(
          child: Text(
            "Carregando Dados...",
            style: TextStyle(
              color: Color(0xffffa300),
              fontSize: 25.0
            ),
            textAlign: TextAlign.center,
          )
        );
        default:
        if (snapshot.hasError){
          return Center(
              child: Text(
                "Erro ao carregar dados...",
                style: TextStyle(
                    color: Color(0xffffa300),
                    fontSize: 25.0
                ),
                textAlign: TextAlign.center,
              )
          );  
        } else …
Run Code Online (Sandbox Code Playgroud)

flutter

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

列出 WordPress 中的所有类别和所有帖子

我如何列出 WordPress 中的所有类别和所有帖子,如下例所示:

CATEGORY1
POSTS

CATEGORY2
POSTS

CATEGORY3
POSTS
Run Code Online (Sandbox Code Playgroud)

wordpress

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

如何在ComponentDidMount上关注TextInput?

我用:

ComponentDidMount(){
  this.foca()
}

foca = () => {
  this.refs.edit.focus()
}

<TextInput
  ref='edit'
  style={{height:60, borderColor:'gray', borderWidth:1, backgroundColor:'white', borderRadius:10}}
  onChangeText={(text) => this.setState({busca: text})}
  onSubmitEditing={(event) => this.props.navigation.navigate('Resultado', {busca: this.state.busca})}
/>
Run Code Online (Sandbox Code Playgroud)

但它不起作用......

我喜欢在显示屏幕时将注意力集中在我的TextInput上

react-native

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

比较delphi上的字符串获取错误不兼容的类型

我有这个代码:

if (conexao.FieldValues['complex'] = '02' and conexao.FieldValues['financ'] = '04') then
Run Code Online (Sandbox Code Playgroud)

conexao.FieldValues['complex']是一个字符串,'02'也是一个字符串,但是我收到一个错误:

不兼容的类型:'string'和'Boolean'

为什么?

delphi

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

标签 统计

react-native ×4

flutter ×2

axios ×1

delphi ×1

reactjs ×1

wordpress ×1