-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from Securrency-OSS/dv/wrap
feat: Add support to the Wrap widget
- Loading branch information
Showing
9 changed files
with
733 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,180 @@ | ||
{ | ||
"type": "scaffold", | ||
"appBar": { | ||
"type": "appBar", | ||
"title": { | ||
"type": "text", | ||
"data": "Wrap Demo" | ||
} | ||
}, | ||
"body": { | ||
"type": "center", | ||
"child": { | ||
"type": "wrap", | ||
"spacing": 8.0, | ||
"runSpacing": 4.0, | ||
"children": [ | ||
{ | ||
"type": "container", | ||
"color": "#FFCDD2", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "1", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "container", | ||
"color": "#F8BBD0", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "2", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "container", | ||
"color": "#E1BEE7", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "3", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "container", | ||
"color": "#D1C4E9", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "4", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "container", | ||
"color": "#C5CAE9", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "5", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "container", | ||
"color": "#BBDEFB", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "6", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "container", | ||
"color": "#B3E5FC", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "7", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "container", | ||
"color": "#B2EBF2", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "8", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "container", | ||
"color": "#B2DFDB", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "9", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "container", | ||
"color": "#C8E6C9", | ||
"width": 100, | ||
"height": 100, | ||
"child": { | ||
"type": "center", | ||
"child": { | ||
"type": "text", | ||
"data": "10", | ||
"style": { | ||
"color": "#FFFFFF" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains 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 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,26 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
export 'mirai_wrap_parser.dart'; | ||
|
||
part 'mirai_wrap.freezed.dart'; | ||
part 'mirai_wrap.g.dart'; | ||
|
||
@freezed | ||
class MiraiWrap with _$MiraiWrap { | ||
const factory MiraiWrap({ | ||
@Default(Axis.horizontal) Axis direction, | ||
@Default(WrapAlignment.start) WrapAlignment alignment, | ||
@Default(0.0) double spacing, | ||
@Default(WrapAlignment.start) WrapAlignment runAlignment, | ||
@Default(0.0) double runSpacing, | ||
@Default(WrapCrossAlignment.start) WrapCrossAlignment crossAxisAlignment, | ||
TextDirection? textDirection, | ||
@Default(VerticalDirection.down) VerticalDirection verticalDirection, | ||
@Default(Clip.none) Clip clipBehavior, | ||
@Default([]) List<Map<String, dynamic>> children, | ||
}) = _MiraiWrap; | ||
|
||
factory MiraiWrap.fromJson(Map<String, dynamic> json) => | ||
_$MiraiWrapFromJson(json); | ||
} |
Oops, something went wrong.