草庐IT

MyAppBar

全部标签

dart - Flutter/Dart 基本理解

很抱歉打扰您。但我想回到编程,我只是无法得到以下内容(来自flutter的代码示例)classMyAppBarextendsStatelessWidget{MyAppBar({this.title});//FieldsinaWidgetsubclassarealwaysmarked"final".finalWidgettitle;@overrideWidgetbuild(BuildContextcontext){returnContainer(height:56.0,//inlogicalpixelspadding:constEdgeInsets.symmetric(horizonta

dart - Flutter/Dart 基本理解

很抱歉打扰您。但我想回到编程,我只是无法得到以下内容(来自flutter的代码示例)classMyAppBarextendsStatelessWidget{MyAppBar({this.title});//FieldsinaWidgetsubclassarealwaysmarked"final".finalWidgettitle;@overrideWidgetbuild(BuildContextcontext){returnContainer(height:56.0,//inlogicalpixelspadding:constEdgeInsets.symmetric(horizonta

dart - 从它自己的类中的 appbar 调用 body 的函数

我的应用程序的每个“页面”都有一个类,它们都共享同一个应用栏,这是它自己的一个类。我在应用栏上有一个按钮,我希望它从打开的任何页面调用一个函数。该功能在每个页面上,并且在每个页面上具有相同的名称。在我下面的缩短代码中,您看到了共享的MyAppBar,并且您看到了2个页面。每个页面都使用MyAppBar,并且每个页面都有_myFunction()。如何从MyAppBar为每个当前页面调用_myFunction()?classMyAppBar{setAppBar(context,Stringtitle){returnnewAppBar(backgroundColor:Colors.blue

dart - 从它自己的类中的 appbar 调用 body 的函数

我的应用程序的每个“页面”都有一个类,它们都共享同一个应用栏,这是它自己的一个类。我在应用栏上有一个按钮,我希望它从打开的任何页面调用一个函数。该功能在每个页面上,并且在每个页面上具有相同的名称。在我下面的缩短代码中,您看到了共享的MyAppBar,并且您看到了2个页面。每个页面都使用MyAppBar,并且每个页面都有_myFunction()。如何从MyAppBar为每个当前页面调用_myFunction()?classMyAppBar{setAppBar(context,Stringtitle){returnnewAppBar(backgroundColor:Colors.blue