GetHelp!

GetHelp! is a set of helper widgets and classes which make using get and get_cli easier.

GetHelp! is also a great package for users of get which have experience using the stacked architecture but want something lighter. GetHelp!'s emphasis on the use of GetBuilderViews means that a stacked persons MVVM with update() functions will be satisfied.

If you are using vscode, I have also included a handy snippets file.

GetBuilderView

GetBuilderView is a great way to create a view with GetBuilder for get's simple state management system.

class MyView extends GetBuilderView<MyController> {
  const MyView({super.key});

  @override
  Widget builder(context, controller) {
    return const Scaffold();
  }
}

IMPORTANT: This widget expects that you have already initialised your controller using a binding. If you are not using bindings or you don't need global controller creation, add the init method to your GetBuilderView.

You can also define the get builder to initialise local controllers by setting the global property to false, just the same as the GetBuilder widget.

class MyView extends GetBuilderView<MyController> {
  const MyView({super.key});

  /// Add the init method for initialising a Controller.
  /// By default, init is set to null.
  @override
  MyController? get init => MyController();

  /// Add the [global] method to turn off global controller creation.
  /// [global] defaults to true
  @override
  bool get global => false;

  @override
  Widget builder(context, controller) {
    return const Scaffold();
  }
}

Basically, GetBuilderView acts as a shorthand for this:

class MyView extends StatelessWidget {
  const MyView({super.key});

  @override
  Widget build(context) {
    return GetBuilder<MyController>(
      init: MyController(),
      builder: (controller) {
        return const Scaffold();
      },
    );
  }
}

Instead of this nested code, all you need to write is this:

GetxFutureController

GetxFutureController (named with the x to match GetxController) is a new controller type which adds a default implementation of awaiting futures based on stacked's FutureViewModel.

Libraries

get_help