flustars
2.0.1, released 6 years ago by an unverified publisher
Flutter common utilities for SharedPreferences, screen adaptation, directories, and widgets.
What it does
Provides a collection of utility classes including SpUtil for SharedPreferences, ScreenUtil for screen adaptation and dimensions, DirectoryUtil for file paths, and WidgetUtil for widget rendering bounds and image sizes.
AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need quick helper utilities for SharedPreferences data storage
- You require screen adaptation and sizing metrics in your Flutter app
- You need to easily check image dimensions or widget bounds
Skip it when
- You prefer modern reactive state management and dependency injection
- You only need isolated small helpers where a full utility bundle is unnecessary
Strengths
- Combines multiple essential utilities in one package
- Easy synchronous access to SharedPreferences after initialization
- Provides handy screen metrics and adaptation helpers
Weaknesses
- Some utility classes have been split into separate packages like sp_util
- Relies heavily on singleton patterns
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
Initialize SpUtil in main using await SpUtil.getInstance() if using SharedPreferences synchronously.
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SpUtil.getInstance();
runApp(MyApp());
}
SpUtil.putString("username", "Sky24n");
String userName = SpUtil.getString("username");Alternatives
Packages that do the same job and could replace flustars.
- package_signature
Retrieve Android package signature (SHA1/SHA256) in a Flutter app.
66Compare - basic_utils
Common utility classes for Strings, Dates, X509, PKCS, Cryptography and HTTP requests.
57Compare - render_metrics
Retrieve widget screen coordinates and compare positions at runtime
50Compare
Works with
Packages commonly used together with flustars: ones it builds on, ones built on it, and its own family.
- path_providerflustars depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- synchronizedflustars depends on itLock mechanism to prevent concurrent access to asynchronous code.
- common_utilsflustars depends on itDart common utility library containing date, regex, timer, currency, and object helpers.
- sp_utilflustars depends on itFlutter shared_preferences plugin utility supporting default values and objects.