uncomplicated_flutter

Creator: coderz1093

Last updated:

0 purchases

uncomplicated_flutter Image
uncomplicated_flutter Images

Languages

Categories

Add to Cart

Description:

uncomplicated flutter

uncomplicated_flutter #
Flutter specific builders for uncomplicated package. Very lightweight
wrapper on top of uncomplicated_package. Contains two widgets:

ExplicitBuilder that builds takes an Explicitstate and returns
a widget
final _state = ExplicitState(0);

ExplicitBuilder(
state: _state,
builder: (BuildContext context, int counter) {
return Text(
'$counter',
style: Theme.of(context).textTheme.headlineMedium,
);
},
);
copied to clipboard

ComputedBuilder that takes an ComputedState and the 3 callbacks

final _state = ComputedState(
builder: () => Future.delayed(const Duration(seconds: 1), () => 0)
);

ComputedBuilder(
state: _state,
waiting: (BuildContext context) => Center(CircularProgressIndicator()),
error: (BuildContext context, dynamic error, StackTrace? stacktrace) {
return Column(
children: [
Text(error?.toString ?? 'Something went wrong'),
Text(stacktrace?.toString ?? ''),
];
);

},
data: (BuildContext context, counter) {
return Text(
'$counter',
style: Theme.of(context).textTheme.headlineMedium,
);
},
);

copied to clipboard


Features #

Easy to use
Only 1 dependency: uncomplicated
Entire library is some 300 SLOC (uncomplicated) + 100 SLOC (uncomplicated flutter).
Less code means less bugs

Getting started #
Check out documentation of uncomplicated

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.