Comments (6)
Is it this type of UI?
This is not in PlutoGrid, but I plan to work on a new project called PlutoInputPanel (tentative name).
This hasn't started yet.
I don't know if this will be your reference right away, but I made the structure simple.
However, the code below was written in scratch state without the help of IDE's Auto-complete. Because of this, there may be problems with grammatical errors or referring to missing properties.
class PanelRow extends StatefulWidget {
final Handler handler;
final rowIdx;
PanelRow(this.handler, this.rowIdx);
@override
_PanelRowState createState() => _PanelRowState();
}
class _PanelRowState extends State<PanelRow> {
final FocusNode focusNode = FocusNode();
@override
Widget build(BuildContext context) {
if (widget.handler.currentRowIdx == rowIdx) {
FocusScope.of(ctx).requestFocus(focusNode);
}
return Container(
child: Row(
children: [
TextField(
focusNode: focusNode,
),
FlatButton(
onTap: () {
handler.setCurrentRowIdx(widget.handler.currentRowIdx + 1);
},
),
],
),
);
}
}
class Panel extends StatefulWidget {
final rows;
Panel(this.rows);
@override
_PanelState createState() => _PanelState();
}
class _PanelState extends State<Panel> {
final Handler handler;
final FocusNode focusNode;
initState() {
handler = Handler();
focusNode = FocusNode(onKey: handler.keyboardHandler);
}
@override
Widget build(BuildContext context) {
return RawKeyboardListner(
focusNode: focusNode,
child: ListView.builder(
itemCount: widget.rows.length,
builder: (context, index) {
return PanelRow(
rowIdx: index,
handler: handler,
);
}
),
);
}
}
class Handler extends ChangeNotifier {
int currentRowIdx = 0;
void setCurrentRowIdx(int idx) {
currentRowIdx = idx;
notifyListeners();
}
bool keyboardHandler(FocusNode node, RawKeyEvent event) {
// if key pressed arrowDown
setCurrentRowIdx(currentRowIdx - 1);
// if key pressed arrowUp
setCurrentRowIdx(currentRowIdx + 1);
}
}
from pluto_grid.
from pluto_grid.
Hello. First of all, thank you for your good comments and good package introduction.
The way the grid works is simple.
The grid uses ChangeNotifier to manage its state.
That's the PlutoStateManager.
The widget receives it and reads the state, or registers an addListener to detect state changes.
The addListener callback detects any state change, and when the widget needs state change, it executes setState to reflect the state change.
This is an explanation of the simple operation.
If you have any further explanations, please ask me and I will sincerely respond.
And, the GetX you mentioned looks very good. I'll take a closer look and try to apply it.
Thanks again for the introduction and comments of the good package.
from pluto_grid.
from pluto_grid.
from pluto_grid.
Yes. I also want to quickly enter, edit, and move data using the keyboard.
I would like to quickly implement the requirements you mentioned.
Thanks for the good comment.
from pluto_grid.
Related Issues (20)
- 分页按钮颜色是不是不可以调整[Feature] HOT 2
- [Help] open Editing Mode on spec column (All Row ) by one click ! HOT 2
- [Help] Can we create a custom widget in cells instead of standard ones like text, number, date, time, etc? HOT 2
- [Help] how can i make the rows update automatically when a provider value changes HOT 2
- Showing two lines at the end HOT 2
- [Help] How to write text to filter field of the grid? HOT 1
- How can i set fontWeight: FontWeight.bold in PlutoRow => PlutoCell ?[Help] HOT 2
- [Bug] HOT 1
- [Help] HOT 1
- [Help] header or Footer in TextField can't editing on Flutter Web HOT 1
- Onchanged function is not called correctly HOT 1
- [Help] when i build pluto grid the first row be active i want to not activated by default HOT 1
- [Help] I am using Pluto Grid I want to implement drop down in cell selection for that I am using "renderer" and I am implementing a custom searchable drop down the issue I am facing is that the text field is not working I am not able to type in the text field of the drop down HOT 1
- [Bug] Because pluto_grid_export >=1.0.5 depends on pluto_grid >=3.0.2 <8.0.0 and getx_admin_panel depends on pluto_grid ^8.0.0, pluto_grid_export >=1.0.5 is forbidden. So, because getx_admin_panel depends on pluto_grid_export ^1.0.5, version solving failed. You can try the following suggestion to make the pubspec resolve: * Consider downgrading your constraint on pluto_grid: flutter pub add pluto_grid:^7.0.2
- [Bug] No ui feedback when pressing enter when editing cell in last row
- [Help]
- [Feature] Support Flutter Redux
- [Bug] HOT 1
- [Help] How to change row color after changing cells
- Error: The argument type 'RawKeyEvent' can't be assigned to the parameter type 'KeyEvent'.[Bug] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pluto_grid.