Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ solid Public

A tiny framework built on top of Flutter, zero boilerplate, fine-grained reactivity.

License

Notifications You must be signed in to change notification settings

nank1ro/solid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solid Framework

License: MIT GitHub stars GitHub issues GitHub pull-requests solid_generator Pub Version (including pre-releases) solid_annotations Pub Version (including pre-releases) GitHub Sponsors

Buy Me A Coffee

Congrats on your interest in Solid! Let's make Flutter development even more enjoyable.

Solid is a tiny framework built on top of Flutter that makes building apps easier and more enjoyable. The benefits of using Solid include:

  1. Don't write boilerplate: Solid generates boilerplate code for you, so you can focus on building your app. Inspired by SwiftUI.
  2. No state management/dependency injection manual work: Solid has built-in state management and dependency injection. Just annotate your variables and Solid takes care of the rest.
  3. Fine-grained reactivity: Solid's reactivity system is inspired by SolidJS, allowing for efficient and fine-grained updates to your UI. Only the parts of the UI that depend on changed state are updated, leading to better performance. And the best is that you don't have to think about it, Solid does it for you automatically.

Example

You write this code, without any boilerplate and manual state management:

import 'package:flutter/material.dart';
import 'package:solid_annotations/solid_annotations.dart';

class Counter extends StatelessWidget {
  Counter({super.key});

  @SolidState()
  int counter = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Text('Date: ${DateTime.now()}'),
            Text('Counter is $counter'),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () => counter++,
        child: const Icon(Icons.add),
      ),
    );
  }
}

You get this result, with real fine-grained reactivity:

Demo of Solid fine-grained reactivity

As you can see, the DateTime.now() text does not update when the counter changes, only the Counter is X text updates. This is because Solid tracks which parts of the UI depend on which state, and only updates those parts when the state changes, without any manual work from you.

If this sounds interesting, check out the Getting Started Guide to learn how to set up Solid in your Flutter project!

License

The Solid framework is open-source software licensed under the MIT License.

Sponsorship

If you find Solid useful and would like to support its development, consider sponsoring the project on GitHub Sponsors. I love building open-source software and your support helps me dedicate more time to improving Solid and adding new features.