A easy, extensible and dynamic flutter form framework. Support for custom selectors, validators and widgets. Support form verification, insert, delete and so on.
Add this to your package's pubspec.yaml file:
dependencies:
tform: ^1.0.1
A easy, extensible and dynamic flutter form framework. Support for custom selectors, validators and widgets. Support form verification, insert, delete and so on.
License: MIT License
兄弟能否留下vx? 想参与进一步完善此项目
` if (row.options == null || row.options.isEmpty) return;`
代码中当options长度为0的时候,可以加一个当前无可选项的提示吗
我还是初学者,有什么不对请指出,另外调试是不是直接打开example中的程序就可以了。
ps: 我提交了一个PR
能否增加字母自动转换为大写功能
════════ Exception caught by services library ══════════════════════════════════
Tried to get the bounds of a focus node that didn't have its context set yet.
The context needs to be set before trying to evaluate traversal policies. Setting the context is typically done with the attach method.
'package:flutter/src/widgets/focus_manager.dart':
Failed assertion: line 748 pos 9: 'context != null'
where is NextButton?
问题如题,你的reload方法也只是刷新第一次传入的rows变量,你没有在改变的时候重新修改rows变量。
这样的话,比如我有一个需求是当A行改变时候会,将B,C行的value也改变;这样的需求将无法实现。
最后,这是你最初设计时的预想吗,求解惑!
import 'package:flutter/material.dart';
import 'package:tform/tform.dart';
class PartForm {
String partNum;
String partSpecification;
String weight;
PartForm({this.partNum, this.partSpecification, this.weight});
}
class TabResourcePage extends StatefulWidget {
const TabResourcePage({Key key}) : super(key: key);
@override
_TabResourcePageState createState() => _TabResourcePageState();
}
class _TabResourcePageState extends State<TabResourcePage> {
final GlobalKey _formKey = GlobalKey<TFormState>();
var form = PartForm(partNum: "1", partSpecification: "2*2", weight: "100");
var options = ["10", '2'];
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
children: [
Text("form.partSpecification:${form.partSpecification}"),
TextButton(
onPressed: () {
setState(() {
form.partSpecification = "";
});
},
child: Text("clear")),
TextButton(
onPressed: () {
setState(() {
form.partSpecification += "123";
});
},
child: Text("add")),
Expanded(
child: TForm.builder(
key: _formKey,
rows: [
TFormRow.input(
title: "规格123",
placeholder: "规格",
value: form.partSpecification,
textAlign: TextAlign.right,
onChanged: (TFormRow row) {},
),
// 我把这两列放开注释,hot Reload也不会将组件刷新
// TFormRow.input(
// title: "数量",
// placeholder: "数量",
// value: form.partNum,
// textAlign: TextAlign.right,
// onChanged: (TFormRow row) {},
// ),
// TFormRow.input(
// title: "重量",
// placeholder: "重量",
// value: form.weight,
// textAlign: TextAlign.right,
// onChanged: (TFormRow row) {},
// ),
],
divider: Divider(
height: .5,
thickness: .5,
),
),
),
],
),
),
floatingActionButton: IconButton(
onPressed: () {
setState(() {
form.partSpecification += "refresh";
print(form.partSpecification);
// TForm.of(context).reload();
(_formKey.currentState as TFormState).reload();
});
},
icon: Icon(Icons.refresh),
),
);
}
}
使用场景: 密码显示和隐藏
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.