easy_cli

Creator: coderz1093

Last updated:

0 purchases

easy_cli Image
easy_cli Images

Languages

Categories

Add to Cart

Description:

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

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.