live 0.0.1 copy "live: ^0.0.1" to clipboard
live: ^0.0.1 copied to clipboard

Reactive,adaptive and responsive Flutter UI and commonly used widgets.

Live #

Reactive,adaptive and responsive Flutter UI and commonly used widgets.

Reactivity #


Use Live value and live view to make your widgets reactive to state.
// counter app with live view
class MyCounter extends StatelessWidget {
  final LiveValue<int> count = LiveValue(0);


  Widget build(BuildContext context) {
    return Column(
        children: [
          LiveView<int>(
            live: count,
            builder: (BuildContext context, int count, Widget child) {
              return Row(
                  children: [
                    child,
                    Text("${count.value}"),
                  ]
              );
            },

            /// specify a child that you dont want rebuilt
            child: Text("Current Count: "),
          ),
          IconButton(
            icon: const Icon(Icons.plus),
            onPressed: () {
              count.update(count + 1);
            },
          ),
          IconButton(
            icon: const Icon(Icons.plus),
            onPressed: () {
              count.update(count + 2);
            },
          ),
        ]
    );
  }
}

Responsiveness & Adaptive #


A widget, a mixin with adapters and easy to access data about screen size that you app will react to when they change.
// counter app with live view
class MyCounter extends ResponsiveView {


  Widget build(BuildContext context) {
    return Column(
        children: [
          Text("ScreenWidth: $width, ScreenHeight: $height"),
          adapt(
            phone: orient(landscape: Text("Phone on landscape!"), portrait: Text("Phone on portrait")),
            // phone(small:,medium:,large:,)
            tablet: tablet(small: Text("Small tablet!"), large: Text("tablet Large!")),
            desktop: Text("On Desktop!"), // desktop(small:,medium:,large:,)
          ),
          platform(
            web: Text("We are on web"),
            android: Text("we are on android"),
            // linux,macOS,chromeOS,mobile,desktop,+more
          )
        ]
    );
  }
}

Getting started #

Note: if you wanted just reactivity and are willing to build your own widgets use Live

$ flutter pub get live

Additional information #

This package is a set of tools built by Luminucx.inc dev team to enhance the experience developers and encourage them to write clean and efficient code.

Go through it to make sure it is right for use with your code.

3
likes
0
pub points
28%
popularity

Publisher

verified publisherluminucx.com

Reactive,adaptive and responsive Flutter UI and commonly used widgets.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, google_fonts, meta, outlook, structures

More

Packages that depend on live