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
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "Circular Progress Indicator"
}
},
"body": {
"type": "center",
"child": {
"type": "column",
"crossAxisAlignment": "center",
"spacing": 52,
"children": [
{
"type": "sizedBox",
"height": 1
},
{
"type": "circularProgressIndicator",
"color": "#672BFF",
"strokeWidth": 3
},
{
"type": "circularProgressIndicator",
"color": "#541204",
"strokeWidth": 6,
"backgroundColor": "#FFD700",
"strokeCap": "round"
},
{
"type": "circularProgressIndicator",
"color": "#bd3ed3",
"strokeWidth": 3,
"value": 0.5
}
]
}
}
}
68 changes: 68 additions & 0 deletions examples/mirai_gallery/assets/json/home_screen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,74 @@
}
}
},
{
"type": "listTile",
"leading": {
"type": "icon",
"iconType": "material",
"icon": "star"
},
"title": {
"type": "text",
"data": "Mirai Circular Progress Indicator",
"align": "center",
"style": {
"fontSize": 21
}
},
"subtitle": {
"type": "text",
"data": "A Material Design Circular Progress Indicator widget",
"align": "center",
"style": {
"fontSize": 12
}
},
"isThreeLine": false,
"style": "list",
"onTap": {
"actionType": "navigate",
"navigationStyle": "push",
"widgetJson": {
"type": "exampleScreen",
"assetPath": "assets/json/circular_progress_indicator_example.json"
}
}
},
{
"type": "listTile",
"leading": {
"type": "icon",
"iconType": "material",
"icon": "star"
},
"title": {
"type": "text",
"data": "Mirai Linear Progress Indicator",
"align": "center",
"style": {
"fontSize": 21
}
},
"subtitle": {
"type": "text",
"data": "A Material Design Linear Progress Indicator widget",
"align": "center",
"style": {
"fontSize": 12
}
},
"isThreeLine": false,
"style": "list",
"onTap": {
"actionType": "navigate",
"navigationStyle": "push",
"widgetJson": {
"type": "exampleScreen",
"assetPath": "assets/json/linear_progress_indicator_example.json"
}
}
},
{
"type": "sizedBox",
"height": 24.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "Linear Progress Indicator"
}
},
"body": {
"type": "padding",
"padding": {
"left": 10,
"right": 10
},
"child": {
"type": "column",
"crossAxisAlignment": "center",
"spacing": 52,
"children": [
{
"type": "sizedBox",
"height": 1
},
{
"type": "linearProgressIndicator",
"color": "#672BFF",
"minHeight": 3
},
{
"type": "linearProgressIndicator",
"color": "#541204",
"minHeight": 6,
"backgroundColor": "#FFD700",
"borderRadius": {
"topLeft": 10,
"topRight": 10,
"bottomLeft": 10,
"bottomRight": 10
}
},
{
"type": "linearProgressIndicator",
"color": "#bd3ed3",
"minHeight": 3,
"value": 0.5
}
]
}
}
}
4 changes: 3 additions & 1 deletion packages/mirai/lib/src/framework/mirai.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class Mirai {
const MiraiTableCellParser(),
const MiraiCarouselViewParser(),
const MiraiColoredBoxParser(),
const MiraiDividerParser()
const MiraiDividerParser(),
const MiraiCircularProgressIndicatorParser(),
const MiraiLinearProgressIndicatorParser(),
];

static final _actionParsers = <MiraiActionParser>[
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'dart:ui';

import 'package:freezed_annotation/freezed_annotation.dart';

export 'package:mirai/src/parsers/mirai_circular_progress_indicator/mirai_circular_progress_indicator_parser.dart';

part 'mirai_circular_progress_indicator.freezed.dart';
part 'mirai_circular_progress_indicator.g.dart';

@freezed
class MiraiCircularProgressIndicator with _$MiraiCircularProgressIndicator {
const factory MiraiCircularProgressIndicator({
double? value,
String? backgroundColor,
String? color,
@Default(4.0) double strokeWidth,
@Default(0) double strokeAlign,
String? semanticsLabel,
String? semanticsValue,
StrokeCap? strokeCap,
}) = _MiraiCircularProgressIndicator;

factory MiraiCircularProgressIndicator.fromJson(Map<String, dynamic> json) =>
_$MiraiCircularProgressIndicatorFromJson(json);
}
Loading
Loading