初步优化项目结构

This commit is contained in:
toly
2021-09-26 20:50:13 +08:00
parent f16d031417
commit 29a985e1b1
535 changed files with 366 additions and 359 deletions

View File

@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
/// create by 张风捷特烈 on 2020/9/21
/// contact me by email 1981462002@qq.com
/// 说明: 344 NestedScrollViewViewport 嵌套滑动视口
/// 在 NestedScrollView 中使用的视口,该视口持有 SliverOverlapAbsorberHandle会在视口需要重新计算布局时通知它。例如当滚动它时。
///
// {
// "widgetId": 344,
// "name": 'NestedScrollViewViewport 介绍',
// "priority": 1,
// "subtitle":
// "【offset】 : *偏移 【ViewportOffset】\n"
// "【handle】 : *处理器 【SliverOverlapAbsorberHandle】\n"
// "【axisDirection】 : 轴向 【AxisDirection】\n"
// "【crossAxisDirection】 : 交叉轴向 【AxisDirection】\n"
// "【slivers】 : 子组件 【List<Widget>】\n"
// "【clipBehavior】 : 裁剪行为 【Clip】\n"
// "【anchor】 : 锚点 【double】",
// }
class NestedScrollViewViewportDemo extends StatelessWidget {
final String info =
'NestedScrollViewViewport 在源码中只有一处使用:'
'_NestedScrollViewCustomScrollView 继承自 CustomScrollView复写了 buildViewport 方法,返回 NestedScrollViewViewport 。'
'而 NestedScrollView 构建时使用了 _NestedScrollViewCustomScrollView也就是 NestedScrollView 的视口依赖于 NestedScrollViewViewport。'
'NestedScrollViewViewport 的特点是持有 SliverOverlapAbsorberHandle 类对象 handle源码中该 handle 在 NestedScrollViewState 中初始化。'
'可通过上下文获取,用于 SliverOverlapAbsorber/SliverOverlapInjector 组件,使用详见相关组件。';
@override
Widget build(BuildContext context) {
return Container(
color: Colors.blue.withOpacity(0.1),
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
child: Text(info),
);
}
}