0 purchases
easy cli
Folder by Easy CLI Utility đ #
A Dart CLI tool that generates the folder structure for the folder-by-feature pattern. This tool helps to reduce the repetitive work required to setup directories for models, services, repositories, screens and widgets.
How to use #
dart pub global activate easy_cli
export PATH="$PATH":"$HOME/.pub-cache/bin"
flutter pub add easy_cli
easy generate -n <project_name>
copied to clipboard
Required flutter packages #
Get,
Get Storage,
Dio,
Intl Phone Field,
Logger,
flutter_screenutil,
The folder structure generated by the cli is as follows:
core/
âŖ constants/
â âŖ app_icon.dart
â âŖ app_icon.svg.dart
â â app_regex.dart
âŖ init/
â âŖ service/
â â âŖ base_service.dart
â â â dio_service.dart
â âŖ view
â â âŖ base
â â â âŖ base_state.dart
â â â â base_stateless.dart
â â âŖ theme
â â â â theme.dart
â â âŖ widget
â â â âŖ button
â â â âŖ card
â â â âŖ checkbox
â â â âŖ form
â â â âŖ slider
â â â âŖ textformfield
â âŖ viewmodel
â â â base_viewmodel.dart
âŖ manager/
â âŖ auth/
âŖ âŖ auth_manager.dart
â â
â âŖ cache/
âŖ â cache_manager.dart
âŖ extension/
â â base_extension.dart
âŖ language/
â â base_language.dart
âŖ model/
â â base_model.dart
feature/
âŖ components/
â â button
product/
âŖ model/
â â product_model.dart
âŖ service/
â â product_service.dart
âŖ view/
âŖ âŖ product_state_view.dart
âŖ â product_stateless_view.dart
âŖ viewmodel/
â â product_viewmodel.dart
copied to clipboard
Example main.dart
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'core/manager/cache/shared_pref.dart';
import 'app/routes/app_pages.dart';
import 'config/theme/my_theme.dart';
import 'config/translations/localization_service.dart';
Future<void> main() async {
// wait for bindings
WidgetsFlutterBinding.ensureInitialized();
// init shared preference
await MySharedPref.init();
runApp(
ScreenUtilInit(
// xd art board size
designSize: const Size(375, 812),
minTextAdapt: true,
splitScreenMode: true,
builder: (context, widget) {
return GetMaterialApp(
title: "GetXSkeleton",
useInheritedMediaQuery: true,
debugShowCheckedModeBanner: false,
builder: (context,widget) {
bool themeIsLight = MySharedPref.getThemeIsLight();
return Theme(
data: MyTheme.getThemeData(isLight: themeIsLight),
child: MediaQuery(
// prevent font from scalling (some people use big/small device fonts)
// but we want our app font to still the same and dont get affected
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: widget!,
),
);
},
initialRoute: AppPages.INITIAL, // first screen to show when app is running
getPages: AppPages.routes, // app screens
locale: MySharedPref.getCurrentLocal(), // app language
translations: LocalizationService(), // localization services in app (controller app language)
);
},
),
);
}
copied to clipboard
Command Usage đ§ #
Make sure you are in the root of your project
easy generate -n <project_name>
copied to clipboard
Šī¸ 2022 Eren KARA
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.