data_sheet 0.0.2 copy "data_sheet: ^0.0.2" to clipboard
data_sheet: ^0.0.2 copied to clipboard

retracted

Data table with in-cell-edit, scroll, with callback feature for select-rows, sort, update and custom-contents

DataSheet Widget with Scroll/Edit/Sort/Select Options #

Description #

I was looking for a widget that allows views with fixed header/columns, in-situ editing, locking of cells etc and above all to handle large data.

After searching I did find horizontal_data_table, but it still didn't meet the expectations; so thought of developing myself.

This package is the outcome. I hope you find it useful. You are welcome to comment, contribute to improve the package.

Performance #

Have tried it on android mobile as well as on web with 2048 Rows x 512 columns, without noticing any performance issue.

Features #

  • Quick and Light Weight widget
  • Pin Top-rows/ Left-columns so they are always visible
  • In-situ editing
  • Auto Scroll to next cell on edit completion
  • Dropdown suggestions
  • Adjustable Column widths
  • Decoration/Style for rows, columns
  • Select/deselect cell/rows
  • Allows custom widgets as cell content

Installation #

Install data_table

  flutter pub add data_table

Demo #

[Fixed Column Widths]

[Column Widths in Pixels]

[Column Width Proportionate to Widget Width]

[Scroll]

[Edit]

[Sort]

[Select]

Usage/Examples #

import 'data_table/data_table.
/// --------------------------------------
///  Build parametes to be passed
/// --------------------------------------

List<CellSetup> _cellSetups = [
                CellSetup(selected:_selected),
                CellSetup(
                    textInputType:TextInputType.name, 
                    defaultSort: EditAction.sortA2Z, selected:_selected),
                CellSetup(
                    suggestions:_suggestGender, 
                    action:SuggestionsAction.restrict,
                    defaultSort: EditAction.sortNone),
                CellSetup(
                    suggestions:_suggestCountry,     
                    textInputType:TextInputType.name, 
                    defaultSort: EditAction.sortZ2A, 
                    triStateSort:false),
                CellSetup(                          
                    suggestions:_suggestFood,     
                    getWidget: _getCustomeCellWidget,
                    action:SuggestionsAction.keep,  
                    textInputType:TextInputType.name),
                CellSetup(textInputType:TextInputType.number),
                      ];

/// --------------------------------------
///  The Widget
/// --------------------------------------

DataTable(
    data:_data,                         // List<List<String>>
    onUpdate: onUpdate,                 // callback
    onSelectCell:onSelectCell,          // callback
    cellSetups:_cellSetups,             // List<CellSetup>

    isEditing: true,                    // Setting it true/false will make the widget editable/read-only

    outerController: outerController,   // Scroll controller of parent widget (if scrollable), can be null
    outerPhysics: outerPhysics,         // Required in pair with outerController parameter

    pinnedRows: _pinnedRows,            // Pinned top row (int)
    pinnedCols: _pinnedCols,            // Pinned left columns (int)

    cellSize: const Size(100,kToolbarHeight*0.7),

    columnWidths:const [0.15,0.3,0.2,0.2,0.2, 0.2],
    columnWidthOption: ColumnWidthOption.ratio,
    
    decoPinnedRow: [                    // List<BoxDecoration>
                    _decoPinnedRow1,
                    _decoPinnedRow2,
                    ],
    decoPinnedCol: [ _decoPinnedCol1,], // List<BoxDecoration>
    decoNormal: _decoNormalCell,        // BoxDecoration
    stylePinnedRowText: 
        _stylePinnedRowText,    // TextStype
    stylePinnedColText: 
        _stylePinnedColText,    // TextStyle
    styleNormalCellText: 
        _styleNormalCellText,  // TextStyle
  );

About Me #

Though I have been developing software for industry automation, astrology, office tools etc. for many years, I am relatively new to Flutter/mobile apps.

Flutter's quick app development fascinates me. Looking for app usage for varied applicability.

License #

MIT

This is the first time I am publishing a package, there might be some errors/mistakes. Also, some of the entries (like contributing.md, code of conduct etc.) are incomplete. Please feel free to correct.

Acknowledgements #

Contributing #

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

4
likes
0
points
28
downloads

Publisher

unverified uploader

Weekly Downloads

Data table with in-cell-edit, scroll, with callback feature for select-rows, sort, update and custom-contents

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

date_field, flutter, intl

More

Packages that depend on data_sheet