小编ASA*_*EED的帖子

Flutter中如何从子控件调用父控件函数

我有一个父 StatefulWidget 和子 StatefulWidget。goToPreviousItem我想从子窗口小部件调用父窗口小部件的函数。

家长班

class Parent extends StatefulWidget {
 @override
 _ParentState createState() => _ParentState();
 }

class _ParentState extends State<Parent> {
 String item = 0;
 @override
 Widget build(BuildContext context) {
   return ChildClass();
 }


goToPreviousItem(value){
 setState(() {item = value});
 }
}
Run Code Online (Sandbox Code Playgroud)

儿童班

class Child extends StatefulWidget {
 @override
 _ChildState createState() => _ChildState();
 }

class _ChildState extends State<Child> {
 @override
 Widget build(BuildContext context) {
   return Container(
  child: FlatButton(
    color: Color(0XFFEFEFEF),
    textColor: primaryColor,
    disabledColor: Colors.grey,
    disabledTextColor: Colors.black,
    padding: EdgeInsets.symmetric(
        vertical: 15.0, …
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-layout flutter-web

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

未找到 GoogleService-Info.plist 文件且未以编程方式提供 clientId

我尝试使用 flutterfire 命令行工具将 firebase 添加到我的 flutter 项目中。我正在使用 firebase 的 Google 身份验证服务并调用SignIn函数,它给出以下错误。ios文件夹中有GoogleService-Info.plist文件。

Unhandled Exception: PlatformException(missing-config, GoogleService-Info.plist file not found and clientId was not provided programmatically., null, null)
    #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
    #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:18)
    <asynchronous suspension>
    #2      GoogleSignInPlatform.initWithParams (package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart:98:5)
    <asynchronous suspension>
    #3      GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:267:5)
    <asynchronous suspension>
    #4      GoogleSignIn.signIn.isCanceled (package:google_sign_in/google_sign_in.dart:402:5)
Run Code Online (Sandbox Code Playgroud)

ios firebase firebase-authentication flutter

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

使用勇敢的浏览器调试flutter web app

我刚刚开始flutter web我想使用勇敢的浏览器来调试我的 Flutter 应用程序,而不是 chrome 或 edge。

当我使用flutter devices命令时,它给出了以下结果。

No devices detected.

Run "flutter emulators" to list and start any available device emulators.
Run Code Online (Sandbox Code Playgroud)

我通过使用网络服务器提供的链接来使用勇敢,但它不支持hot reload.

那么,如何使用 flutter web 配置 chrome 或 edge 以外的浏览器以获得完整的功能。

dart flutter flutter-web flutter-debug flutter-devtools

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

FastApi:422 无法处理的实体

我在尝试接受迂腐模型时遇到此错误。经过一段时间的调试后,我相信问题出在接受上CodeCreate

悬垂模型

class BaseCode(BaseModel):
    index: Optional[int] = Field(None)
    email: EmailStr
    gen_time: datetime
    expire_time: datetime


class CodeCreate(BaseCode):
    code: int
    used_time: Optional[datetime] = Field(None)

    class Config:
        orm_mode = True

class Message(BaseModel):
    message: str
Run Code Online (Sandbox Code Playgroud)

代码 ORM

class Code(Base):
    __tablename__ = 'code'

    index = Column(Integer, primary_key=True, autoincrement=True)
    code = Column(Integer)
    email = Column(String, ForeignKey('user.email'))
    gen_time = Column(DateTime)
    expire_time = Column(DateTime)
    used_time = Column(DateTime, nullable=True)
Run Code Online (Sandbox Code Playgroud)

处理程序

@app.post('/verify-code', response_model=schemas.Message, responses={404: {"model": schemas.Message}, 406: {"model": schemas.Message}})
async def verify_code(code: schemas.CodeCreate, response: Response, device_name: str = Body(..., …
Run Code Online (Sandbox Code Playgroud)

python http-status-code-422 pydantic fastapi

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

发布模式下 quick_actions 插件的 MissingPluginException

我最近添加的 quick_actions 插件在调试模式下工作正常,但在发布模式下显示空白屏幕。

在日志中发现了这些问题。

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getLaunchAction on channel plugins.flutter.io/quick_actions)
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157)
    <asynchronous suspension>
    #1      QuickActions.initialize (package:quick_actions/quick_actions.dart:68)

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method setShortcutItems on channel plugins.flutter.io/quick_actions)
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157)
Run Code Online (Sandbox Code Playgroud)

quickaction flutter flutter-dependencies flutter-release

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