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)
- [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 3
- [Bug] HOT 1
- [Help] HOT 2
- [Help] header or Footer in TextField can't editing on Flutter Web HOT 2
- 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 2
- [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 3
- [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 HOT 2
- [Bug] No ui feedback when pressing enter when editing cell in last row HOT 1
- [Help] HOT 1
- [Feature] Support Flutter Redux HOT 1
- [Bug]
- [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
- [Help] Dynamic height as the number of Rows of the table HOT 2
- the equal filter sometimes not working correctly
- [Feature] OnColumnResized event
- Grid doesn't rebuild while coding
- Is there any way to add background color to puto_grid in headers? 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.