Skip to content

A repository to create and compare different methodologies of reusing local widget state logics.

Notifications You must be signed in to change notification settings

Hixie/local_widget_state_approaches

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Web Demo Link: https://timwhiting.github.io/local_widget_state_approaches/#/

Widget UI State Logic encaspulation approaches

This project intends to illustrate via several case studies what is difficult when reusing state logic. (Not state) among multiple stateful widgets.

Note that I'm doing this in my spare time, and therefore I can not gurantee timeliness as far as incorporating all different approaches for all examples.

Also, I'm not sure the best name for the respository, so I did my best. I think the header of the Readme might be more instructive as to what these examples will try to demonstrate. Open an issue if you'd like to discuss that. Or we can create a Wiki page about that.

Getting access

Please request access and respect the other contributors. Make sure you resolve merge conflicts properly, and keep the repository organized. Otherwise, just fork and submit pull request like usual open-source practice. (I'm not sure how many people are wanting to contribute).

Current Progress

Approaches

  • Stateful - Nothing to add
  • Builders - Nothing to add
  • LateProperty - Adds registration of callbacks via mixin see this: flutter/flutter#51752 (comment)
  • Hooks - Using flutter_hooks package
  • State Restoration Framework
    • This was mentioned at one point in the issue, because flutter now has a state restoration framework. I don't know if it can work, but I'm willing to try for at least a few of the things that we are trying to solve here.

Examples

  • Counter Example
    • Hooks: Done
    • Stateful: Done
    • LateProperty: Not Started
    • Builders: Not Started

Future Work

I intend to keep the examples small like Remi suggests, they should not be full blown apps unless absolutely needed.

Instead they should be small examples that illustrate a point in reusability of state logics.

(TODO: determine scope and what would make an illustrative examples)

  • Setup 404 unimplemented page
  • Better navigation
  • Highlight navigation for unimplemented pages in a different color
  • Animation heavy page
  • Form page
  • Use some of Remi's potential examples: flutter/flutter#51752 (comment)
  • Also this: flutter/flutter#51752 (comment)
  • Would love to see the code along with the app like flutter gallery's code samples.

About

A repository to create and compare different methodologies of reusing local widget state logics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 70.8%
  • HTML 13.6%
  • Swift 13.5%
  • Kotlin 1.7%
  • Objective-C 0.4%