loading_button

Last updated:

0 purchases

loading_button Image
loading_button Images
Add to Cart

Description:

loading button

loading_button #
Loading button with simple implementation

How to use #
pubspec.yaml #
loading_button: <lastest version>
copied to clipboard
import #
import 'package:loading_button/loading_button.dart';
copied to clipboard
Simple implementation #
LoadingButton(
onPressed: bloc.tryLogin,
isLoading: false,
child: Text(
"Entrar",
style: TextStyle(color: Colors.white),
),
);
copied to clipboard
Custom loading implementation #
LoadingButton(
onPressed: bloc.tryLogin,
isLoading: false,
loadingWidget: SizedBox(
width: 25,
height: 25,
child: Center(
child: CircularProgressIndicator(
valueColor:
AlwaysStoppedAnimation<Color>(Colors.white),
),
),
),
child: Text(
"Entrar",
style: TextStyle(color: Colors.white),
),
);
copied to clipboard
Streams implementation #
StreamBuilder<bool>(
stream: bloc.loadingController,
initialData: bloc.loadingController.value,
builder: (context, snapshot) {
return LoadingButton(
onPressed: bloc.tryLogin,
isLoading: snapshot.data,
child: Text(
"Entrar",
style: TextStyle(color: Colors.white),
),
);
},
)
copied to clipboard
All properties implementation #
LoadingButton(
onPressed: bloc.tryLogin,
isLoading: snapshot.data,
backgroundColor: Colors.blue,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(5),
),
loadingWidget: SizedBox(
width: 25,
height: 25,
child: Center(
child: CircularProgressIndicator(
valueColor:
AlwaysStoppedAnimation<Color>(Colors.white),
),
),
),
child: Text(
"Entrar",
style: TextStyle(color: Colors.white),
),
);
copied to clipboard

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.