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 detect cell value change without "exiting" the cell HOT 2
- [Help] How to customize the keyboard buttons for numbers value in android HOT 2
- [Help] Copy the content of selecting cell to the clipboard HOT 2
- [Bug] HOT 2
- [Help] Why PlutoDualGridProps onSelected Callback? HOT 2
- TextField Focus issue HOT 2
- [Help] How to disable (showFilterPopup)?[Help] HOT 2
- Show some empty space on the top of first row only in mobile phone HOT 6
- How to move to the next cell automatically when press done button from the android keyboard? HOT 2
- [Feature] Checkbox Column does not respect checkboxTheme of ThemeData HOT 2
- [Issue] date format HOT 2
- [Help] Inline editing date, time or select column HOT 2
- Reagrding Conflict with Pluto_Grid_Plus with Pluto_Grid [Help] HOT 2
- [Help] Is there is a way to remove this extra space/footer HOT 2
- [Help] how to set gridBorderWidth HOT 3
- [Feature] clipped new line should count as overflow HOT 2
- [Help]how to set color for icon of a specific item.? HOT 2
- Search HOT 1
- cellColorCallback [Feature] HOT 1
- [Feature] Support for merging cells, colSpan rowSpan HOT 2
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.