- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在为我的第一个开源 flutter 库做贡献,必须更改一些变量名称以使项目连贯。
库所有者指出重构的参数会破坏从以前版本更新的应用程序。他让我使用别名并将旧变量设置为弃用,以便开发人员可以将其更改为下一个主要版本。
我已经进行了一些谷歌搜索,但找不到有关如何以专业方式执行此类操作的教程。我实际上根本找不到有关别名的信息。
有人可以帮助我帮助社区吗?
编辑:构造函数前后
之前:
CarouselSlider({
@required
this.items,
this.viewportFraction: 0.8,
this.initialPage: 0,
this.aspectRatio: 16/9,
this.height,
this.realPage: 10000,
this.autoPlay: false,
this.interval: const Duration(seconds: 4),
this.reverse: false,
this.autoPlayCurve: Curves.fastOutSlowIn,
this.autoPlayDuration: const Duration(milliseconds: 800),
this.updateCallback,
this.distortion: true,
})
之后:
CarouselSlider({
@required
this.items,
this.height,
this.aspectRatio: 16/9,
this.viewportFraction: 0.8,
this.initialPage: 0,
this.realPage: 10000,
this.reverse: false,
this.autoPlay: false,
this.autoPlayInterval: const Duration(seconds: 4),
this.autoPlayAnimationDuration: const Duration(milliseconds: 800),
this.autoPlayCurve: Curves.fastOutSlowIn,
this.enlargeCenterPage: false,
this.pauseAutoPlayOnTouch,
this.onPageChangedCallback,
})
重构名称:
interval --> autoPlayInterval
distortion --> enlargeCenterPage
autoPlayDuration --> autoPlayAnimationDuration
updateCallback --> onPageChanged
最佳答案
interval
属性的示例
CarouselSlider({
@required
this.items,
this.viewportFraction: 0.8,
this.initialPage: 0,
this.aspectRatio: 16/9,
this.height,
this.realPage: 10000,
this.autoPlay: false,
@Deprecated('use "autoplayInterval" instead')
Duration interval: const Duration(seconds: 4),
Duration autoplayInterval,
this.reverse: false,
this.autoPlayCurve: Curves.fastOutSlowIn,
this.autoPlayDuration: const Duration(milliseconds: 800),
this.updateCallback,
this.distortion: true,
}) : assert(interval == null || autoplayInterval == null, 'Use either "interval" or "autoPlayInterval", but not both.'), autoplayInterval = autoplayInterval ?? interval;
关于dart - 在已发布的 Flutter/Dart 包中重构参数名称时如何保持向后兼容性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54759908/
我想在 iOS 设备上以慢动作显示视频。 我的 View 包含一个视频(约 2 秒长)和一个 slider 。 用户可以移动 slider 并逐帧(向前和向后)浏览电影。 MPMoviePlayerC
假设两个模型的标准外键,例如: Company(models.Model): name = models.CharField('Nome', max_length = 255) ...
即使从其他项目复制和粘贴代码,我的 NSURL 也会向后格式化,这毫无意义。 例如: let baseURL = NSURL(string: "http://example.com/v1/") NSU
我目前有: $i = 1; while { echo $i; $i++; } 它显示: 1234 etc.. 如何让它向后显示? 例如 4321 etc.. 我基本上想做完全相同的事情,但将其
我正在使用 JQuery 选择页面上的一些元素,然后在 DOM 中移动它们。我遇到的问题是我需要以 JQuery 自然想要选择它们的相反顺序选择所有元素。例如: Item 1 Item
有 Home.vue 和 Statistics.vue 页面。 Home.vue 渲染 TableFields.vue 组件。在 Home.vue 中,有一些字段编号,在页面加载时设置了初始值“3”。
我正在寻找类似 https 的东西,但是是反向的。用户(提前)生成自己的私钥,然后(仅在稍后)向 Web 应用程序提供关联的公钥。这部分交换应该(如果需要)在带外进行。然后使用这些 key 对通信进行
我不知道如何解释我的问题。这是我尝试解释的:函数 FindNext(SearchRec) 将从目录中获取下一个文件。在我的应用程序中,我有时会从当前的 SearchRec 索引向后查找一些文件。那么我
我有一个带前导 NA 的日期向量,我想使用包 zoo 中的 na.approx 为这些 NA 生成一个近似序列。 na.approx 不适用于前导 NA: x <- as.Date(c(rep(NA,
在任何网络浏览器、Windows 文件管理器和许多其他应用程序中,都支持向前和向后导航。默认情况下,这始终(或至少在大多数情况下)适用于额外的鼠标按钮,如果您的鼠标有的话。 我想在基于 WinAPI
我正在尝试使用双向链表编写撤消和重做函数,该双向链表在调用 doAction() 时在 list_1 前面添加操作(节点),在调用 undo() 时将操作存储在 list_2 中,并在调用 redo(
我有一个示例数据框,如下所示 ID count 1 10 2 20 3 40 所以对于累计计数,我要实现 ID count
我的应用程序需要显示一个值的图形表示,范围从 -1 到 1。负值应使用一种颜色,正值应使用另一种颜色。零位于中心,什么也没有显示。 (如果有帮助的话,这里的特殊用途是在金融应用程序中显示买卖订单的相对
我对这个简单的线条动画有点吃力。我想出了如何暂停它,但我需要的是能够从我调用函数 resetAnimation() 的那一刻起将动画反转回起点。 let pathAnimation = CABasic
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: How to read a file from bottom to top in Ruby? 在开发我的 R
import numpy as np data = np.array([0, 0, 0, 0, 0, 0, 0, 1], dtype=np.uint8) data.view(np.uint64) 我期
我有一个这样的值列表, lst = [1, 2, 3, 4, 5, 6, 7, 8] 期望输出 : window size = 3 1 # first element in the list
我的代码再简单不过了... if (iWant > thereAre){ msg = "There's only "+thereAre+" left, but you want "+iWant
#include #include /* converts to binary */ int main() { unsigned int decimalNUM = 0; print
CTRL-x o - switch cursor to other window 我想有能力扭转 control-x o做。像 control-x p这正是 control-x o有,但倒退。这个请求
我是一名优秀的程序员,十分优秀!