-
Notifications
You must be signed in to change notification settings - Fork 151
Test #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Test #13
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d776542
AspectRatio
DIVINER-only 091fad8
ConstrainedBox
DIVINER-only d6fb391
Wrap
DIVINER-only d9c7a2c
Table
DIVINER-only d1a4965
引入屏幕适配
DIVINER-only e9dd717
flow
DIVINER-only afcebfc
flow
DIVINER-only 3d87d8d
refactor:优化主题包功能
ckken cf76656
Stack
DIVINER-only 85c8f5f
docs:增加git提交规范文档
ckken 61f0575
Merge pull request #11 from efoxTeam/dev-ken
ckken e53da52
优化底部导航
ckken 3c0cae5
Merge pull request #12 from efoxTeam/dev-ken
ckken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
docs/widget/regular/aspectratio/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ## **AspectRatio** | ||
|
|
||
| > | ||
| 将子控件调整为特定宽高比的控件 | ||
| * AspectRatio 首先会尝试布局约束的最大宽度,widget的高度是通过给定的宽度和宽高比率来决定的 | ||
| * 对于需要缩放调整位置的,一般是对图片的处理 | ||
|
|
||
| ### 构造方法 | ||
| ``` dart | ||
| AspectRatio({ | ||
| Key key, | ||
| @required this.aspectRatio, | ||
| Widget child | ||
| }) | ||
| ``` | ||
|
|
||
| ### 属性介绍 | ||
| * aspectRatio: 宽高比,如1.5,宽度是高度的1.5倍 | ||
| * child: AspectRatio中的内容widget |
20 changes: 20 additions & 0 deletions
docs/widget/regular/constrainedbox/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ## **ConstrainedBox** | ||
|
|
||
| > | ||
| 一个基础布局控件,添加额外的限制条件(constraints)到child上 | ||
|
|
||
| ### 构造方法 | ||
| ``` dart | ||
| ConstrainedBox({ | ||
| Key key, | ||
| @required this.constraints, | ||
| Widget child | ||
| }) | ||
| ``` | ||
|
|
||
| ### 属性介绍 | ||
| * constraints: 添加到child上的额外限制条件,其类型为BoxConstraints,限制各种最大最小宽高 | ||
| * child: ConstrainedBox中的内容Widget | ||
|
|
||
| ### 其他用法 | ||
| * constraints值为BoxConstraints.expand时,提供width或者height,那么限制(Constraints)将严格使用给出的width或者height值 |
23 changes: 23 additions & 0 deletions
docs/widget/regular/flow/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| ## **Flow** | ||
|
|
||
| > | ||
| 实现优化流式布局以使用流布局的控件 | ||
| * 实现较为复杂,一般可通过Wrap来替换实现 | ||
|
|
||
| ### 构造方法 | ||
| ``` dart | ||
| Flow({ | ||
| Key key, | ||
| @required this.delegate, | ||
| List<Widget> children = const <Widget>[], | ||
| }) | ||
| ``` | ||
|
|
||
| ### 属性介绍 | ||
| * delegeate: 影响布局的FlowDelegate,包含方法如下: | ||
| * paintChildren: child的绘制控制代码,可以调整尺寸位置 | ||
| * shouldPepaint:是否需要重绘 | ||
| * shouldRelayout:是否需要重新布局 | ||
| * getConstraintsForChild:设置每个child的约束条件,会覆盖已有 | ||
| * getSize: 设置Flow的尺寸 | ||
| * children: Flow中的内容widget |
31 changes: 31 additions & 0 deletions
docs/widget/regular/stack/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| ## **Stack** | ||
|
|
||
| > | ||
| 该Widget将子控件相对于其边框进行定位 | ||
| * Stack的布局行为,根据child是positioned节点还是non-positioned节点来区分 | ||
| * 对于positioned的子节点,它们的位置会根据所设置的top、bottom、right以及left属性来确定,这几个值都是相对于Stack的左上角; | ||
| * 对于non-positioned的子节点,它们会根据Stack的aligment来设置位置。 | ||
| * 对应child的顺序,第一个child会被绘制在最低端 | ||
|
|
||
| ### 构造方法 | ||
| ``` dart | ||
| Stack({ | ||
| Key key, | ||
| this.alignment = AlignmentDirectional.topStart, | ||
| this.textDirection, | ||
| this.fit = StackFit.loose, | ||
| this.overflow = Overflow.clip, | ||
| List<Widget> children = const <Widget>[], | ||
| }) | ||
| ``` | ||
|
|
||
| ### 属性介绍 | ||
| * alignment: 对齐方式,默认是topLeft | ||
| * textDirection:文本方向,不常用 | ||
| * fit: 默认loose | ||
| * loose:子节点尺寸可以从min到max | ||
| * expand:子节点尽可能占用空间 | ||
| * passthrough: 不改变子节点约束 | ||
| * overflow:超过部分是否裁切,Overflow.clip/visible | ||
| * children: Stack中的内容Widget | ||
|
|
35 changes: 35 additions & 0 deletions
docs/widget/regular/table/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| ## **Table** | ||
|
|
||
| > | ||
| 该控件为其子控件进行table布局的Widget | ||
|
|
||
| ### 构造方法 | ||
| ``` dart | ||
| Table({ | ||
| Key key, | ||
| this.children = const <TableRow>[], | ||
| this.columnWidths, | ||
| this.defaultColumnWidth = const FlexColumnWidth(1.0), | ||
| this.textDirection, | ||
| this.border, | ||
| this.defaultVerticalAlignment = TableCellVerticalAlignment.top, | ||
| this.textBaseline, | ||
| }) | ||
| ``` | ||
|
|
||
| ### 属性介绍 | ||
| > | ||
| 该Widget适用于多行多列,若只有一行或者一列,选择Row或Column会更合适一些 | ||
|
|
||
| * columnWidths:设置每一列的宽度 | ||
| * defaultColumnWidth:默认的每一列宽度值,默认情况下均分,通过FixedColumnWidth设置 | ||
| * textDirection:文字显示方向 | ||
| * border:表格边框 | ||
| * defaultVerticalAlignment:每一个cell的垂直方向的对齐方式, 包含5种: | ||
| * top:放置在的顶部; | ||
| * middle:垂直居中; | ||
| * bottom:放置在底部; | ||
| * baseline:文本baseline对齐; | ||
| * fill:充满整个cell。 | ||
| * textBaseline:defaultVerticalAlignment为baseline的时候,会用到这个属性。 | ||
| * children: Table的中的内容widget |
32 changes: 32 additions & 0 deletions
docs/widget/regular/wrap/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| ## **Wrap** | ||
|
|
||
| > | ||
| 该控件以多个水平或垂直方向显示其子控件 | ||
| * 单行的Wrap和Row表现几乎一致,单列的Wrap和Column表现几乎一致,但是Row同Column系单行单列的,Wrap中行或列空间不足时,会自动换行 | ||
|
|
||
| ### 构造方法 | ||
| ``` dart | ||
| Wrap({ | ||
| Key key, | ||
| this.direction = Axis.horizontal, | ||
| this.alignment = WrapAlignment.start, | ||
| this.spacing = 0.0, | ||
| this.runAlignment = WrapAlignment.start, | ||
| this.runSpacing = 0.0, | ||
| this.crossAxisAlignment = WrapCrossAlignment.start, | ||
| this.textDirection, | ||
| this.verticalDirection = VerticalDirection.down, | ||
| List<Widget> children = const <Widget>[], | ||
| }) | ||
| ``` | ||
|
|
||
| ### 属性介绍 | ||
| * direction:主轴的方向,默认为水平,值:Axis.horizontal/vertical | ||
| * alignment:主轴方向上的对齐方式,默认为start, 值: WrapAlignment.start/center/end/spaceAround/spaceBetween/spaceEvenly | ||
| * spacing:主轴方向上的间距。 | ||
| * runAlignment:run的对齐方式, 值: WrapAlignment.start/center/end/spaceAround/spaceBetween/spaceEvenly | ||
| * runSpacing:run的间距。 | ||
| * crossAxisAlignment:交叉轴(crossAxis)方向上的对齐方式,值: WrapCrossAlignment.start/center/end | ||
| * textDirection:文本方向, 值:TextDirection.ltr/rtl | ||
| * verticalDirection:定义了children摆放顺序,默认是down,值: VerticalDirection.down/up | ||
| * children: Table的中的内容widget |
9 changes: 9 additions & 0 deletions
git.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # git使用规范 | ||
| ## 提交规范 | ||
| + feat:新功能(feature) | ||
| + fix:修补bug | ||
| + docs:文档(documentation) | ||
| + style: 格式(不影响代码运行的变动) | ||
| + refactor:重构(即不是新增功能,也不是修改bug的代码变动) | ||
| + test:增加测试 | ||
| + chore:构建过程或辅助工具的变动 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
lib/config/theme.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| class AppTheme { | ||
| static int mainColor = 0xFFD32F2F; | ||
| static int secondColor = 0xFFFFFFFF; | ||
| static int thirdColor = 0xFFFAFAFA; | ||
| static int greyColor = 0x8A000000; | ||
| static int blackColor = 0xFF000000; | ||
| static ThemeData themData = ThemeData( | ||
| textTheme: TextTheme( | ||
| body1: TextStyle( | ||
| // color: Colors.black, | ||
| // fontWeight: FontWeight.bold, | ||
| ), | ||
| ), | ||
| platform: TargetPlatform.iOS, | ||
| iconTheme: IconThemeData( | ||
| size: 32, | ||
| color: Color(thirdColor), | ||
| opacity: 0.85, | ||
| ), | ||
| // primaryIconTheme 导航栏按钮颜色 | ||
| primaryIconTheme: IconThemeData( | ||
| color: Color(secondColor), | ||
| ), | ||
| accentColor: Colors.grey, // 选中颜色 | ||
| primaryColor: Color(mainColor), // appbar背景 | ||
| scaffoldBackgroundColor: Color(thirdColor), // 整体的scaffold背景颜色 | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.