Skip to content
pubscout

flustars

2.0.1, released 6 years ago by an unverified publisher

Flutter common utilities for SharedPreferences, screen adaptation, directories, and widgets.

Unverified publisher
$ flutter pub add flustars
Source repository

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.

Works with

Packages commonly used together with flustars: ones it builds on, ones built on it, and its own family.