Skip to content

Commit

Permalink
✨ 添加CupertinoFullscreenDialogTransition、CupertinoPageTransition、HtmlE…
Browse files Browse the repository at this point in the history
…lementView、PrimaryScrollController 组件介绍
  • Loading branch information
toly1994328 committed Apr 11, 2021
1 parent d94799c commit e514824
Show file tree
Hide file tree
Showing 12 changed files with 164 additions and 10 deletions.
8 changes: 4 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ android {

signingConfigs {
release {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile file(keystoreProperties['storeFile'])
// storePassword keystoreProperties['storePassword']
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
Expand Down
4 changes: 4 additions & 0 deletions android/key.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
storePassword=toly1994
keyPassword=toly1994328
keyAlias= king
storeFile=/Users/mac/Coder/files/key/toly1994.jks
Binary file modified assets/flutter.db
Binary file not shown.
3 changes: 0 additions & 3 deletions lib/repositories/rep/impl/catagory_db_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import 'package:flutter_unit/repositories/rep/category_repository.dart';
import 'package:sqflite/sqflite.dart';





/// create by 张风捷特烈 on 2020-04-21
/// contact me by email [email protected]
/// 说明:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';

/// create by 张风捷特烈 on 2020/3/31
/// contact me by email [email protected]
///
/// 说明: 335 PrimaryScrollController 5 初始滑动控制器 它是 InheritedWidget 子类,通过 context 向子树中的可滑动视图提供默认的 ScrollController 对象。
// {
// "widgetId": 335,
// "name": 'PrimaryScrollController 介绍',
// "priority": 1,
// "subtitle":
// "【controller】 : 滑动控制器 【ScrollController】\n"
// "【child】 : 子组件 【Widget】",
// }
class PrimaryScrollControllerDemo extends StatelessWidget {
final String info =
'PrimaryScrollController 是 InheritedWidget 子类,也就说明它可以为子树组件提供某些默认数据,'
'子树可以通过 context 来获取上层该组件的提供 ScrollController 对象。\n'
'对于一些可滑动组件 ScrollView、SingleChildScrollView、NestedScrollView 等,'
'在使用者未提供 ScrollController 时,且 primary 属性为 true 时(默认true) ,'
'会使用上层 PrimaryScrollController 组件提供的滑动控制器。\n'
'使用 MaterialApp 组件,其已经内置 PrimaryScrollController,';

@override
Widget build(BuildContext context) {

ScrollController label = PrimaryScrollController.of(context);

return Container(
color: Colors.blue.withOpacity(0.1),
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
child: Text(info+"当前其持有的滑动控制器对象: $label"),
);
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';


/// create by 张风捷特烈 on 2020-03-25
/// contact me by email [email protected]
Expand All @@ -11,9 +14,6 @@
// "【actions】 : 行为组件集 【List<Widget>】\n"
// "【previewBuilder】 : 动画构造器 【ContextMenuPreviewBuilder】",
// }
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class CustomCupertinoContextMenu extends StatelessWidget {
@override
Widget build(BuildContext context) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// create by 张风捷特烈 on 2020/4/11
/// contact me by email [email protected]
///
/// 说明: 219 CupertinoFullscreenDialogTransition 0 全页面过渡变换 创建一个 iOS 风格的转换,用于唤出全屏对话框。link 216
// {
// "widgetId": 219,
// "name": '组件介绍',
// "priority": 1,
// "subtitle":
// "【child】 : 子组件 【Widget】\n"
// "【linearTransition】 : 是否线性转换 【bool】\n"
// "【primaryRouteAnimation】 : 初始路由动画 【Animation<double>】\n"
// "【secondaryRouteAnimation】 : 第二路由动画 【Animation<double>】",
// }

class CupertinoFullscreenDialogTransitionDemo extends StatelessWidget {
final String info =
'和 CupertinoPageTransition 一样,该组件底层基于 SlideTransition 组件实现,'
'主要用途是模仿 iOS 风格,用于唤出全屏对话框动画过渡效果。'
'源码中唯一的使用处是 CupertinoPageRoute 处理路由跳转动画时,一般不会单独使用。'
'当【route.fullscreenDialog】为 true 时,会使用 CupertinoFullscreenDialogTransition 组件,否则使用 CupertinoPageTransition 组件。'
'其中个属性信息和 CupertinoPageTransition 组件一致,详见之。';

@override
Widget build(BuildContext context) {
return Container(
color: Colors.blue.withOpacity(0.1),
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
child: Text(info),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/// create by 张风捷特烈 on 2020/4/11
/// contact me by email [email protected]
///
/// 说明: 216 CupertinoPageTransition 0 风格的页面过渡动画变换 提供一个 iOS 风格的页面过渡动画。 link 219
// {
// "widgetId": 216,
// "name": 'CupertinoPageTransition 介绍',
// "priority": 1,
// "subtitle":
// "【child】 : 子组件 【Widget】\n"
// "【linearTransition】 : 是否线性转换 【bool】\n"
// "【primaryRouteAnimation】 : 初始路由动画 【Animation<double>】\n"
// "【secondaryRouteAnimation】 : 第二路由动画 【Animation<double>】",
// }
class CupertinoPageTransitionDemo extends StatelessWidget {
final String info =
'该组件底层基于 SlideTransition 组件实现,主要用途是模仿 iOS 风格,处理页面间跳转的过渡动画。'
'源码中唯一的使用处是 CupertinoPageRoute 处理路由跳转动画时,一般不会单独使用。'
'如 A 跳转到 B, primaryRouteAnimation 和 secondaryRouteAnimation 都是一个 0.0->1.0 的动画,'
'前者用于处理 B 界面进入过渡动画;后者用于处理 A 界面被覆盖的过渡动画。'
;

@override
Widget build(BuildContext context) {
return Container(
color: Colors.blue.withOpacity(0.1),
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
child: Text(info ),
);
}
}
30 changes: 30 additions & 0 deletions lib/views/widgets/StatelessWidget/HtmlElementView/node1_base.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/// create by 张风捷特烈 on 2020/4/11
/// contact me by email [email protected]
///
/// 说明: 213 HtmlElementView 0 在 Flutter Web 的 Widget 层次结构中嵌入一个 HTML 元素。
// {
// "widgetId": 213,
// "name": 'HtmlElementView 介绍',
// "priority": 1,
// "subtitle":
// "【child】 : 子组件 【child】\n"
// "【viewType】 : html元素唯一表识 【String】",
// }
class HtmlElementViewDemo extends StatelessWidget {
final String info =
'该组件只能用于 Flutter Web 中,嵌入 Html 元素的较为昂贵。'
'内部基于 PlatformViewLink 和 PlatformViewSurface 组件实现。';

@override
Widget build(BuildContext context) {
return Container(
color: Colors.blue.withOpacity(0.1),
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
child: Text(info),
);
}
}
1 change: 1 addition & 0 deletions lib/views/widgets/exp/proxy_unit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ export '../ProxyWidget/InheritedTheme/node1_base.dart';
export '../ProxyWidget/DefaultAssetBundle/node1_base.dart';
export '../ProxyWidget/InheritedWidget/node1_base.dart';
export '../ProxyWidget/ParentDataWidget/node1_base.dart';
export '../ProxyWidget/PrimaryScrollController/node1_base.dart';
4 changes: 4 additions & 0 deletions lib/views/widgets/exp/stateless_unit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export '../StatelessWidget/MaterialBanner/node1_one_btn.dart';
export '../StatelessWidget/MaterialBanner/node2_two_btn.dart';
export '../StatelessWidget/SafeArea/node1_base.dart';

export '../StatelessWidget/CupertinoFullscreenDialogTransition/node1_base.dart';
export '../StatelessWidget/CupertinoPageTransition/node1_base.dart';
export '../StatelessWidget/HtmlElementView/node1_base.dart';

export '../StatelessWidget/DataTable/node1_base.dart';
export '../StatelessWidget/DataTable/node2_operation.dart';
export '../StatelessWidget/OrientationBuilder/node1_base.dart';
Expand Down
12 changes: 12 additions & 0 deletions lib/views/widgets/widgets_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ class WidgetsMap {
case "CompositedTransformFollower":
return [
const CompositedTransformFollowerDemo(),
]; case "PrimaryScrollController":
return [
PrimaryScrollControllerDemo(),
];case "CupertinoFullscreenDialogTransition":
return [
CupertinoFullscreenDialogTransitionDemo(),
];case "CupertinoPageTransition":
return [
CupertinoPageTransitionDemo(),
];case "HtmlElementView":
return [
HtmlElementViewDemo(),
];
case "Text":
return [
Expand Down

0 comments on commit e514824

Please sign in to comment.