-
-
Notifications
You must be signed in to change notification settings - Fork 94
Added Documentation for MiraiTableParser, MiraiTableBorderParser, MiraiTableRowParser, MiraiTableCellParser, MiraiBorderSideParser #115
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
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9d86cc0
Docs for MiraiTableParser
31f7a98
Merge branch 'BuildMirai:dev' into dev
ShalmonAnandas 4883ce0
Added Table link to flutter docs
1d94c42
Merge branch 'dev' of https://github.com/ShalmonAnandas/mirai into dev
1dba8b4
Typo Fix
cbb9bb1
Added BorderSide, TableBorder, TableCell and TableRow parser docs
8ec4eda
Changed File Path to URL Path
c06b829
Punctuation
245a68f
PR comments resolved
33a44f1
moved table border to styles and attributes
dd1f500
formatting changes
d3268d9
styles and attributes category desc formatting
01652d7
added comments to border radius json for better understanding
b728e39
Merge branch 'BuildMirai:dev' into dev
ShalmonAnandas 4161864
removed styles_and_attributes folder. Added files to styles
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
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,47 @@ | ||
| # Border Radius | ||
|
|
||
| MiraiBorderRadius allows you to build the Flutter BorderRadius class using JSON. | ||
| To know more about the BorderRadius class in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/painting/BorderRadius-class.html). | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Description | | ||
| | -------- | ---------------------- | ------------------------------------------------------------------ | | ||
| | radius | `double?` | Defines the border Radius for all corners to be painted. | | ||
| | radius | `Map<String, double>?` | Defines the border Radius of each corner to be painted explicitly. | | ||
| | radius | `List<double>?` | Defines the border Radius of each corner to be painted explicitly. | | ||
|
|
||
| :::note | ||
|
|
||
| Above three properties defined are optional. i.e. `MiraiBorderRadius` can be defined using one of the above 3 methods. | ||
|
|
||
| ::: | ||
|
|
||
| ## Example | ||
|
|
||
| ```json | ||
| // Generic Declaration | ||
| { | ||
| "borderRadius": 16.0 | ||
| } | ||
|
|
||
| // Explicit Declaration | ||
| { | ||
| "borderRadius": { | ||
| "topLeft": 16.0, | ||
| "topRight": 16.0, | ||
| "bottomLeft": 16.0, | ||
| "bottomRight": 16.0 | ||
| } | ||
| } | ||
|
|
||
| // Explicit Declaration (List) | ||
| { | ||
| "borderRadius": [ | ||
| 16.0, //topLeft | ||
| 16.0, //topRight | ||
| 16.0, //bottomLeft | ||
| 16.0, //bottomRight | ||
| ] | ||
| } | ||
| ``` |
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,24 @@ | ||
| # Border Side | ||
|
|
||
| MiraiBorderSide allows you to define the Flutter BorderSide class using JSON. | ||
| To know more about the BorderSide class in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/painting/BorderSide-class.html). | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Description | | ||
| | ----------- | -------------- | ------------------------------------------------------------------------------------------------ | | ||
| | color | `Color?` | Defines color of the border. | | ||
| | width | `double?` | Defines thickness of the border. (logical px). | | ||
| | style | `BorderStyle?` | Defines the style of the border. Can be `solid` or `none`. Defaults to `solid`. | | ||
| | strokeAlign | `double?` | Defines the relative position of the stroke on values range from -1.0 (inside) to 1.0 (outside). | | ||
|
|
||
| ## Example | ||
|
|
||
| ```json | ||
| { | ||
| "color": "#428AF5", | ||
| "width": 1.0, | ||
| "style":"solid", | ||
| "strokeAlign": 1.0, | ||
| } | ||
| ``` |
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,48 @@ | ||
| # Table Border | ||
|
|
||
| MiraiTableBorder allows you to define the Flutter TableBorder class using JSON. | ||
| To know more about the TableBorder class in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/rendering/TableBorder-class.html). | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Description | | ||
| | ---------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | top | `MiraiBorderSide?` | Defines the top border of the table. See [`MiraiBorderSide`](./../styles_and_attributes/border_side). | | ||
| | right | `MiraiBorderSide?` | Defines the right border of the table. See [`MiraiBorderSide`](./../styles_and_attributes/border_side). | | ||
| | bottom | `MiraiBorderSide?` | Defines the bottom border of the table. See [`MiraiBorderSide`](./../styles_and_attributes/border_side). | | ||
| | left | `MiraiBorderSide?` | Defines the left border of the table. See [`MiraiBorderSide`](./../styles_and_attributes/border_side). | | ||
| | horizontalInside | `MiraiBorderSide?` | Defines the inner horizontal borders of the table. See [`MiraiBorderSide`](./../styles_and_attributes/border_side). | | ||
| | verticalInside | `MiraiBorderSide?` | Defines the inner vertical borders of the table. See [`MiraiBorderSide`](./../styles_and_attributes/border_side). | | ||
| | borderRadius | `MiraiBorderRadius?` | Defines the border radius to be used while rendering table corners. See [`MiraiBorderRadius`](./../styles_and_attributes/border_radius) | | ||
|
|
||
| ## Example | ||
|
|
||
| ```json | ||
| { | ||
| "border": { | ||
| "type": "tableBorder", | ||
| "top": { | ||
| "color": "#428AF5", | ||
| "width": 1.0 | ||
| }, | ||
| "right": { | ||
| "color": "#428AF5", | ||
| "width": 1.0 | ||
| }, | ||
| "bottom": { | ||
| "color": "#428AF5", | ||
| "width": 1.0 | ||
| }, | ||
| "left": { | ||
| "color": "#428AF5", | ||
| "width": 1.0 | ||
| }, | ||
| "borderRadius": { | ||
| "topLeft": 16, | ||
| "topRight": 16, | ||
| "bottomLeft": 16, | ||
| "bottomRight": 16, | ||
| } | ||
| }, | ||
| } | ||
| ``` |
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 @@ | ||
| # Table Column Width | ||
|
|
||
| MiraiTableColumnWidth allows you to build the Flutter TableColumnWidth class using JSON. | ||
| To know more about the TableColumnWidth class in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/rendering/TableColumnWidth-class.html). | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Description | | ||
| | -------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | type | `MiraiTableColumnWidth?` | Defines the type of columnWidth to be used. Can be `fixedColumnWidth`, `flexColumnWidth`, `fractionColumnWidth` & `intrinsicColumnWidth` | | ||
| | value | `double?` | Defines the value to be assigned to columnWidth. e.g. `5.0` would be `5px` in case of `fixedColumnWidth` | | ||
|
|
||
| ## Example | ||
|
|
||
| ```json | ||
| { | ||
| "type": "fixedColumnWidth", | ||
| "value": 200.0 | ||
| } | ||
| ``` |
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,155 @@ | ||
| # Table | ||
|
|
||
| MiraiTable allows you to build the Flutter Table widget using JSON. | ||
| To know more about the Table widget in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/widgets/Table-class.html). | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Description | | ||
| | ------------------------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | columnWidths | `Map<int, MiraiTableColumnWidth>?` | Determines the column width on a column by column basis, if a particular column entry has null width `defaultColumnWidth` is used. See [`MiraiTableColumnWidth`](./../styles_and_attributes/table_column_width) | | ||
| | defaultColumnWidth | `MiraiTableColumnWidth?` | Determines the default column width. Defaults to `flexColumnWidth`. See [`MiraiTableColumnWidth`](./../styles_and_attributes/table_column_width) | | ||
| | textDirection | `TextDirection?` | Determines the direction in which the columns are ordered. Can be `rtl` or `ltr`. Defaults to `rtl`. | | ||
| | border | `MiraiTableBorder?` | Defines the border style for `MiraiTable`. See [`MiraiTableBorder`](./../styles_and_attributes/table_border). | | ||
| | defaultVerticalAlignment | `TableCellVerticalAlignment?` | Defines the verticalAlignment for the cells that don't specify a verticalAlignment. Can be `top`, `middle`, `bottom`, `baseline`, `fill` & `intrinsicHeight` Defaults to `top`. | | ||
| | textBaseLine | `TextBaseline?` | Defines the text baseline to use when verticalAlignment is `baseline`. Can be `alphabetic` or `ideographic`. There is no default value. | | ||
| | children | `List<MiraiTableRow>` | Rows that will be populated in the table. See [`MiraiTableRow`](./table_row). | | ||
|
|
||
| ## Example | ||
|
|
||
| ```json | ||
| { | ||
| "type": "table", | ||
| "columnWidths": { | ||
| "1": { | ||
| "type": "fixedColumnWidth", | ||
| "value": 200 | ||
| } | ||
| }, | ||
| "defaultColumnWidth": { | ||
| "type": "flexColumnWidth", | ||
| "value": 1 | ||
| }, | ||
| "textDirection": "ltr", | ||
| "defaultVerticalAlignment": "bottom", | ||
| "border": { | ||
| "type": "tableBorder", | ||
| "top": { | ||
| "color": "#428AF5", | ||
| "width": 1.0 | ||
| }, | ||
| "right": { | ||
| "color": "#428AF5", | ||
| "width": 1.0 | ||
| }, | ||
| "bottom": { | ||
| "color": "#428AF5", | ||
| "width": 1.0 | ||
| }, | ||
| "left": { | ||
| "color": "#428AF5", | ||
| "width": 1.0 | ||
| }, | ||
| "borderRadius": 16 | ||
| }, | ||
| "children": [ | ||
| { | ||
| "type": "tableRow", | ||
| "children": [ | ||
| { | ||
| "type": "tableCell", | ||
| "child": { | ||
| "type": "container", | ||
| "color": "#40000000", | ||
| "height": 50.0, | ||
| "child": { | ||
| "type": "center", | ||
| "child": { | ||
| "type": "text", | ||
| "data": "Header 1" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "type": "tableCell", | ||
| "child": { | ||
| "type": "container", | ||
| "color": "#40000000", | ||
| "height": 50.0, | ||
| "child": { | ||
| "type": "center", | ||
| "child": { | ||
| "type": "text", | ||
| "data": "Header 2" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "type": "tableCell", | ||
| "child": { | ||
| "type": "container", | ||
| "color": "#40000000", | ||
| "height": 50.0, | ||
| "child": { | ||
| "type": "center", | ||
| "child": { | ||
| "type": "text", | ||
| "data": "Header 3" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "tableRow", | ||
| "children": [ | ||
| { | ||
| "type": "tableCell", | ||
| "child": { | ||
| "type": "sizedBox", | ||
| "height": 50.0, | ||
| "child": { | ||
| "type": "center", | ||
| "child": { | ||
| "type": "text", | ||
| "data": "Row 1, Cell 1" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "type": "tableCell", | ||
| "child": { | ||
| "type": "sizedBox", | ||
| "height": 50.0, | ||
| "child": { | ||
| "type": "center", | ||
| "child": { | ||
| "type": "text", | ||
| "data": "Row 1, Cell 2" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "type": "tableCell", | ||
| "child": { | ||
| "type": "sizedBox", | ||
| "height": 50.0, | ||
| "child": { | ||
| "type": "center", | ||
| "child": { | ||
| "type": "text", | ||
| "data": "Row 1, Cell 3" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| ] | ||
| } | ||
| ``` |
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 @@ | ||
| # Table Cell | ||
| MiraiTableCell allows you to define the Flutter TableCell widget using JSON. | ||
| To know more about the TableCell widget in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/widgets/TableCell-class.html). | ||
|
|
||
| ## Properties | ||
| | Property | Type | Description | | ||
| | ----------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | verticalAlignment | `TableCellVerticalAlignment?` | Defines the verticalAlignment for the table cell. Can be `top`, `middle`, `bottom`, `baseline`, `fill` & `intrinsicHeight` Defaults to `top`. | | ||
| | child | `Map<String, dynamic>` | The child widget of the table cell. | | ||
|
|
||
| ## Example | ||
|
|
||
| ```json | ||
| { | ||
| "type": "tableCell", | ||
| "verticalAlignment": "top", | ||
| "child": { | ||
| "type": "container", | ||
| "color": "#40000000", | ||
| "height": 50.0, | ||
| "child": { | ||
| "type": "center", | ||
| "child": { | ||
| "type": "text", | ||
| "data": "Header 1" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| ``` | ||
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.
Uh oh!
There was an error while loading. Please reload this page.