图像精灵DFImageSprite,用于显示一张图像 创建示例: /// Logo精灵
DFImageSprite logoSprite = await DFImageSprite.load("assets/images/sprite.png");
logoSprite.scale = 0.6;
logoSprite.position = DFPosition(MediaQuery.of(con
本站欢迎大家分享优质的源码和程序, 本站内容来源于作者发布和网络转载,如有版权相关问题请及时与我们取得联系,我们将立即删除。
今日推荐
活动倒计时:00:00:00

88
水晶

188
水晶

188
水晶
最新动态
文本精灵DFTextSprite,顾明思议,用于显示文本,和普通的Text Widget的区别是文本精灵是可以跟着游戏里的数据变化,可以自动实现刷新的。比如玩家的血量的显示。 而Text Widget是UI控件,更多的是用于UI界面的静态展示,不适合刷新频繁的场景。 显示游戏实时帧数使用示例: /// 帧数精灵
DFTextSprite fpsSprite = DFTextSprite("60
场景就是普通的Widget,我们来看下GameScene类的定义: class GameScene extends StatefulWidget {
final int map;
GameScene({this.map = 1});
@override
_GameSceneState createState() => _GameSceneState();
}
class _G
小提示 /// 中间位置 YmUiUtil.showToast(context,"这是一条Toast"); /// 指定位置
YmToast.show("这是一条Toast", context, duration: YmToast.lengthShort, gravity: YmToast.bottom);

弹出框 YmUiUtil.showLoading(context);
Future.delayed(Duration(seconds: 3), () {
YmUiUtil.hideLoading(context);
}); YmUiUtil.showAlertDialog(context, "确认提示", "您确定要打开弹窗吗?", "确定", "取消",onOkPressed: (){


Get请求 YmHttp().postForm(url
,{"参数":"值","参数":"值"}
,success: (data) {
print("成功:" + data.toString());
}
,error: (error) {
print("失败:" + error.toString());
}
,complete: (){
print("完成");
}
)
单选按钮,多选按钮 Row(
children: [
YmCheckButton(value:0,
checked:_radioGroupValue1==0,
onChanged: (bool checked,dynamic value){
_checkedSingleButton(checked,value);
},
text: "单选1",
ima

Tab按钮 List _tabButtonList = ["全部","待付款","待发货"];
int _tabButtonSelectedIndex = 0;
YmTabButton(_tabButtonList.elementAt(index),
textColor:Color(0xffffffff),
fontSize:14,
isSelected:this._tabButto

按钮 YmTextButton("RoundedRectangle", textColor:Color(0xFFFFFFFF),onClick: (){
print("Button Pressed");
}),
YmTextButton("Stadium", textColor:Color(0xFFFFFFFF), onClick:(){
print("Button Pressed");

搜索栏 YmSearchBar(
hint: "请输入关键词",
width: MediaQuery.of(context).size.width - 40,
height: 40,
onSubmitted: (text){
print("搜索$text");
setState(() {
_searchTextValue = text;
});
},
clearCa

软件排行
热门教程