All Projects → godilite → editable

godilite / editable

Licence: MIT License
This library allows you to create editable tables and spreadsheets with ease, either by providing initial row and column count to display an empty table or use it with predefined rows and column data sets.

Programming Languages

dart
5743 projects
C++
36643 projects - #6 most used programming language
CMake
9771 projects
c
50402 projects - #5 most used programming language
swift
15916 projects
kotlin
9241 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to editable

progressive image
A flutter widget that progressively loads large images using Low-Quality Image Placeholders.
Stars: ✭ 28 (-67.06%)
Mutual labels:  flutter-examples, flutter-package
Login-Register-FlutterApp
Login Register Auth App by Delicia Fernandes using Google and Facebook sign in.
Stars: ✭ 87 (+2.35%)
Mutual labels:  flutter-examples, flutter-android
flutter-app
Full Feature Todos Flutter Mobile app with fireStore integration.
Stars: ✭ 138 (+62.35%)
Mutual labels:  flutter-examples, flutter-package
Flutter-Apps
🌀 This is mainly focus on a complete application for production
Stars: ✭ 18 (-78.82%)
Mutual labels:  flutter-examples, flutter-package
flutter-docset
Community driven Flutter Docset for Dash.app
Stars: ✭ 56 (-34.12%)
Mutual labels:  flutter-examples, flutter-package
barcode.flutter
barcode generate library for Flutter
Stars: ✭ 58 (-31.76%)
Mutual labels:  flutter-examples, flutter-package
Flutter-Chat-Bar
Link to the package -. https://pub.dartlang.org/packages/flutter_chat_bar
Stars: ✭ 39 (-54.12%)
Mutual labels:  flutter-examples, flutter-package
flutter sliding tutorial
User onboarding library with smooth animation of objects and background colors
Stars: ✭ 127 (+49.41%)
Mutual labels:  flutter-examples, flutter-package
shimmer animation
This shimmer animation widget can help you bring simple yet beautiful skeleton loaders to your flutter app with ease.
Stars: ✭ 29 (-65.88%)
Mutual labels:  flutter-package, flutterpackage
Interactive-Add-Button-Layout
Custom Layout with interactive add button to impove your UI and UX .
Stars: ✭ 20 (-76.47%)
Mutual labels:  flutter-examples, flutter-package
flutter-UI
将Flutter各种Widget各种API📘都实现一次。喜欢请Star。
Stars: ✭ 67 (-21.18%)
Mutual labels:  flutter-examples, flutter-package
Flutter-firestore-auth
Flutter mobile app with firestore authentication including Email and Social auth.
Stars: ✭ 95 (+11.76%)
Mutual labels:  flutter-examples, flutter-package
fancy bar
A fancy yet beautiful animated widget for your Flutter apps
Stars: ✭ 33 (-61.18%)
Mutual labels:  flutter-examples, flutter-package
swipedetector
A Flutter package to detect up, down, left, right swipes.
Stars: ✭ 34 (-60%)
Mutual labels:  flutter-examples, flutter-package
CustomSwitch
Custom Switch package created in Flutter
Stars: ✭ 56 (-34.12%)
Mutual labels:  flutter-examples, flutter-package
invmovieconcept1
True Cross platform UI design featuring complex scroll based animations powered by flutter
Stars: ✭ 55 (-35.29%)
Mutual labels:  flutter-examples, flutter-desktop
sticker-chat
Sticker chat is a messaging application built using Flutter, Stream, and Rive
Stars: ✭ 45 (-47.06%)
Mutual labels:  flutter-examples
BlogApp
A Blog App UI made with Flutter
Stars: ✭ 47 (-44.71%)
Mutual labels:  flutter-examples
custom timer
A Flutter package to create a customizable timer.
Stars: ✭ 25 (-70.59%)
Mutual labels:  flutter-package
pmvvm
A clean & simple MVVM solution for state management using Provider package.
Stars: ✭ 33 (-61.18%)
Mutual labels:  flutter-package

Editable

⚡️A highly customizable, editable table package for Flutter projects.

Specs

pub

This package allows you to create editable tables and spreadsheets with ease, either by providing inital row and column count to display an empty table, or use it with predefined rows and column data sets.

It is compatible with Flutter Desktop (Windows, Linux, MacOS), IOS, Android, and Web. ❤️

Features

  • Save Edited Rows
  • Save Edited cell
  • Customize cell data
  • Add Empty rows
  • Create Empty tables
  • Customizable Save button
  • Customize Table headers
  • Zebra - Stripe table
  • Style table border
  • Adjustable Column widths

Spread Some ❤️

GitHub followers

Support us

You can buy us a cup of coffee. Sponsor our next milestones

Patreon

Getting started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  editable: "^1.1.4"

In your library add the following import:

import 'package:editable/editable.dart';

API

Create Table

