tn_arenas

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

tn arenas

初次上传 #
这是初次上传,我希望通过将自己的代码和公司的资源上传到服务器,来进一步提高产品的性能和稳定性。同时,我也希望能够为其他人提供学习的机会,但是还请大家不要轻易使用,因为这些功能都是按照自己的使用习惯封装的,存在一定的不确定性。
使用说明 #
为了更好的使用体验,在公司内部推广前,我已经对这个包进行了多次测试和优化。如果你是公司内部成员,可以根据具体业务需求进行调整,如果你是其他人,请了解一下功能特点,以便更好地学习使用。
功能特点 #
这个包主要用于表单项封装,请求封装,一些常用工具类封装。其中,主要包括如下几个功能:

工具类

防抖、节流
键盘移除焦点工具
Request 请求类
宽高计算方法
本地存储类


私有类型以及私有本地储存类
扫码UI组件
大数据量选择组件
页面加载更多组件
FormItem封装
DetailItem封装

使用方法 #
工具类 #
防抖、节流
Button(
title: '提交',
onTap: EventFilter.throttle("key", () {
// ...
}),
)
copied to clipboard
键盘移除焦点工具
Future.delayed(Duration(milliseconds: 50), () {
HideKeybUtils.hideKeyShowfocus();
});
copied to clipboard
Request 请求类
class XxxRequest<T> {
static String appId = '';
static String contextPath = '/services/xxx';

static postRequest<T>(url, {required Map options}) {
return Request.post<T>('$contextPath$url', params: options["params"] ?? {}, data: options["data"], appId: appId, baseUrl: RequestConfig.baseUrl);
}

static getRequest(url, params) {
return Request.get('$contextPath$url', params: params, appId: appId, baseUrl: RequestConfig.baseUrl);
}

static putRequest(url, {required Map options}) {
return Request.put('$contextPath$url', params: options["params"] ?? {}, data: options["data"], appId: appId, baseUrl: RequestConfig.baseUrl);
}
}

copied to clipboard
宽高计算方法
Container(
height: ScreenAdapter.height(400)
width: ScreenAdapter.width(100)
)
// 获取屏幕宽度
ScreenAdapter.getScreenWidth()
// 获取屏幕高度
ScreenAdapter.getScreenHeight()
copied to clipboard
本地存储类
class XxxStorage {
static Future<void> setXxxx(value) async {
await Storage.setString("XXXXX", jsonEncode(value));
}

static Future<List<XxxxAuths>> getXxxx() async {
var action = await Storage.getString("XXXXX") ?? '';
return XxxxAuths.formJson(jsonDecode(xxxx)).data;
}

static Future<void> removeXxxx() async {
Storage.removeString("XXXXX");
}
}
copied to clipboard
组件类 #
扫码UI组件
ScanWidget(
onChanged: (value) {},
title: "扫码",
content: "xxxx",
isShowButton: true,
jobPageFunction: () {},
)
copied to clipboard
大数据量选择组件
List<BrnSelectCityModel> hotCityList = [];
List<BrnSelectCityModel> cityList = [];
BrnSingleSelectDevicePage(
hotCityList: hotCityList,
cityList: cityList,
appBarTitle: "xxxx",
key: sonKey
)
copied to clipboard
页面加载更多组件
bool hasMore = true; //判断有没有数据
bool _isInit = false; // 是否初始化
_isInit?
// ...
:MoreWidgetPage(hasMore: hasMore)
copied to clipboard
FormItem封装
void _onSubmit() {
if (_formKey.currentState!.validate()) {
// ...
}
}

Form(
key: _formKey,
child: Column(
children: [
InputNumberFormItem(
label: "",
value: "",
required: false,
error: "",
unit: "",
onValidator: (value) {},
onChange: (value) {}
);
InputFormItem(
label: "",
value: "",
required: false,
error: "",
unit: "",
onValidator: (value) {},
onChange: (value) {}
);
SwitchFormItem(
label: "",
value: "",
required: false,
error: "",
onValidator: (value) {},
onChange: (value) {}
);
EnumFormItem(
context: context,
label: "",
value: "",
required: false,
error: "",
options: BrnMultiDataPickerEntity[],
onValidator: (value) {},
onChange: (value) {}
);
TimeFormItem(
context: context,
label: "",
value: "",
required: false,
error: "",
onValidator: (value) {},
onChange: (value) {}
);
DateTimeFormItem(
context: context,
label: "",
value: "",
required: false,
error: "",
onValidator: (value) {},
onChange: (value) {}
);
DateFormItem(
context: context,
label: "",
value: "",
required: false,
error: "",
onValidator: (value) {},
onChange: (value) {}
);
Button(
title: '提交',
onTap: EventFilter.throttle("dynamicForm", _onSubmit),
)
]
)
)
copied to clipboard
DetailItem封装
TextDetailItem(label: "xxxx", content: "xxxxx"),
WidgetDetailItem(label: "xxxx", content: Text("xxxx")),
TextAreaDetailItem(label: "工单描述", content: "xxxxxxx"),
copied to clipboard
风险提示 #
虽然我尽力将这个包做到尽善尽美,但是在使用它的时候,请务必注意以下几个方面:

数据的备份
安全性处理
使用方式
遵循本地法律法规等等

鉴于包存在一定的风险,我强烈建议在使用前多次测试,并严格遵守用户协议。
更新说明 #
随着产品需求的不断变化,我将会对这个包进行及时更新,或者提供新的解决方案。如果您有需要,请随时向我反馈,我也会及时提供技术支持和服务。

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.