zeta_flutter_utils 1.1.1
zeta_flutter_utils: ^1.1.1 copied to clipboard
Utility functions for the Zeta Design System from Zebra Technologies.
Debounce #
/// Initialize Debouncer
final debouncer = Debounce(()=> print('Hello, world!'), duration: Duration(seconds: 1));
/// Reset timer with optional new callback
debouncer.debounce(newCallback: ()=> print('Later, world!'));
/// Cancel debouncer
debouncer.cancel();
Nothing #
child: Nothing()
Extensions #
Iterable
Column(
children: [
Text('Hello'),
Text('world'),
].divide(const Text('!')).toList(),
)
Column(
children: [
Text('Hello'),
Text('world'),
].gap(40),
)
Widget
Text('Hello world').paddingAll(10);
Text('Hello world').paddingStart(10);
Text('Hello world').paddingEnd(10);
Text('Hello world').paddingTop(10);
Text('Hello world').paddingBottom(10);
Text('Hello world').paddingHorizontal(10);
Text('Hello world').paddingVertical(10);
Num
102.formatMaxChars(3); // 99+
String
'Zebra Employee'.initials; // ZE
'zebra'.capitalize; // Zebra
Platform #
// To check host platform:
if (PlatformIs.android)
if (PlatformIs.iOS)
if (PlatformIs.macOS)
if (PlatformIs.windows)
if (PlatformIs.linux)
if (PlatformIs.fuchsia)
// To check device type:
if (PlatformIs.mobile)
if (PlatformIs.desktop)
// To check if application is running on web:
if (PlatformIs.web)