草庐IT

scroll-snap-points

全部标签

scroll - 调试帮助 : Flutter StatefulWidget doesn't maintain state(s) after scrolled out of view

我正在玩一个简单的应用程序来学习Flutter。这是UI的结构:app--MaterialApp--HomeScreen(有状态)|-ListView--PlaceWidget(有状态)|-ListTilePlaceWidget对象基本上构建并返回一个ListTile;它唯一的额外职责是跟踪favorited状态并相应地构建ListTile的UI。源代码是here,包括两个文件:main.dart用于整个应用,以及places.dart用于http请求这是应用程序的行为方式:https://gfycat.com/FineBelovedLeafhopper从表面上看,当滚动出View时,

scroll - 调试帮助 : Flutter StatefulWidget doesn't maintain state(s) after scrolled out of view

我正在玩一个简单的应用程序来学习Flutter。这是UI的结构:app--MaterialApp--HomeScreen(有状态)|-ListView--PlaceWidget(有状态)|-ListTilePlaceWidget对象基本上构建并返回一个ListTile;它唯一的额外职责是跟踪favorited状态并相应地构建ListTile的UI。源代码是here,包括两个文件:main.dart用于整个应用,以及places.dart用于http请求这是应用程序的行为方式:https://gfycat.com/FineBelovedLeafhopper从表面上看,当滚动出View时,

scroll - 如何在Flutter中滚动或跳转到PageView.builder或PageController的位置?

问题:使用PageController加载网页浏览量后无法滚动到POSITION*likeViewPagerscrolltospecificpageinAndroidWidget_buildCarousel(BuildContextcontext,intselectedIndex){PageControllercontroller=PageController(viewportFraction:1,keepPage:true);returnColumn(mainAxisSize:MainAxisSize.min,children:[SizedBox(//youmaywanttousea

scroll - 如何在Flutter中滚动或跳转到PageView.builder或PageController的位置?

问题:使用PageController加载网页浏览量后无法滚动到POSITION*likeViewPagerscrolltospecificpageinAndroidWidget_buildCarousel(BuildContextcontext,intselectedIndex){PageControllercontroller=PageController(viewportFraction:1,keepPage:true);returnColumn(mainAxisSize:MainAxisSize.min,children:[SizedBox(//youmaywanttousea

serialization - 如何将 List<Point> 保存到首选项中并从 flutter 中的首选项中获取 List<Point>?

使用时出错json_serializablejson_serializable:json_serializableon.../sign_point_model.dart:运行JsonSerializableGenerator时出错无法生成fromJsonvalList的代码因为类型Point.均未提供TypeHelper实例支持定义的类型。 最佳答案 json_serializable不知道如何将Point转换成JSON。因为您知道它只是一对num,所以您可以轻松地自己转换列表。import'dart:convert';voidma

serialization - 如何将 List<Point> 保存到首选项中并从 flutter 中的首选项中获取 List<Point>?

使用时出错json_serializablejson_serializable:json_serializableon.../sign_point_model.dart:运行JsonSerializableGenerator时出错无法生成fromJsonvalList的代码因为类型Point.均未提供TypeHelper实例支持定义的类型。 最佳答案 json_serializable不知道如何将Point转换成JSON。因为您知道它只是一对num,所以您可以轻松地自己转换列表。import'dart:convert';voidma

flutter - ScrollController.jumpTo() "ScrollController not attached to any scroll views"

我正在监听PageController以获取位置,然后将其与ListView同步。当操作PageView时,同时操作ListView。示例:https://github.com/Ramotion/cardslider-android但是,在v0.6.0之后,我收到一个断言错误,指出我的ScrollController未附加到任何View。每次有流事件触发.jumpTo()方法时都会触发。它仍然有效,但断言错误让我抓狂。[VERBOSE-2:shell.cc(181)]DartError:Unhandledexception:'package:flutter/src/widgets/sc

flutter - ScrollController.jumpTo() "ScrollController not attached to any scroll views"

我正在监听PageController以获取位置,然后将其与ListView同步。当操作PageView时,同时操作ListView。示例:https://github.com/Ramotion/cardslider-android但是,在v0.6.0之后,我收到一个断言错误,指出我的ScrollController未附加到任何View。每次有流事件触发.jumpTo()方法时都会触发。它仍然有效,但断言错误让我抓狂。[VERBOSE-2:shell.cc(181)]DartError:Unhandledexception:'package:flutter/src/widgets/sc

android - 获取下一个最近的 Geo-Points

我在我的android应用程序中有一个带有地理点的数据库表(lat和lon是十进制度值),大约1000点。我需要选择20个离某个给定地理点最近的点。我在Stackoverflow上找到了如何计算两个地理点之间的距离的答案并且非常高兴,直到我尝试编写我的查询。我发现,不可能在android的内置sqlite中使用三角函数。但后来我有了一个想法。我真的不需要计算距离。一个点离另一个点越近,它们的地理坐标差异应该越小。我如何利用这个事实?按(lat_0-lat_n)^2+(lon0-lon_n)^2对保存的点进行排序是否足够,其中lat_0和lon_0是给定点的地理坐标?谢谢,穆尔UPD因此

android - 获取下一个最近的 Geo-Points

我在我的android应用程序中有一个带有地理点的数据库表(lat和lon是十进制度值),大约1000点。我需要选择20个离某个给定地理点最近的点。我在Stackoverflow上找到了如何计算两个地理点之间的距离的答案并且非常高兴,直到我尝试编写我的查询。我发现,不可能在android的内置sqlite中使用三角函数。但后来我有了一个想法。我真的不需要计算距离。一个点离另一个点越近,它们的地理坐标差异应该越小。我如何利用这个事实?按(lat_0-lat_n)^2+(lon0-lon_n)^2对保存的点进行排序是否足够,其中lat_0和lon_0是给定点的地理坐标?谢谢,穆尔UPD因此