Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions examples/stac_gallery/assets/json/clip_oval_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "ClipOval"
}
},
"body": {
"type": "padding",
"padding": 16.0,
"child": {
"type": "column",
"mainAxisAlignment": "center",
"crossAxisAlignment": "center",
"children": [
{
"type": "text",
"data": "Basic ClipOval with Image",
"style": {
"fontSize": 18.0,
"fontWeight": "w600"
}
},
{
"type": "sizedBox",
"height": 16.0
},
{
"type": "clipOval",
"clipBehavior": "antiAlias",
"child": {
"type": "image",
"src": "https://picsum.photos/200",
"width": 200,
"height": 200,
"fit": "cover"
}
},
{
"type": "sizedBox",
"height": 32.0
},
{
"type": "text",
"data": "ClipOval with Container",
"style": {
"fontSize": 18.0,
"fontWeight": "w600"
}
},
{
"type": "sizedBox",
"height": 16.0
},
{
"type": "clipOval",
"clipBehavior": "antiAlias",
"child": {
"type": "container",
"color": "#2196F3",
"height": 100,
"width": 200
}
},
{
"type": "sizedBox",
"height": 32.0
},
{
"type": "text",
"data": "ClipOval with Text",
"style": {
"fontSize": 18.0,
"fontWeight": "w600"
}
},
{
"type": "sizedBox",
"height": 16.0
},
{
"type": "clipOval",
"clipBehavior": "antiAlias",
"child": {
"type": "container",
"color": "#FF5722",
"height": 100,
"width": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Hello",
"style": {
"color": "#FFFFFF",
"fontSize": 18.0
}
}
}
}
}
]
}
}
}
24 changes: 24 additions & 0 deletions examples/stac_gallery/assets/json/home_screen.json
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,30 @@
}
}
},
{
"type": "listTile",
"leading": {
"type": "icon",
"icon": "crop_original"
},
"title": {
"type": "text",
"data": "ClipOval"
},
"subtitle": {
"type": "text",
"data": "A widget that clips its child using an oval",
"align": "center"
},
"style": "list",
"onTap": {
"actionType": "navigate",
"widgetJson": {
"type": "exampleScreen",
"assetPath": "assets/json/clip_oval_example.json"
}
}
},
{
"type": "listTile",
"leading": {
Expand Down
1 change: 1 addition & 0 deletions packages/stac/lib/src/framework/stac.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class Stac {
const StacDynamicViewParser(),
const StacDropdownMenuParser(),
const StacClipRRectParser(),
const StacClipOvalParser(),
const StacGestureDetectorParser(),
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'dart:ui';

import 'package:freezed_annotation/freezed_annotation.dart';

export 'stac_clip_oval_parser.dart';

part 'stac_clip_oval.freezed.dart';
part 'stac_clip_oval.g.dart';

@freezed
abstract class StacClipOval with _$StacClipOval {
const factory StacClipOval({
@Default(Clip.antiAlias) Clip clipBehavior,
Map<String, dynamic>? child,
}) = _StacClipOval;

factory StacClipOval.fromJson(Map<String, dynamic> json) =>
_$StacClipOvalFromJson(json);
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading