Comments (4)
And yet in your code you have scrollable wrapping the widget and it is the very first thing I would point at...
Could you please provide a minimal reproduction sample based on any of the examples from /example folder?
from data_table_2.
Hi Maxim,
The ScrollView makes no difference. It is tough to give you a reproduction sample as it integrates with a custom websocket. Can I ask the question differently: have you tested the DataTable2 with a Stream? (especially one that that updates frequently (about 10 times a second))?
It is not necessary for me to use DataTable2, but I like and appreciate what you started doing with it, and thought I would likely contribute by pointing it out to you... since the same wrapper with DataTable 'native' works, there is obviously an issue in how I used DataTable2 here or a bug in it.
If it helps - below is a near complete stateful widget
class _MyHomePageState extends State<MyHomePage> {
final _channel = WebSocketChannel.connect(
Uri.parse('ws://localhost:8080/despatcher'),
);
@override
void dispose() {
_channel.sink.close();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Padding(
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
StreamBuilder(
stream: _channel.stream,
builder: (context, snapshot) {
if (snapshot.hasData) {
final data = snapshot.data as Uint8List;
if (data.isNotEmpty) {
final list =
ObjectList.fromByteData(data.buffer.asByteData());
return DataTable2(
rows: List<DataRow>.generate(
list.nofObjects,
(index) => DataRow(cells: [
DataCell(Text(list.detail[index].x
.toStringAsPrecision(2)))
])),
columns: const [DataColumn2(label: Text('X'), size: ColumnSize.S)],
);
} else {
return const Text("No Data");
}
}
{
return const Text("No Data");
}
},
)
],
),
),
);
}
from data_table_2.
Found the answer...
child: Column(
children: [
Expanded(
child: StreamBuilder(
stream: _channel.stream,
Didn't need this with DataTable. Apologies and thanks.
from data_table_2.
Great that you solved it
from data_table_2.
Related Issues (20)
- Horizontal Scroll in Table with mouse wheel
- How do I make DataRow2 react to Theme changes? HOT 6
- DataRow2 decoration property improvement HOT 2
- Alignment center HOT 3
- Visibility of scroll indicator HOT 1
- Column is not handled by HorizontalScrollController
- Adding a TextField to DataRow2 and implementing onSubmitted doesn't listen to the Enter key next to the numeric keypad.
- InfiniteScroll And PullToRefresh implementation
- AsyncDataTableSource.selectAll() seems that not update _selectionRowKeys correctly
- DataTable2 with SliverMainAxisGroup/SliverToBoxAdapter non-zero flex but incoming height constraints are unbounded HOT 4
- DataCell onTap is slow / laggy HOT 1
- Only start stopwatch when dataTableShowLogs && kDebugMode is true HOT 1
- [Feature Request] Grouping HOT 1
- Support merged cells, colSpan rowSpan
- Does it support a tree structure? HOT 1
- After flutter pub upgrade data_table_2 showing error HOT 10
- Disable focus for cells without an onTap handler
- Add support for column aggregates
- Error: Type 'WidgetStateProperty' not found. HOT 2
- fetch items from scratch
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 data_table_2.