Giter Club home page Giter Club logo

edit_builder's Introduction

Edit Builder

Package Build License Patreon

Simple package to help on the creation of edit pages.

This package aims to provide a super easy way to build an edit view of any kind. It uses flutter_bloc under the hood, in order to maintain the current state the editing item.

You must enter a valid initialState: it could be a just-initialzed object, or an object with data already inside. The type of this parameter is controller by the generic type of the widget.

The value and setValue inside the builder parameter offers an interface between the data & the view. Similiar to a StatefullWidget, in order to change the value of the value parameter, you just have to make the editing operation inside the setValue function. This function receives a new object of the same type as the previous one, and reloads the UI to reflect the changes.

Example

If you want to take a deeper look at the example, take a look at the example folder provided with the project.

EditBuilder<String>(
  initialValue: 'C++',
  builder: (context, value, setValue) => Center(
    child: Column(
      mainAxisAlignment: MainAxisAlignment.spaceAround,
      children: [
        Text(value),
        FlatButton(
          child: Text('INCREASE'),
          onPressed: () => setValue(value += '+'),
        )
      ],
    ),
  ),
),

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Built with

Authors

License

This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.