okmsbun_flutter 0.0.4
okmsbun_flutter: ^0.0.4 copied to clipboard
Package util package that aims to get rid of boilerplate to start the project quickly
Okmsbun Flutter Util Package #
This package is a utility package designed to eliminate boilerplate code and facilitate a quick project setup.
Usage #
Adding Lint Rules #
If you want stricter, more precise, and clear lint rules, you can include the following lint rules. You can access all of these lint rules here.
Add the following line to your package's analysis_options.yaml file:
include: package:okmsbun_flutter/okmsbun_flutter_lints.yaml
And the following line to your package's pubspec.yaml file:
....
dependencies:
flutter_lints: ^3.0.1
....
ImageWidget #
ImageWigdet was made using the cached_network_image and flutter_svg packages.
'Image Widget' is a widget that aims to display images with extensions such as svg and other (jpg, png ...) from a single widget.
ImageWidget.network(
imageUrl: 'https://picsum.photos/200/300',
boxFit: BoxFit.cover,
height: 300,
...
)
ImageWidget.asset(
assetPath: 'assets/images/placeholder.png',
boxFit: BoxFit.cover,
height: 300,
...
)
ImageWidget.bytes(
bytes: bytes,
boxFit: BoxFit.cover,
height: 300,
...
)
BufferingFutureBuilder #
BufferingFutureBuilder is a widget that helps show old data instead of progress when a new request is made or data changes while using FutureBuilder.
BufferingFutureBuilder<String>(
future: () async {
await Future.delayed(const Duration(seconds: 3));
return 'Hello World from Future';
},
builder: (data) => Text(data ?? ''),
onLoadedData: 'Hello World from onLoadedData',
)