Helpers는 반복적이고 긴 코드를 간소화하기 위해 설계된 Flutter/Dart 패키지로, 일반적인 작업을 위한 직관적이고 가독성 높은 확장 기능을 제공합니다. 복잡하거나 번거로운 문장을 깔끔하고 표현력 있는 구문으로 변환함으로써 개발자의 생산성을 향상시킵니다. 위젯 생성, 상태 관리 및 UI 로직의 단순화에 이상적이며, 코드의 명확성과 유지보수성을 촉진합니다. 이 패키지는 가볍고, 불필요한 부담을 추가하지 않고 개발자 경험을 개선하는 데 집중합니다.
printPink("I'm an error 凸-_-凸", true);
printYellow("I'm an alert (¯―¯٥)");
printCyan("I'm an info (✿◠‿◠)");
printColor(
"I'm a weird boy ¯\\(°_o)/¯",
PrintColorStyle(
prefix: "Hola baby!",
foreground: Colors.green,
background: Colors.black,
underline: true,
bold: true,
italic: true,
),
);
printColor(
"Controller disposed!",
PrintColorStyle(
bold: true,
prefix: "HELPERS",
foreground: Colors.orangeAccent,
),
);
Misc Helpers
Misc Class:
It is a simplification of many instructions.
double milliseconds = 200;
//CALLBACKSMisc.onLayoutRendered(() {}); //HelperWidgetsBinding.instance.addPostFrameCallback((_) {});
//TIMER-ASYNCMisc.delayed(milliseconds, () {}); //HelperFuture.delayed(Duration(milliseconds: milliseconds), () {});
Misc.timer(milliseconds, () {}); //HelperTimer(Duration(milliseconds: milliseconds), () {});
Misc.periodic(milliseconds, () {}); //HelperTimer.periodic(Duration(milliseconds: milliseconds), () {});
awaitMisc.wait(milliseconds); //HelperawaitFuture.delayed(Duration(milliseconds: milliseconds), () {});
//TEXTText(Misc.loremIpsum());
Text("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
Text(Misc.extendedLoremIpsum());
Text("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." +
"Ut enim ad minim veniam, quis nostrud exercitation " +
"ullamco laboris nisi ut aliquip ex ea commodo consequat.");
//SYSTEM (NOTE: SystemChrome NEED IMPORT FLUTTER SERVICES)Misc.setSystemOverlayStyle(...); //HelperSystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(...));
Misc.setSystemOverlay(SystemOverlay.portraitUp); //HelperSystemChrome.setSystemUIOverlay([SystemUiOverlay.portraitUp]);
Misc.setSystemOrientation(SystemOrientation.values); //HelperSystemChrome.setPreferredOrientations(DeviceOrientation.values)
SystemOverlay Class:
This is a simplification of the List type: SystemUiOverlay statement. It is used for the Misc.setSystemOverlayStyle() statement.
IMPROVEMENT: By using the SystemOverlay you will not need to import SystemChrome, DeviceOrientation from the flutter services.
This is a simplification of the List type: DeviceOrientation statement. It is used for the Misc.setSystemOrientation() statement.
IMPROVEMENT: By using the SystemOrientation you will not need to import SystemChrome, DeviceOrientation from the flutter services.
It is a simplification of Navigator without BuildContext statement.
//If you will use BuildRoute, then need navigatorKeyMaterialApp(
navigatorKey: BuildRoute.key,
home: App(),
);
BuildRoute.to(page);
BuildRoute.goBack();
BuildRoute.toReplacement(page);
BuildRoute.toAndRemoveUntil(page);
BuildRoute.toTransparentPage(page); //NOTE: Push a Route with transparent backgroundBuildRoute.toNamedAndRemoveUntil("/");
BuildRoute.toNamed("/");
---
Size Helpers
Margin Class:
It is a simplification of the EdgeInsets statement.
It is an AnimatedBuilder. If it is TRUE, it will execute the Tween from begin to end (controller.forward()), if it is FALSE it will execute the Tween from end to begin (controller.reverse())