To create a new table, use the Editable() widget class and provide the table data properties as follows:

  • column: an array of objects example example:

    List cols = [
      {"title":'Name', 'widthFactor': 0.2, 'key':'name'},
      {"title":'Date', 'widthFactor': 0.1, 'key':'date'},
      {"title":'Month', 'widthFactor': 0.1, 'key':'month'},
      {"title":'Status',  'key':'status'},
    ]; 

    [title] is the column heading

    [widthFactor] a custom size ratio of each column width, if not provided, defaults to [columnRatio = 0.20] dart 'widthFactor': 0.1 //gives 10% of screen size to the column 'widthFactor': 0.2 //gives 20% of screen size to the column

    [key] an identifyer preferably without space and special characters

  • rows: an array of objects, where each object key represents a column [key], example:

    List rows = [
        {"name": 'James Joe', "date":'23/09/2020',"month":'June',"status":'completed'},
        {"date":'12/4/2020',"month":'March',"name": 'Daniel Paul', "status":'new'},
      ];

    Each objects DO NOT have to be positioned in same order as its column

  • rowCount: Interger value of number of rows to be generated: Optional if row data is provided

  • columnCount: Interger value of number of columns to be generated: Optional if column data is provided

  • columnRatio: fraction of the screen width occupied by each column. This is usefull for shrinking and expanding table width example:

      columnRation: 0.2 //sets each column to occupy 20 percent of screen width

Customization

  • borderColor: Color of table border

  • borderWidth: width of table borders

  • tdPaddingLeft: Table data cell padding left

  • tdPaddingTop: Table data cell padding top

  • tdPaddingRight: Table data cell padding right;

  • tdPaddingBottom: Table data cell padding bottom;

  • tdAlignment: Aligns the table data ;

  • tdStyle: Style the table data;

  • thPaddingLeft: Table header cell padding left;

  • thPaddingTop: Table header cell padding top;

  • thPaddingRight: Table header cell padding right;

  • thPaddingBottom: Table header cell padding bottom;

  • trHeight: Table Row Height, cannot be less than 40.0 ;

  • thWeight: Table headers fontweight;

  • thSize: Table headers fontSize;

  • tdEditableMaxLines : Max lines allowed in editable text, default: 1 (longer data will not wrap and be hidden), setting to 100 will allow wrapping and not increase row size;

  • showSaveIcon: Toogles the save button, if [true] displays an icon to save rows, adds an addition column to the right

  • saveIcon: Icon for to save row data, example: dart saveIcon : Icons.add

  • saveIconColor: Color for the save Icon

  • saveIconSize: Size for the saveIcon

  • showCreateButton: displays a button that adds a new row onPressed

  • stripeColor1: The first row alternate color, if stripe is set to true

  • stripeColor2: The Second row alternate color, if stripe is set to true;

  • zebraStripe: Enable zebra-striping, set to false by default // if zebraStripe is enabled, you can style the colors [stripeColor1] and [stripeColor2]

  • createButtonAlign: Aligns the button for adding new rows;

  • createButtonIcon: Icon displayed in the create new row button;

  • createButtonColor: Color for the create new row button;

  • createButtonShape: border shape of the create new row button createButtonShape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8) )

  • createButtonLabel: Label for the create new row button

Save methods

  • onSubmitted: [onSubmitted] callback is triggered when the enter button is tapped (for desktop users) Or when edit is complete(on mobile) on a table data cell it returns a value of the edited cell data

  • onRowSaved: [onRowSaved] callback is triggered when a [saveButton] is pressed. returns only values if row is edited, otherwise returns a string ['no edit']

  • EditableState key: To get all Edited Rows outside the current context, you can access the editable state using a GlobalKey, example:

         /// Create a Key for EditableState
        final _editableKey = GlobalKey<EditableState>(); 
    
      
        /// Function to add a new row
        /// Using the global key assigined to Editable widget
        /// Access the current state of Editable
        void _addNewRow() {
          setState(() {
            _editableKey.currentState.createRow();
          });
        }
    
        ///Print only edited rows.
        void _printEditedRows() {
          List editedRows = _editableKey.currentState.editedRows;
          print(editedRows);
        }
    
          @override
        Widget build(BuildContext context) {
          return Scaffold(
            appBar: AppBar(
              leadingWidth: 200,
              leading: FlatButton.icon(
                  onPressed: () => _addNewRow(),
                  icon: Icon(Icons.add),
                  label: Text(
                    'Add',
                    style: TextStyle(fontWeight: FontWeight.bold),
                  )),
              title: Text(widget.title),
              actions: [
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: FlatButton(
                      onPressed: () => _printEditedRows(),
                      child: Text('Print Edited Rows',
                          style: TextStyle(fontWeight: FontWeight.bold))),
                )
              ],
            ),
            body: Editable(
              key: _editableKey, //Assign Key to Widget
              columns: cols,
              rows: rows,
              zebraStripe: true,
              stripeColor2: Colors.grey[200],
              borderColor: Colors.blueGrey,
            ),
          );
        }
    

Screenshots

Editable Table with Data (zebraStripe) Empty SpreadSheet (zebraStripe) Empty SpreadSheet (No Stripe)
Table with Save Icon

Tutorials

The Following are resources to help you build with Editable:

Contribution

I highly encourage the community to step forward and improve this library further. You can fix any reported bug, propose or implement new features, write tests, etc.

Here is a quick list of things to remember

  • Check the open issues before creating a new one,
  • Help me in reducing the number of open issues by fixing any existing bugs,
  • Check the roadmap to see if you can help in implementing any new feature,
  • You can contribute by writing unit and integration tests for this library,
  • If you have any new idea that aligns with the goal of this library, feel free to raise a feature request and discuss it.

Author

This Editable table package for Flutter is developed by Godwin Asuquo

Contributors

CY Uket AmitB Tim Maffet Thumbert ❤️Thank you all for your contributions

Also, as always, please give us a star to help!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].