rocket_mini_view 0.0.2 copy "rocket_mini_view: ^0.0.2" to clipboard
rocket_mini_view: ^0.0.2 copied to clipboard

Mini view for RocketValue.

Rocket MiniView #

RocketMiniView is a widget provided by the rocket_listenable package that listens to changes in a RocketListenable object and rebuilds when a change occurs. It is designed to be used in conjunction with RocketValue objects to build reactive UIs in Flutter.

Usage #

To use RocketMiniView, import it into your Dart file:

import 'package:flutter/material.dart';
import 'package:rocket_listenable/rocket_listenable.dart';
import 'package:your_app/constants.dart';

import 'rocket_mini_view.dart';

final RocketValue value = [].mini;
...
RocketMiniView(
  value: value,
  builder: () {
    return Text(value.length.toString());
  },
)
copied to clipboard

The RocketMiniView widget takes two required parameters:

  • value: The RocketListenable object to listen to.
  • builder: A function that returns the widget tree to build.

The builder function should return the widget tree that needs to be rebuilt when the RocketListenable object changes.

API Reference #

RocketMiniView #

The RocketMiniView widget is a widget that listens to changes in a RocketListenable object and rebuilds when a change occurs.

Constructor

RocketMiniView({
  Key? key,
  required this.value,
  required this.builder,
})
copied to clipboard
  • key: An optional Key object to use for the widget.
  • value: The RocketListenable object to listen to.
  • builder: A function that returns the widget tree to build.

MiniViewRocketState

The MiniViewRocketState class is the state object for the RocketMiniView widget.

initState Method

void initState()
copied to clipboard

Called when the widget is first inserted into the widget tree.

didUpdateWidget Method

void didUpdateWidget(RocketMiniView oldWidget)
copied to clipboard

Called when the widget is updated with new parameters.

dispose Method

void dispose()
copied to clipboard

Called when the widget is removed from the widget tree.

_rebuildWidget Method

void _rebuildWidget()
copied to clipboard

Called when the RocketListenable object changes.

build Method

Widget build(BuildContext context)
copied to clipboard

Builds the widget tree using the builder function.

Conclusion #

RocketMiniView is a useful widget provided by the rocket_listenable package that enables you to build reactive UIs in Flutter. Its simple API and ability to listen to changes in RocketListenable objects make it an ideal choice for building Flutter applications that need to react to changes in data.

1
likes
150
points
62
downloads

Publisher

verified publisherbixat.dev

Weekly Downloads

2024.09.11 - 2025.03.26

Mini view for RocketValue.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, rocket_listenable

More

Packages that depend on rocket_mini_view