小编chi*_*chi的帖子

Flutter:类 AppleTypeCRetimerRestoreInfoHelper 仅在“flutter run”时在两个错误中实现

   objc[88755]: Class AppleTypeCRetimerRestoreInfoHelper is implemented in both
    /usr/lib/libauthinstall.dylib (0x1efb3deb0) and
    /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versi
    ons/A/MobileDevice (0x103a344f8). One of the two will be used. Which one is
    undefined.
    objc[88755]: Class AppleTypeCRetimerFirmwareAggregateRequestCreator is
    implemented in both /usr/lib/libauthinstall.dylib (0x1efb3df00) and
    /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versi
    ons/A/MobileDevice (0x103a34548). One of the two will be used. Which one is
    undefined.
    objc[88755]: Class AppleTypeCRetimerFirmwareRequestCreator is implemented in
    both /usr/lib/libauthinstall.dylib (0x1efb3df50) and
    /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versi
    ons/A/MobileDevice (0x103a34598). One of the two will be used. Which one is
    undefined.
    objc[88755]: Class ATCRTRestoreInfoFTABFile is implemented in both
    /usr/lib/libauthinstall.dylib …
Run Code Online (Sandbox Code Playgroud)

flutter

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

Flutter:数据库被锁定 可能有两个并发构建在同一文件系统位置运行

尝试通过执行以下操作在我的两个 iOS 设备上运行该应用程序flutter run -d all。但是,我收到database is locked Possibly there are two concurrent builds running in the same filesystem location.错误。

我尝试过什么

  • flutter clean
  • flutter run分别地
  • 在 iPad 上的终端上运行应用程序以及在 iPhone 上的 xCode 上运行应用程序

因此,我在两个 iOS 设备上同时运行 Flutter 应用程序时遇到了问题。

有什么解决办法吗?

xcode flutter

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

Flutter:如何处理 Flutter 和 API + MongoDB 命名约定不同以及名称不匹配的情况?

我一直在处理涉及 Flutter 和 MongoDB + API 的个人项目。看起来当单词中有空格时,API 倾向于使用_. 喜欢picture_url。当我尝试Model在 Flutter 中创建一个时。我收到这条Name non-constant identifiers using lowerCamelCase.dart(non_constant_identifier_names)消息。而且,许多都使用String prictureUrl格式。

在 Flutter 网站上,它有json_serialization示例https://flutter.dev/docs/development/data-and-backend/json。而且,它有没有空格的文字。但是,如果我的apis发送picture_url和Flutter上的模型设置为pictureUrl,我如何使用模型转换它?

或者说,业内人士如何处理这个问题?他们在后端和前端设置名称的方式相同吗?

- - 编辑

@JsonSerializable()
class User {
  User(this.profileUrl, this.email);

  String profileUrl;
  String email;

  factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);

  Map<String, dynamic> toJson() => _$UserToJson(this);
}
Run Code Online (Sandbox Code Playgroud)

flutter

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

Flutter:FCM 未处理异常:对空值使用空检查运算符

E/flutter (26872): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] 未处理的异常:空值上使用的空检查运算符 E/flutter (26872): #0
MethodChannelFirebaseMessaging.registerBackgroundMessageHandler (package:firebase_messaging_platform_interface /src/method_channel/method_channel_messaging.dart:173:53) E/flutter (26872): #1
FirebaseMessagingPlatform.onBackgroundMessage= (package:firebase_messaging_platform_interface/src/platform_interface/platform_interface_messaging.dart:108:16)

// Background Messaging Set Up
    Future<void> _firebaseMessagingBackgroundHandler(
        RemoteMessage message) async {
      print('background message');
    }

    FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
    runApp(....)
Run Code Online (Sandbox Code Playgroud)

我在 Android 系统上收到此代码的错误。除非应用程序终止,否则一切正常。

什么适用于Android:

  • 终止时的通知,onBackground 和 onForeground
  • 仅在前台显示日期

什么在 Android 上不起作用:

  • 仅在 Terminated 和 onBackground 时的数据

什么在 iOS 上有效:

  • 终止时的通知,onBackground 和 onForeground
  • 仅在前台显示日期

什么在 iOS 上不起作用:

  • 数据仅在终止时,

我不知道为什么我在 Android 系统上收到空值错误,我该如何解决这个问题?另外,Data only当应用程序终止时,我无法在 iOS 上接收推送通知是真的吗?

push-notification flutter firebase-cloud-messaging

8
推荐指数
3
解决办法
2297
查看次数

如何为 MUI 分页“调整内容:中心”?

我正在尝试将分页的内容居中。然而,这是行不通的。在控制台上,我需要证明 ul 包装器的合理性,但我在 MUI 站点上找不到与分页道具相关的任何信息或如何使项目居中的指南。

import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Pagination from '@material-ui/lab/Pagination';

