flutter_in_action_2nd icon indicating copy to clipboard operation
flutter_in_action_2nd copied to clipboard

《Flutter实战 第二版》 书稿

Results 120 flutter_in_action_2nd issues
Sort by recently updated
recently updated
newest added

![image](https://github.com/flutterchina/flutter_in_action_2nd/assets/53130945/4388530b-f223-469d-acb7-d548e9cd3ecd) 第二章-路由管理-2.4.5命名路由-命名路由参数传递 这里有一句代码更新: class EchoRoute extends StatelessWidget { @override Widget build(BuildContext context) { // 这里之前是 var args = ModalRoute.of(context).settings.arguments; // 现在应该是用这样的用法 var args = ModalRoute.of(context)!.settings.arguments; ... } }

![image](https://github.com/flutterchina/flutter_in_action_2nd/assets/53288390/e8ec777e-ba98-4594-a115-94dc392a6634) 本实例中的文案“密码”一次特指用户token 这句话中的`一次`应为`一词`

书中计算转换坐标: Alignment可以通过其坐标转换公式将其坐标转为子元素的具体偏移坐标: (Alignment.x*childWidth/2+childWidth/2, Alignment.y*childHeight/2+childHeight/2) 实际上坐标转换应该与原容器大小有关: https://api.flutter-io.cn/flutter/widgets/Align-class.html https://segmentfault.com/a/1190000041631644

14.7.1 通过 Layer 实现绘制缓存 https://book.flutterchina.club/chapter14/layer.html#_14-7-1-%E9%80%9A%E8%BF%87-layer-%E5%AE%9E%E7%8E%B0%E7%BB%98%E5%88%B6%E7%BC%93%E5%AD%98 这一章中,直接利用 Layer 缓存是有问题的。child 默认的 _parentHandle 会在 `removeAllChildren` 方法中, dispose 掉它。下次绘制直接使用就会报错。 ``` dart void removeAllChildren() { Layer? child = firstChild; while (child != null) { final...

您好:我試著貼上原碼和運行它: `@override Widget build(BuildContext context) { return Center( child: Container( color: backgroundColor, child: Text(text), ), ); }` 但在運行時,卻產生了如下的錯誤: ![image](https://github.com/flutterchina/flutter_in_action_2nd/assets/6796975/c646cf9b-b913-490a-a828-f423e24454c6) 可以在Text上加入以下的參數,即可運行成功: `Text(text, textDirection: TextDirection.ltr)` 不成主意,僅供參考

https://book.flutterchina.club/chapter1/install_flutter.html#_1-3-1-%E5%AE%89%E8%A3%85flutter

``` Field '_decoration' has not been initialized ``` [https://github.com/flutterchina/flutter_in_action_2nd/blob/main/src/chapter9/animated_widgets.md?plain=1#L162](定义延迟初始化变量) ```dart late DecorationTween _decoration; ``` 可修改为 ``` DecorationTween? _decoration; ``` [https://github.com/flutterchina/flutter_in_action_2nd/blob/main/src/chapter9/animated_widgets.md?plain=1#L167](使用懒初始化变量) ```dart return DecoratedBox( decoration: _decoration.evaluate(animation), child: widget.child, ); ``` 可修改为...

![image](https://user-images.githubusercontent.com/33676184/230855443-2df83ff1-45c9-4c5c-abb6-c1fdc7124597.png)

"Flow 不能自适应子组件大小,必须通过指定父容器大小或实现TestFlowDelegate的getSize返回固定大小。" 中的"TestFlowDelegate" 应该是 "FlowDelegate"