-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
denny.deng
committed
Jul 23, 2021
1 parent
6a30509
commit 29e3b95
Showing
6 changed files
with
261 additions
and
1 deletion.
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
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
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,42 @@ | ||
|
||
import 'package:dynamic_widget/dynamic_widget.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/src/widgets/framework.dart'; | ||
|
||
import '../utils.dart'; | ||
|
||
class DividerWidgetParser extends WidgetParser{ | ||
@override | ||
Map<String, dynamic>? export(Widget? widget, BuildContext? buildContext) { | ||
Divider realWidget = widget as Divider; | ||
return <String, dynamic>{ | ||
"type": widgetName, | ||
"height": realWidget.height, | ||
"thickness": realWidget.thickness, | ||
"indent": realWidget.indent, | ||
"endIndent": realWidget.endIndent, | ||
"color": realWidget.color != null | ||
? realWidget.color!.value.toRadixString(16): null, | ||
}; | ||
|
||
} | ||
|
||
@override | ||
Widget parse(Map<String, dynamic> map, BuildContext buildContext, ClickListener? listener) { | ||
|
||
return Divider( | ||
height: map["height"], | ||
thickness: map["thickness"], | ||
indent: map["indent"], | ||
endIndent: map["endIndent"], | ||
color: parseHexColor(map['color']), | ||
); | ||
} | ||
|
||
@override | ||
String get widgetName => "Divider"; | ||
|
||
@override | ||
Type get widgetType => Divider; | ||
|
||
} |