Flutter/Dart Datatable or Sliver with fixed header and fixed row header - flutter

So I want to create a data view for a Flutter app that incorporates a datatable or sliver (or anything really) with a fixed header when scrolling vertically and also fixed row headers when scrolling horizontally. I tried messing around with the data_table_2 and table_sticky_headers plugins, but they don't do exactly what I want. I'm hoping someone can point me in the right direction or help come up with a solution.
Here's a gif image showing what I want to achieve...
Data View Idea

I figured it out. It was pretty simple actually, using nested Stack's and SingleChildScrollView's. No plug-ins required.
Here's a link to the example source code if anyone is interested...
https://github.com/jstoyles/flutter_data_view_idea

Related

How to create cells with different sizes using GridView in Flutter?

I want to create a similar view with Flutter as we can do it by creating a UICollectionViewLayout in iOS .
This is a sample code I am using.
https://github.com/flutter/flutter/blob/b8a2456737c9645e5f3d7210fba6267f7408486f/dev/integration_tests/flutter_gallery/lib/demo/material/grid_list_demo.dart
How to achieve this using GridView in Flutter. If not GridView, is there any other way to do it?
GridView is not designed to do this. You may be able to get a Wrap to do what you want, although from your example it may not quite do it (horizontally it definitely wont as it arrange the items into rows; vertically it might work for you or might not depending on exactly what you're doing).
If you're only ever going to have the two columns, you could simply have a Row containing two Columns and make sure to put the items in the right columns.
Or the more complicated but probably best answer would be to write the logic for arranging the items this way yourself - see CustomMultiChildLayout.
EDIT: there is also a package that may work for you. It can't do arbitrary sizing, and you need to know the sizes of the items in advance, but you can specify items to take up multiple rows or columns of the grid. See it here.
Note that if you have a lot of items, you'll probably want to do something with a CustomScrollView but that isn't really in the scope of this answer.
https://github.com/letsar/flutter_staggered_grid_view
This would help you. I think the plugin gives different size.

`ListView` not scrolling to exact position when a few list item are of big height

I'm using ListView to display my dynamic content. Based on selected option, I've to scroll to some specified position in ListView. This works great when the list item height is not that big, i.e. it covers the whole screen. But when big height item are present in list, the scroll doesn't take me to proper position, instead it takes to some in between position. I tried using both of the following but same result.
listView.smoothScrollToPosition(myItems.indexOf(thisItem));
listView.setSelection(myItems().indexOf(thisItem));
Can anybody point the possible cause of the issue and also give some suggestions.
The workaround suggested here worked for me except that I called both functions, smoothScrollToPosition and setSelection, sequentially instead of using OnScrollListener. Though its not giving smooth scrolling effect but it's fulfilling my requirement. If any body can suggest a more proper solution, it's welcomed.

Vertical oriented Metro WinJS ListView in Grouped Mode

I'm banging my head against the wall trying to implement a ListView with grouped items that renders like the WP7 LongListSelector shown below. I've tried adding a win-vertical class to the element with the data-win-control="WinJS.UI.ListView" but since win-vertical seems to only apply to the viewport that didn't work. Any help would be greatly appreciated.
What kind of ListView Layout are you using? Using ListLayout instead of GridLayout does change the scroll direction from Horizontal to Vertical. But I don't see an easy way to add a group header for ListLayout list view. For GridLayout, there is a groupHeaderPosition property, but ListLayout object doesn't have this property. (Someone actually complained about the same thing.. at the end of this page)So, you might need to hack around for the group names by adding a dummy "group name" item into your data source and sort it properly.
Ref:
http://msdn.microsoft.com/en-us/library/windows/apps/br211837.aspx
http://msdn.microsoft.com/en-us/library/windows/apps/br211792.aspx

is there any method to get the row and column number in a uitextview

I am trying to achieve a task in which the user the will create notes just like iNotes.app, for this i have to give some padding from left, in my case the padding is little more than the actual iNotes(app) and the problem with this is, If I complete the whole line it goes out of view/screen and user cant see.
To solve this Issue I first I used
UIEdgeInsetsMake(0,40,0,-40);
//this thing makes the content non-scrollable horizontaly
//but the text still goes out of screen
Then I used
UIEdgeInsetsMake(0,40,0,0);
//By doing this the content becomes horizontally
//scrollable and the content appear as per scrolling.
I don't want my textview to scroll Horizontally and I want it to show the content without cutting anything.
Please guide my what should I do to tackle this problem and
If my approach is wrong please suggest any other way. Thanks in Advance :)

A GWT CellTable with frozen header and initial column

I need to freeze the first column and first row of data in a CellTable, so that users can scroll through the data but still see the labels on the "axes." The first column should scroll when the user scrolls up and down, and the header row should scroll when the user scrolls left and right. Think "Freeze Panes" in Excel.
I'm using GWT 2.1 and am willing to write my own widget to do this if no solutions already exist. My question is a two-parter:
Do any widgets already have this behavior?
Any suggestions if I'm going to implement this myself?
Thanks!
I implemented a solution myself. Check out http://larkolicio.us/ScrollTable/ExperimentTables.html
It's a LayoutPanel with three AbsolutePanels inside it. The frozen columns are a CellTable, the main part is a CellTable, and the header is a Grid - I could find no way to set the width of a CellTable column! A ScrollHandler links the main part to the two frozen parts. There is a little bit of delay - I'd appreciate it if someone could find a way to get rid of the lag between the sections.
I got it working to a point that I could use it, and stopped. It is not a general-purpose widget. Please feel free to use it at your own risk.
This implementation is quite good. I have just tested it. It however needs some changes made to support asynchronous loading. GWT Issue 188 covering similar request for enhacement was created on Oct 2006?!
Thanks for sharing.