const useStyles = makeStyles((theme) => ({
  root: {
    '& > *': {
      marginTop: theme.spacing(2),
   
    },
  },
  pagination: {
    alignItems: 'center',
    justify: 'center',
  }
}));

const Paginated = (props) => {
  const classes = useStyles();
  return (
    <div className={classes.root}>
      <Pagination className={classes.pagination} count={props.totalPage} color='primary' />
    </div>
  );
};

export default Paginated;
Run Code Online (Sandbox Code Playgroud)

我也一直在尝试codesandbox。https://codesandbox.io/s/material-demo-zv1ps?file=/demo.js

有什么方法可以在没有额外的盒子或网格包装器来包装它的情况下做到这一点?

reactjs material-ui

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

Flutter:将 InkWell 制作成圆形

          Container(
            decoration: BoxDecoration(shape: BoxShape.circle),
            child: Material(
              color: Colors.orange,
              child: InkWell(
                splashColor: Colors.black,
                onTap: () {},
                child: Ink(
                  decoration: BoxDecoration(shape: BoxShape.circle),
                  height: Get.height * 0.0425,
                  width: Get.height * 0.0425,
                  child: Icon(Icons.holiday_village),
                ),
              ),
            ),
          ),
Run Code Online (Sandbox Code Playgroud)

我想把这个InkWell东西做成圆形。似乎没有什么可以使它循环。如果我取出Material(),则它不会显示背景颜色,也splash color不会出现。如何重塑此 Contaner - InkWell 圆形,以确保按钮是带有splashColor 的圆形?

flutter

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

之后尝试启动 React 时出错(项目依赖树可能有问题....)

我已经从 npx create-react-app 创建了 React App。而且,我尝试 cd 并启动该应用程序,它显示此错误。我也尝试过使用纱线并重新安装节点。我非常迷茫,因为它在 30 分钟前也在呼啸而过。我做的唯一一件事是 npm i -g npm 来更新 npm,从那时起它就不起作用了。

We suggest that you begin by typing:

  cd giact
  yarn start

Happy hacking!
gi@Gis-Macbook-Pro study % cd giact
gi@Gis-Macbook-Pro giact % npm start

> giact@0.1.0 start /Users/gi/Desktop/Study/giact
> react-scripts start


There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React …
Run Code Online (Sandbox Code Playgroud)

node.js npm reactjs

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

xs={false} 或 xs={0} 在 MUI React 中不起作用

我这里有视频和登录页面模板的代码。但是,正如您所看到的,它不起作用?它转到登录页面的顶部。当我使用图片时,它按照说明消失了。如何强制 xs={} 设置?

<Grid container component='main' className={classes.root}>
      <CssBaseline />
      <Grid item xs={false} sm={4} md={9}>
        <BackgroundVideo />
      </Grid>
      <Grid
        item
        xs={12}
        sm={8}
        md={3}
        component={Paper}
        elevation={6}
        square
        className={classes.formBackground}
      >
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

reactjs material-ui

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

Flutter:使用 GetX 刷新 ListView.Builder

我正在List of Cards根据toDoId的数量创建。

toDoController.toDo() 就像

toDo = [q1, r4, g4, d4].obs;
Run Code Online (Sandbox Code Playgroud)

而且,这是我的 ListView.builder()

  Obx(() {
         List _todo = toDoController.toDo();

         return ListView.builder(
         shrinkWrap: true,
         scrollDirection: Axis.horizontal,
         itemCount: _todo.length,
         itemBuilder: (BuildContext context, int i) {
                           
         var _loading = true;
         var _title = 'loading';
                          
         getTodoInfo() async {
         _title = await toDoController
                .getTodoInfo(
                     _todo[i]
                 );
         _loading = false;
         print(_title); // 'Clean!' <--- returns correct title
         }

         getTodoInfo();

         return Container(
           height: 150,
           width: 150,
           child: _loading
           ? Text(
             _title,
             )
             : Text(
             _title, …
Run Code Online (Sandbox Code Playgroud)

flutter getx flutter-getx

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

如何强制useEffect等待其他组件接收到数据?

我在网关组件中初始化用户数据,并通过 redux 存储将数据分发到其他组件。因此,如果用户直接访问其他组件,那么 Web 应用程序就会崩溃。

我想确保其他组件等待执行 useEffect,直到主组件中完成初始化。

“props.places”来自网关组件 -> redux 存储。我怎样才能强迫它们等待直到初始化?

  useEffect(() => {
    //convert incoming data to props
    console.log(props.places);
    let convert = [];
    for (const converted of props.places.results) {
      convert.push({
        lat: converted.coordinates.lat,
        lng: converted.coordinates.lng,
      });
    }

    setFacilities((facilities) => ({ ...facilities }, convert));
    console.log(facilities);
  }, [props.places]);
Run Code Online (Sandbox Code Playgroud)

reactjs react-redux react-hooks

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