A runtime application plugin for flutter. Using js_script for logic script, and xml_layout for UI template.
DApp(
// Load main.js and main.xml as the entry widget
entry: '/main',
fileSystems: [
// A file wrap for reading script and template
fileSystem,
],
)
- Attribute
- appBar
PreferredSizeWidget
- body
Widget
- floatingActionButton
Widget
- drawer
Widget
- endDrawer
Widget
- bottomNavigationBar
Widget
- bottomSheet
Widget
- background
Color
- resizeToAvoidBottomInset
bool
- appBar
- Child Same as the
body
attribute.
- Attributes:
- mainAxisAlignment
MainAxisAlignment
default: MainAxisAlignment.start - mainAxisSize
MainAxisSize
default: MainAxisSize.max - crossAxisAlignment
CrossAxisAlignment
default: CrossAxisAlignment.center - verticalDirection
VerticalDirection
VerticalDirection.down - textDirection
TextDirection
- textBaseline
TextBaseline
- mainAxisAlignment
- Children
Widget
- Attributes:
- mainAxisAlignment
MainAxisAlignment
default: MainAxisAlignment.start - mainAxisSize
MainAxisSize
default: MainAxisSize.max - crossAxisAlignment
CrossAxisAlignment
default: CrossAxisAlignment.center - verticalDirection
VerticalDirection
VerticalDirection.down - textDirection
TextDirection
- textBaseline
TextBaseline
- mainAxisAlignment
- Children
Widget
- Attributes:
- widthFactor
double
- heightFactor
double
- widthFactor
- Child
Widget
- Attributes:
- onPressed
Void Function
- onLongPress
Void Function
- type
DButtonType
default: DButtonType.elevated - minimumSize
Size
- tapTargetSize
MaterialTapTargetSize
- padding
EdgeInsets
- color
Color
- onPressed
- Child
Widget
- Description:
- Load another dapp widget.
- Attibutes:
- src
String
- data
any
. Pass to theload
function as the first argument.
- src
- Attributes:
- leading
Widget
- actions
List<Widget>
- bottom
PreferredSizeWidget
- brightness
Brightness
- background
Color
- color
Color
- height
double
default:56
- leading
- Child
Widget
- Attributes:
- builder
Widget Function(context, index)
- itemCount
int
default:0
- builder
- Children
Widget
available when builder is null.
- Description:
- Almost same as
ListTile
in dart, could be used in list-view.
- Almost same as
- Attributes:
- leading
Widget
- title
Widget
- subtitle
Widget
- trailing
Widget
- onTap
Void Function
- dense
bool
- padding
EdgeInsets
- color
Color
- leading
- Description:
image
tag is same asimg
tag
- Attributes:
- src
String
- width
double
- height
double
- fit
BoxFit
default: BoxFit.contain - headers
Map
- http headers, available when
src
is net image.
- http headers, available when
- gaplessPlayback
bool
default: false
- src
- Description:
- Generate a
Void Function
, and pass custom arguments
- Generate a
- Attributes:
- function
String
the function name in script. - args
List
the arguments.
- function
- Descrition:
- Drag down to refresh and load more widget.
- Attributes:
- loading
bool
- onRefresh
Void Function
- onLoadMore
Void Function
- refreshInset
double
default: 36
- loading
- Child
Widget
the scrollable widget.
- Descrition:
- Wrap of
DefaultTabController
- Wrap of
- Attributes:
- scrollable
bool
default: false - elevation
double
default: 0 - background
Color
- scrollable
- Children
TabItem
- Descrition:
- Generate a
TabItem
- Generate a
- Attributes:
- title
String
- icon
Widget
- title
- Child
Widget
- Attributes:
- placeholder
String
- text
String
- autofocus
bool
default: false - onChange
Void Function(String newText)
- onSubmit
Void Function(String text)
- onFocus
Void Function
- onBlur
Void Function
- style
TextStyle
- placeholder
- Attributes:
- size
double
- color
Color
- size
- Child
IconData
- Description:
- Generate a
TextStyle
- Generate a
- Attributes:
- color
Color
- background
Color
- size
double
- color
- Attributes:
- alignment
Alignment
default: Alignment.topLeft - textDirection
TextDirection
- fit
StackFit
default: StackFit.loose - clip
Clip
default: Clip.hardEdge
- alignment
- Children
Widget
- Description:
- Generate a
Container
- Generate a
- Attributes:
- width
double
- height
double
- color
Color
- animate
bool
default: false - duration
Duration
avaiable whenanimate
is true - clip
Clip
default: Clip.none - border
Border
- radius
BorderRadius
- gradient
Gradient
- padding
EdgeInsets
- alignment
Alignment
- margin
EdgeInsets
- width
- Attributes:
- top
BorderSide
default: BorderSide.none - right
BorderSide
default: BorderSide.none - bottom
BorderSide
default: BorderSide.none - left
BorderSide
default: BorderSide.none
- top
- Attributes:
- color
Color
default: Colors.black - width
double
default: 1.0 - style
BorderStyle
default: BorderStyle.none
- color
- Attributes:
- vertical
BorderSide
default: BorderSide.none - horizontal
BorderSide
default: BorderSide.none
- vertical
- Attributes:
- begin
Alignment
default: Alignment.centerRight - end
Alignment
default: Alignment.centerRight - colors
List<Color>
- stops
List<double>
- mode
TileMode
default: TileMode.clamp
- begin
- Attributes:
- center
Alignment
default: Alignment.center - radius
double
default: 0.5 - colors
List<Color>
- stops
List<double>
- mode
TileMode
default: TileMode.clamp - focal
Alignment
- focalRadius
double
default: 0
- center
- Description:
- Wrap of
CustomScrollView
- Wrap of
- Attributes:
- direction
Axis
default: Axis.vertical - reverse
bool
default: false
- direction
- Children
Widget
- Attrbutes:
- builder
Widget Function(context, index)
- itemCount
int
default: 0
- builder
- Children
Widget
available when builder is null.
- Attrbutes:
- leading
Widget
- actions
List<Widget>
- bottom
PreferredSizeWidget
- brightness
Brightness
- background
Color
- color
Color
- floating
bool
default: false - expandedHeight
double
- leading
- Child
Widget
as the title of AppBar
- Attributes:
- padding
EdgeInsets
- background
Widget
- center
bool
- mode
CollapseMode
default: CollapseMode.parallax
- padding
- Child
Widget
as the title
- Child
Widget
- Attributes:
- lines
int
- overflow
TextOverflow
- lines
- Children
InlineSpan
or text
- Description:
- Generate a
TextSpan
when child is text orList<TextSpan>
, Generate aWidgetSpan
when child is Widget.
- Generate a
- Attributes:
- flex
int
default: 1
- flex
- Attributes:
- type
String
options:vertical
,horizontal
- width
double
available when type isvertical
- height
double
available when type ishorizontal
- thickness
double
- indent
double
- endIndent
double
- type
- Description:
- A wrap of
PopupMenuButton
in flutter
- A wrap of
- Attributes:
- onSelected
PopupMenuItemSelected
- onCanceled
PopupMenuCanceled
- items
List<PopupMenuEntry>
- padding
EdgeInsets
default: EdgeInsets.all(8.0) - tooltip
String
- elevation
double
- icon
Widget
- iconSize
double
- offset
Offset
default: Offset.zero - enabled
bool
default: true - color
Color
- onSelected
- Child
Widget
- Description:
- A wrap of
PopupMenuItem
in flutter
- A wrap of
- Attributes:
- value
any
- enabled
bool
default: true - height
double
default: kMinInteractiveDimension - padding
EdgeInsets
- style
TextStyle
- color
Color
- size
double
- value
- Child
Widget
- Description:
- A wrap of
PopupMenuDivider
in flutter
- A wrap of
- Attributes:
- height
double
default: 16
- height
- Description:
- A wrap of
AnimatedSwitcher
in flutter
- A wrap of
- Attributes:
- duration
Duration
default: Duration(milliseconds: 300) - axis
Axis
default: Axis.vertical
- duration
- Child
Widget
- Description:
- A wrap of
GridView
in flutter
- A wrap of
- Attributes:
- builder
IndexedWidgetBuilder
- itemCount
int
default: 0 Available whenbuilder
is not null - padding
EdgeInsets
default: EdgeInsets.zero - crossAxisCount
int
default: 4 - childAspectRatio
double
default: 1
- builder
- Children
Widget
Available whenbuilder
is null
- Description:
- A wrap of
SliverGridView
in flutter
- A wrap of
- Attributes:
- builder
IndexedWidgetBuilder
- itemCount
int
default: 0 Available whenbuilder
is not null - crossAxisCount
int
default: 4 - childAspectRatio
double
default: 1
- builder
- Children
Widget
Available whenbuilder
is null
<if candidate="js(isFavorate)">
<view color="red"/>
</if>
- Description:
- Call method define in the js script.
<callback function="getItem" array="array(arg1, arg2)"/>
- Description:
- Convert arguments to a
List
.
- Convert arguments to a
- Description:
- Get length of list.
- Description:
- return
a
iftest
equal true, otherwise returnb
.
- return