小编Rad*_*ers的帖子

Flutter - Flutter 中 Admob 的factoryId 是什么?

我正在使用这个插件

\n

这个插件中Admob的factoryId是什么..

\n

我在哪里可以获得 admob 广告的factoryId?

\n

因为当我尝试调用原生广告时我收到此错误

\n
E/flutter (19354): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(NativeAdError, Can\'t find NativeAdFactory with id: FLTGoogleMobileAdsPlugin, null, null)\nE/flutter (19354): #0      StandardMethodCodec.decodeEnvelope\npackage:flutter/\xe2\x80\xa6/services/message_codecs.dart:581\nE/flutter (19354): #1      MethodChannel._invokeMethod\npackage:flutter/\xe2\x80\xa6/services/platform_channel.dart:158\nE/flutter (19354): <asynchronous suspension>\nE/flutter (19354): #2      NativeAd.load\npackage:google_mobile_ads/src/ad_containers.dart:576\nE/flutter (19354): <asynchronous suspension>\nE/flutter (19354):\n
Run Code Online (Sandbox Code Playgroud)\n

这是我的原生广告类

\n
\nclass NativeAdWidget extends StatefulWidget {\n  @override\n  State<StatefulWidget> createState() => NativeAdState();\n}\n\nclass NativeAdState extends State<NativeAdWidget> {\n  NativeAd _nativeAd;\n  final Completer<NativeAd> nativeAdCompleter = Completer<NativeAd>();\n\n  @override\n  void initState() {\n    super.initState();\n    _nativeAd = NativeAd(\n      adUnitId: NativeAd.testAdUnitId,\n      request: AdRequest(),\n      factoryId: …
Run Code Online (Sandbox Code Playgroud)

admob flutter

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

Flutter - 在构建期间调用 setState() 或 markNeedsBuild()

从 Firebase Cloud 加载帖子时显示错误。我在我的应用程序中使用提供程序

\n
setState() or markNeedsBuild() called during build.\n
Run Code Online (Sandbox Code Playgroud)\n

详细错误

\n
\n\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90 Exception caught by foundation library \xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nThe following assertion was thrown while dispatching notifications for PostFunctions:\nsetState() or markNeedsBuild() called during build.\n\nThis _InheritedProviderScope<PostFunctions> widget cannot be marked as needing to build because the framework is already in the process of building widgets.  A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception …
Run Code Online (Sandbox Code Playgroud)

provider flutter google-cloud-firestore

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

Flutter:“String”类型不是“DateTime”类型的子类型

我想从 mysql 获取时间戳并将其更改为时间前我的时间戳如下所示:

2021-03-04 06:06:48
Run Code Online (Sandbox Code Playgroud)

在颤振中:

[{id: 1, caption: first post, useruid: b0zbRHZEKMbGSdNoVSjI0gsxXTX2, time: 2021-03-04 06:06:48,}],
Run Code Online (Sandbox Code Playgroud)

错误类型“字符串”不是“日期时间”类型的子类型

在这里,我在此插件的帮助下调用将我的日期和时间更改为 timeago ..

ListView(
        children: snapshot.data.map<Widget>((document) {
      Provider.of<PostFunctions>(context, listen: false)
          .showTimeAgo(document['time']);
return My Other Code...
)


I show like this in My Text
Run Code Online (Sandbox Code Playgroud)
' , ${Provider.of<PostFunctions>(context, listen: false).getImageTimePosted.toString()}'
Run Code Online (Sandbox Code Playgroud)

我在这里更改我的日期和时间

  showTimeAgo(dynamic timedata) {
    print(timedata);

    imageTimePosted = timeago.format(timedata);
    print(' my time posted ***** $imageTimePosted');
    notifyListeners();
  }
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

plugins timeago flutter

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

Flutter - showModalBottomSheet 底部的 RenderFlex 溢出 190 像素

我的 showModalBottomSheet 显示底部溢出错误:\n我的 BottomSheet 代码:

\n
 loginSheet(BuildContext context) {\n    return showModalBottomSheet(\n        isScrollControlled: true,\n        context: context,\n        builder: (context) {\n          return Padding(\n            padding: EdgeInsets.only(\n              bottom: MediaQuery.of(context).viewInsets.bottom,\n            ),\n            child: Container(\n              height: MediaQuery.of(context).size.height * 0.30,\n              width: MediaQuery.of(context).size.width,\n              child: Column(\n                children: [\n                  Padding(\n                    padding: EdgeInsets.symmetric(horizontal: 150.0),\n                    child: Divider(\n                      thickness: 4.0,\n                      color: constantColors.whiteColor,\n                    ),\n                  ),\n                  Padding(\n                    padding: EdgeInsets.symmetric(horizontal: 10.0),\n                    child: TextField(\n                      controller: userEmailController,\n                      decoration: InputDecoration(\n                        hintText: \'Enter Email...\',\n                        hintStyle: TextStyle(\n                          color: constantColors.whiteColor,\n                          fontWeight: FontWeight.bold,\n                          fontSize: 16.0,\n                        ),\n                      ),\n                      style: TextStyle(\n                        color: constantColors.whiteColor,\n                        fontWeight: FontWeight.bold,\n                        fontSize: 18.0,\n …
Run Code Online (Sandbox Code Playgroud)

provider dart flutter

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