草庐IT

dart - Flutter调用showTimePicker函数报错: The getter 'modalBarrierDismissLabel' was called on null

@overrideWidgetbuild(BuildContextcontext){returnMaterialApp(home:Scaffold(appBar:AppBar(title:Text("HelloFlutter"),),body:Column(children:[GestureDetector(onTap:(){showTimePicker(context:context,initialTime:constTimeOfDay(hour:7,minute:0),);},child:Text("22:30"))像这样尝试将timePicker添加到我的Flutter应用程序中

dart - getter 'value' 在 null 上被调用

我正在尝试在flutter中创建此字体大小动画,但我收到以下错误:getter'value'wascalledonnull。这看起来很奇怪,因为我有另一个包含类似代码的dart文件并且它运行良好。如有任何帮助,我们将不胜感激。Animation_fontSizeAnimation;AnimationController_fontSizeAnimationController;初始化状态函数():super.initState();_fontSizeAnimationController=newAnimationController(duration:newDuration(millis

firebase - 我/flutter (14318) : NoSuchMethodError: Class 'FirebaseUser' has no instance getter 'firstname'

我正在尝试更新我正在构建的应用程序用户的用户配置文件。用户信息存储在firebase中,应用程序在运行在android上的dart中编码。我已经尝试实现来自https://firebase.google.com/docs/auth/web/manage-users的示例网站。51createUser(){52if(checkFields()){53//PerformLogin54varuser=FirebaseAuth.instance.currentUser();55FirebaseAuth.instance56.createUserWithEmailAndPassword(emai

dart - getter 中的 future 对象

我在我的getter中为我的Locale变量调用一个future对象。如何让返回值等待呢?classChangeLocalewithChangeNotifier{Locale_locale;Localegetlocale{getLanguage().then((LocaleprefLocale){_locale=prefLocale;});return_locale;}setlocale(LocalenewValue){print(newValue);_locale=newValue;notifyListeners();}} 最佳答案

dart - 没有声明顶级 getter <className>

我正在扩展flutter_gallery示例。我尝试创建新的画廊项目newGalleryItem(title:'Journal',subtitle:'Exampleappcoding',category:'Apps',routeName:JournalDemo.routeName,buildRoute:(BuildContextcontext)=>newJournalDemo()),我导入了import'../journal/journal_all.dart';里面我有export'journal_demo.dart';JournalDemo类和ListDemo是同一个类,我只改了类名

dart - flutter.io "NoSuchMethodError: The getter ' isMacOS' 被调用为空。”

我一直想玩flutter.io有一段时间了,今天开始安装它。我正在关注flutter网站上的入门页面,但在运行“flutterdoctor”时遇到以下错误消息……我做错了什么吗?或者解决这个问题的解决方法?Oops;flutterhasexitedunexpectedly.SendingcrashreporttoGoogle.Crashreportsent(reportID:8a4b9d16bec30469)Unhandledexception:NoSuchMethodError:Thegetter'isMacOS'wascalledonnull.Receiver:nullTriedc

flutter - getter 'navigator' 在 null 上被调用

从今天早上开始就一直报这个错,看了stacktrace,追查到runApp方法上的报错,不明白总之,问题是什么,我们将不胜感激:)这是个异常(exception):getter'navigator'wascalledonnull这是我的main.dart文件import'dart:async';import'package:firebase_analytics/firebase_analytics.dart';import'package:firebase_analytics/observer.dart';import'package:flutter/material.dart';im

flutter - 错误 : The getter 'length' was called on null

错误说:NoSuchMethodError:在null上调用了setter/getter“长度”这是一个基本的flutter音乐播放器应用。主.dartimport'package:flute_music_player/flute_music_player.dart';voidmain()=>runApp(MyApp());classMyAppextendsStatefulWidget{@override_MyAppStatecreateState()=>_MyAppState();}class_MyAppStateextendsState{List_songs;@overridevo

flutter :NoSuchMethodError:在 null 上调用了 getter 'isEmpty'

我正在调用WebAPI并接收Profile模型作为响应。当我使用下面的代码时,它会抛出一个错误:try{if(profile.message.isEmpty){Navigator.of(context).pushNamed("/home");}elseif(profile==null){_showDialog("Pleasecheckyourinternetconnection");}else{_showDialog("Pleaseentervalidcredentials");}}catch(exception){print(exception);} 最佳

firebase - getter 'token' 在使用 facebook 登录的 null firebase auth 上被调用 - Flutter

我正在尝试使用facebook登录Firebase。我正在使用firebaseauth:0.7.0和flutter_facebook_login:这是我的facebook登录功能:startFacebookLogin()async{varfacebookLogin=FacebookLogin();varresult=awaitfacebookLogin.logInWithReadPermissions(['email','public_profile']);FacebookAccessTokenmyToken=result.accessToken;AuthCredentialcrede