flustars_flutter3
3.0.0, released 4 years ago by itbug.shop
A collection of utility classes for SharedPreferences, screen adaptation, widgets, and directories.
What it does
Provides common utility classes for Flutter development including SharedPreferences handling via SpUtil, screen and font adaptation via ScreenUtil, widget rendering monitoring via WidgetUtil, and directory path management via DirectoryUtil.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a quick way to handle synchronous SharedPreferences storage for primitives and objects.
- You want a straightforward screen adaptation and scaling utility.
- You need to retrieve local directory paths or monitor widget bounding boxes.
Skip it when
- You prefer modern state-of-the-art state management or separate specialized utility packages.
- You require advanced asynchronous local database solutions like SQLite or Hive.
Strengths
- Combines multiple essential utility classes into a single package.
- Simplifies SharedPreferences usage with helper methods for objects and lists.
- Offers helpful screen and font scaling helpers.
Weaknesses
- Some components like sp_util have been split into separate standalone libraries.
- Older codebase style relying heavily on static singleton utilities.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
Initialize SharedPreferences using `await SpUtil.getInstance();` inside `main()` if using SpUtil.
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SpUtil.getInstance();
runApp(MyApp());
}Works with
Packages commonly used together with flustars_flutter3: ones it builds on, ones built on it, and its own family.
- path_providerflustars_flutter3 depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- synchronizedflustars_flutter3 depends on itLock mechanism to prevent concurrent access to asynchronous code.
- common_utilsflustars_flutter3 depends on itDart common utility library containing date, regex, timer, currency, and object helpers.
- sp_utilflustars_flutter3 depends on itFlutter shared_preferences plugin utility supporting default values and objects.