草庐IT

dart-isolates

全部标签

dart - 在 Flutter 应用程序中更改 SliverAppBar 标题颜色

我正在使用SliverAppBar,包括背景图片和标题。标题文本是白色的,我需要将AppBar上的颜色更改为黑色是“减少”(因为标签栏也是白色的)。怎么做?NestedScrollView(headerSliverBuilder:(BuildContextcontext,boolinnerBoxIsScrolled){;return[SliverAppBar(expandedHeight:200.0,floating:false,pinned:true,backgroundColor:Colors.white,flexibleSpace:FlexibleSpaceBar(centerT

dart - 在 Flutter 应用程序中更改 SliverAppBar 标题颜色

我正在使用SliverAppBar,包括背景图片和标题。标题文本是白色的,我需要将AppBar上的颜色更改为黑色是“减少”(因为标签栏也是白色的)。怎么做?NestedScrollView(headerSliverBuilder:(BuildContextcontext,boolinnerBoxIsScrolled){;return[SliverAppBar(expandedHeight:200.0,floating:false,pinned:true,backgroundColor:Colors.white,flexibleSpace:FlexibleSpaceBar(centerT

dart - 如何使用 flutter 创建自定义弹出菜单

我想在单击应用栏上的按钮时创建一个弹出菜单..我希望出现这样的东西:有没有办法在flutter中做到这一点?包什么的? 最佳答案 我试过了,但我在以这种方式显示子小部件时遇到了一些问题。所以,这里有两个解决方案:classTestScreenextendsStatefulWidget{@overrideStatecreateState()=>_TestScreenState();}class_TestScreenStateextendsStatewithSingleTickerProviderStateMixin{Animation

dart - 如何使用 flutter 创建自定义弹出菜单

我想在单击应用栏上的按钮时创建一个弹出菜单..我希望出现这样的东西:有没有办法在flutter中做到这一点?包什么的? 最佳答案 我试过了,但我在以这种方式显示子小部件时遇到了一些问题。所以,这里有两个解决方案:classTestScreenextendsStatefulWidget{@overrideStatecreateState()=>_TestScreenState();}class_TestScreenStateextendsStatewithSingleTickerProviderStateMixin{Animation

dart - IconButton 抛出异常

我正在尝试用Flutter中的一些图标制作一个简单的AppBar小部件,但我不断收到以下断言:ThefollowingassertionwasthrownbuildingIconButton(Icon(IconData(U+0E5D2));disabled;tooltip:我几乎只是模仿文档,但这是我的代码:import'package:flutter/material.dart';voidmain(){runApp(newMaterialApp(title:"StatelessWidgetExample",home:newAppBar(title:newText("AppBar"))

dart - IconButton 抛出异常

我正在尝试用Flutter中的一些图标制作一个简单的AppBar小部件,但我不断收到以下断言:ThefollowingassertionwasthrownbuildingIconButton(Icon(IconData(U+0E5D2));disabled;tooltip:我几乎只是模仿文档,但这是我的代码:import'package:flutter/material.dart';voidmain(){runApp(newMaterialApp(title:"StatelessWidgetExample",home:newAppBar(title:newText("AppBar"))

dart - 检查应用程序是否首次使用 Flutter 运行

基本上,我希望在用户第一次打开应用程序时打开一个屏幕/View。这将是一个登录屏幕类型的东西。 最佳答案 使用SharedPreferencesPackage.您可以使用FutureBuilder来阅读它,例如,您可以检查是否有一个名为welcome的bool。这是我在代码中的实现:returnnewFutureBuilder(future:SharedPreferences.getInstance(),builder:(BuildContextcontext,AsyncSnapshotsnapshot){switch(snapsh

dart - 检查应用程序是否首次使用 Flutter 运行

基本上,我希望在用户第一次打开应用程序时打开一个屏幕/View。这将是一个登录屏幕类型的东西。 最佳答案 使用SharedPreferencesPackage.您可以使用FutureBuilder来阅读它,例如,您可以检查是否有一个名为welcome的bool。这是我在代码中的实现:returnnewFutureBuilder(future:SharedPreferences.getInstance(),builder:(BuildContextcontext,AsyncSnapshotsnapshot){switch(snapsh

dart - 使用 PageView 预加载网络图像

我目前正在开发一个阅读器并使用PageView来滑动图像页面。如何使下一页预加载,以便用户可以滑动到下一页而无需等待页面加载?我不想先下载所有页面,因为它会加载服务器并卡住我的应用程序。当用户浏览当前页面时,我只想下载接下来的一两个页面。这是我的代码的摘录。PageController_controller;ZoomableImagenextPage;Widget_loadImage(intindex){ImageProviderimage=newCachedNetworkImageProvider("https://example.com/${bookId}/${index+1}.j

dart - 使用 PageView 预加载网络图像

我目前正在开发一个阅读器并使用PageView来滑动图像页面。如何使下一页预加载,以便用户可以滑动到下一页而无需等待页面加载?我不想先下载所有页面,因为它会加载服务器并卡住我的应用程序。当用户浏览当前页面时,我只想下载接下来的一两个页面。这是我的代码的摘录。PageController_controller;ZoomableImagenextPage;Widget_loadImage(intindex){ImageProviderimage=newCachedNetworkImageProvider("https://example.com/${bookId}/${index+1}.j