Giter Site home page Giter Site logo

get_cli's Introduction

Documentation languages
pt_BR en_US - this file zh_CN

Official CLI for the GetX™ framework.

// To install:
pub global activate get_cli 
// (to use this add the following to system PATH: [FlutterSDKInstallDir]\bin\cache\dart-sdk\bin

flutter pub global activate get_cli

// To create a flutter project in the current directory:
// Note: By default it will take the folder's name as project name
// You can name the project with `get create project:my_project`
// If the name has spaces use `get create project:"my cool project"`
get create project

// To generate the chosen structure on an existing project:
get init

// To create a page:
// (Pages have controller, view, and binding)
// Note: you can use any name, ex: `get create page:login`
// Nota: use this option if the chosen structure was Getx_pattern
get create page:home

// To create a screen
// (Screens have controller, view, and binding)
// Note: you can use any name, ex: `get screen page:login`
// Nota: use this option if the chosen structure was CLEAN (by Arktekko)
get create screen:home 

// To create a new controller in a specific folder:
// Note: you don't need to reference the folder,
// Getx will search automatically for the home folder
// and add your controller there.
get create controller:dialogcontroller on home

// To create a new view in a specific folder:
// Note: you don't need to reference the folder,
// Getx will automatically search for the home folder
// and insert your view there.
get create view:dialogview on home

// To create a new provider in a specific folder:
get create provider:user on home

// To generate a localization file:
// Note: 'assets/locales' directory with your translation files in json format
get generate locales assets/locales

// To generate a class model:
// Note: 'assets/models/user.json' path of your template file in json format
// Note: on  == folder output file
// Getx will automatically search for the home folder
// and insert your class model there.
get generate model on home with assets/models/user.json

//to generate the model without the provider
get generate model on home with assets/models/user.json --skipProvider

//Note: the URL must return a json format
get generate model on home from "https://api.github.com/users/CpdnCristiano"

// To install a package in your project (dependencies):
get install camera

// To install several packages from your project:
get install http path camera

// To install a package with specific version:
get install path:1.6.4

// You can also specify several packages with version numbers

// To install a dev package in your project (dependencies_dev):
get install flutter_launcher_icons --dev

// To remove a package from your project:
get remove http

// To remove several packages from your project:
get remove http path

// To update CLI:
get update
// or `get upgrade`

// Shows the current CLI version:
get -v
// or `get -version`

// For help
get help

Exploring the CLI

let's explore the existing commands in the cli

Create project

  get create project

Using to generate a new project, you can choose between Flutter and get_server, after creating the default directory, it will run a get init next command

Init

  get init

Use this command with care it will overwrite all files in the lib folder. It allows you to choose between two structures, getx_pattern and clean.

Create page

  get create page:name

this command allows you to create modules, it is recommended for users who chose to use getx_pattern.

creates the view, controller and binding files, in addition to automatically adding the route.

You can create a module within another module.

  get create page:name on other_module

When creating a new project now and use on to create a page the CLI will use children pages.

Create Screen

  get create screen:name

similar to the create page, but suitable for those who use Clean

Create controller

  get create controller:dialog on your_folder

create a controller in a specific folder.

Using with option You can now create a template file, the way you prefer.

run

  get create controller:auth with examples/authcontroller.dart on your_folder

or with url run

  get create controller:auth with 'https://raw.githubusercontent.com/jonataslaw/get_cli/master/samples_file/controller.dart.example' on your_folder

input:

@import

class @controller extends GetxController {
  final  email = ''.obs;
  final  password = ''.obs;
  void login() {
  }

}

output:

import 'package:get/get.dart';

class AuthController extends GetxController {
  final email = ''.obs;
  final password = ''.obs;
  void login() {}
}

Create view

  get create view:dialog on your_folder

create a view in a specific folder

Generate Locates

create the json language files in the assets/locales folder.

input:

pt_BR.json

{
  "buttons": {
    "login": "Entrar",
    "sign_in": "Cadastrar-se",
    "logout": "Sair",
    "sign_in_fb": "Entrar com o Facebook",
    "sign_in_google": "Entrar com o Google",
    "sign_in_apple": "Entrar com a  Apple"
  }
}

en_US.json

{
  "buttons": {
    "login": "Login",
    "sign_in": "Sign-in",
    "logout": "Logout",
    "sign_in_fb": "Sign-in with Facebook",
    "sign_in_google": "Sign-in with Google",
    "sign_in_apple": "Sign-in with Apple"
  }
}

Run :

get generate locales assets/locales

output:

abstract class AppTranslation {

  static Map<String, Map<String, String>> translations = {
    'en_US' : Locales.en_US,
    'pt_BR' : Locales.pt_BR,
  };

}
abstract class LocaleKeys {
  static const buttons_login = 'buttons_login';
  static const buttons_sign_in = 'buttons_sign_in';
  static const buttons_logout = 'buttons_logout';
  static const buttons_sign_in_fb = 'buttons_sign_in_fb';
  static const buttons_sign_in_google = 'buttons_sign_in_google';
  static const buttons_sign_in_apple = 'buttons_sign_in_apple';
}

abstract class Locales {

  static const en_US = {
   'buttons_login': 'Login',
   'buttons_sign_in': 'Sign-in',
   'buttons_logout': 'Logout',
   'buttons_sign_in_fb': 'Sign-in with Facebook',
   'buttons_sign_in_google': 'Sign-in with Google',
   'buttons_sign_in_apple': 'Sign-in with Apple',
  };
  static const pt_BR = {
   'buttons_login': 'Entrar',
   'buttons_sign_in': 'Cadastrar-se',
   'buttons_logout': 'Sair',
   'buttons_sign_in_fb': 'Entrar com o Facebook',
   'buttons_sign_in_google': 'Entrar com o Google',
   'buttons_sign_in_apple': 'Entrar com a  Apple',
  };

}

now just add the line in GetMaterialApp

    GetMaterialApp(
      ...
      translationsKeys: AppTranslation.translations,
      ...
    )

Generate model example

Create the json model file in the assets/models/user.json

input:

{
  "name": "",
  "age": 0,
  "friends": ["", ""]
}

Run :

get generate model on home with assets/models/user.json

output:

class User {
  String name;
  int age;
  List<String> friends;

  User({this.name, this.age, this.friends});

  User.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    age = json['age'];
    friends = json['friends'].cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['age'] = this.age;
    data['friends'] = this.friends;
    return data;
  }
}

Separator file type

One day a user asked me, if it was possible to change what the final name of the file was, he found it more readable to use: my_controller_name.controller.dart, instead of the default generated by the cli: my_controller_name_controller. dart thinking about users like him we added the option for you to choose your own separator, just add this information in your pubsepc.yaml

Example:

get_cli:
  separator: "."

Configure Getx directory layout

When you create a page or screen, each module will have bindings, controllers, views sub directories.

If you prefer to have a flat file hierarchy, add the following lines to your pubspec.yaml:

get_cli:
    sub_folder: false

Are your imports disorganized?

To help you organize your imports a new command was created: get sort, in addition to organizing your imports the command will also format your dart file. thanks to dart_style. When using get sort all files are renamed, with the separator. To not rename use the --skipRename flag.

You are one of those who prefer to use relative imports instead of project imports, use the --relative option. get_cli will convert.

Internationalization of the cli

CLI now has an internationalization system.

to translate the cli into your language:

  1. create a new json file with your language, in the translations folder
  2. Copy the keys from the file, and translate the values
  3. send your PR.

TODO:

  • Support for customModels
  • Include unit tests
  • Improve generated structure
  • Add a backup system

get_cli's People

Contributors

ahm3tcelik avatar ahmednfwela avatar alexkharech avatar arjundevlucid avatar babar-bashir avatar changjoo-park avatar cpdncristiano avatar ewertonbello avatar giannuzzoexe avatar heralight avatar illusion47586 avatar iwpz avatar jonataslaw avatar katekko avatar knottx avatar maxzod avatar ninogjoni avatar padukadafa avatar prabhah avatar register2019 avatar ricardodalarme avatar roipeker avatar shawon1fb avatar shinriyo avatar siddsarkar avatar stiltet avatar va0000ll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

get_cli's Issues

"get generate model" errors out when the json file processed uses field name "default"

The following command when used to generate a model from a json file generates an error. It appears that model generation breaks if the json uses "default" as a field name.

The command:
get generate model on amodel with assets/models/default.json

The error:

✖ error_unexpected Could not format because the source could not be parsed:

line 7, column 3: 'default' can't be used as an identifier because it's a keyword.
  ╷
7 │         default = json['default'];
  │         ^^^^^^^
  ╵
line 4, column 16: Expected an identifier.
  ╷
4 │     Default({this.default});
  │                   ^^^^^^^
  ╵
line 4, column 16: Expected to find '}'.
  ╷
4 │     Default({this.default});
  │                   ^^^^^^^
  ╵
line 2, column 9: 'default' can't be used as an identifier because it's a keyword.
  ╷
2 │     String default;
  │            ^^^^^^^
  ╵
line 12, column 26: 'default' can't be used as an identifier because it's a keyword.
   ╷
12 │         data['default'] = this.default;

The original json:
{"default": "default"}

grapqhl code gen

Model / query generator from grapqhl schema,
existing solutions depend on the build - this is very slow and not suitable for a large project.

Localization generator request

It would be great to add a localization generator from json files to get_cli, while generating an abstract class with keys and translation maps, just like in the easy_localization package.

input directory

en_EN.json
ru_RU.json
{
  "menu": {
    "logoutBtn": "Log out",
    "items": {
      "settings": "Settings",
      "notifications": "Notifications",
      "wallet": "Wallet"
    }
  }
}
{
  "menu": {
    "logoutBtn": "Выход",
    "items": {
      "settings": "Настройки",
        "notifications": "Оповещения",
        "wallet": "Кошелёк"
    }
  }
}

generated keys

abstract class LocaleKeys {
  static const menu_logoutBtn = 'menu.logoutBtn';
  static const menu_items_settings = 'menu.items.settings';
  static const menu_items_notifications = 'menu.items.notifications';
  static const menu_items_wallet = 'menu.items.wallet';
}

generated localization maps

abstract class Locales {
  static const Map<String, dynamic> en_US = {
    "menu": {
      "logoutBtn": "Log out",
      "items": {
        "settings": "Settings",
        "notifications": "Notifications",
        "wallet": "Wallet"
      },
    },
  };

  static const Map<String, dynamic> ru_RU = {
    "menu": {
      "logoutBtn": "Выход",
      "items": {
        "settings": "Настройки",
        "notifications": "Оповещения",
        "wallet": "Кошелёк"
      },
    },
  };
}

using

Text(LocaleKeys.menu_logoutBtn.tr)

get update - not updating to latest version

When I run 'get update', the version remains at 0.11.2. See below for output. OS is Windows 10.

upgrade get_cli
$ pub global activate get_cli
Package get_cli is currently active at version 0.11.2.
Resolving dependencies...

  • ansicolor 1.0.5
  • archive 2.0.13
  • args 1.6.0
  • charcode 1.1.3 (1.2.0-nullsafety available)
  • cli_menu 0.2.3
  • cli_util 0.2.0
  • collection 1.14.13 (1.15.0-nullsafety.2 available)
  • convert 2.1.1
  • crypto 2.1.5
  • get_cli 0.11.2 (1.0.3 available)
  • http 0.12.2
  • http_parser 3.1.4
  • io 0.3.4
  • meta 1.2.3 (1.3.0-nullsafety.2 available)
  • path 1.7.0 (1.8.0-nullsafety available)
  • pedantic 1.9.2 (1.10.0-nullsafety available)
  • process_run 0.10.12+2 (0.10.12+3 available)
  • pub_semver 1.4.4
  • recase 3.0.0
  • source_span 1.7.0 (1.8.0-nullsafety.1 available)
  • string_scanner 1.0.5 (1.1.0-nullsafety available)
  • term_glyph 1.1.0 (1.2.0-nullsafety available)
  • typed_data 1.2.0 (1.3.0-nullsafety.2 available)
  • yaml 2.2.1
    Precompiling executables...
    Precompiled get_cli:bin\get.
    Installed executable get.
    Warning: Pub installs executables into C:\Users\DU732RP\AppData\Roaming\Pub\Cache\bin, which is not on your path.
    You can fix that by adding that directory to your system's "Path" environment variable.
    A web search for "configure windows path" will show you how.
    Activated get_cli 0.11.2.
    falha ao atualizar
    A NEW VERSION IS AVAILABLE!
    ░██████╗░███████╗████████╗   ░█████╗░██╗░░░░░░██╗
    ██╔════╝░██╔════╝╚══██╔══╝   ██╔══██╗██║░░░░░░██║
    ██║░░██╗░█████╗░░░░░██║░░░   ██║░░╚═╝██║░░░░░░██║
    ██║░░╚██╗██╔══╝░░░░░██║░░░   ██║░░██╗██║░░░░░░██║
    ╚██████╔╝███████╗░░░██║░░░   ╚█████╔╝███████╗ ██║
    ░╚═════╝░╚══════╝░░░╚═╝░░░   ░╚════╝░╚══════╝ ╚═╝

Version: 0.11.2
VERSION AVAILABLE: 1.0.3
Run: get update

The current Dart SDK version is 2.4.0.

pub global activate get_cli
Resolving dependencies...
The current Dart SDK version is 2.4.0.

Because get_cli <1.3.16 depends on recase >=3.0.0 which requires SDK version

=2.6.0 <3.0.0, get_cli <1.3.16 is forbidden.
So, because get_cli >=1.3.16 requires SDK version >=2.7.0 <3.0.0 and pub
global activate depends on get_cli any, version solving failed.

Server Project created by get_cli has error.

error

`
$ get create project
1) Flutter Project
--> 2) Get Server
? what is the name of the project? newproject
✓ pubspec.yaml created
✓ analysis_options.yaml created
✓ Package: get_server installed!
✓ Package: pedantic installed!
✓ Package: test installed!
✓ Main sample created successfully 👍

Checking project type

Get Server project detected!

Checking project type

Get Server project detected!

./lib/app/modules/home/controllers/home
✓ main.dart created
✓ app_routes.dart created
✓ app_pages.dart created
✓ home_controller.dart created
File "home" created successfully at path: ./lib/app/modules/home/controllers/home
./lib/app/modules/home/bindings/home
✓ home_binding.dart created
File "home" created successfully at path: ./lib/app/modules/home/bindings/home
./lib/app/modules/home/views/home
✓ home_view.dart created
File "home" created successfully at path: ./lib/app/modules/home/views/home
✓ home route created successfully,
✓ Home page created successfully.
✓ GetX Pattern structure successfully generated.

$ cd newproject

$ pub get
Resolving dependencies... (1.9s)

  • _fe_analyzer_shared 14.0.0
  • analyzer 0.41.1
  • args 1.6.0
  • async 2.4.2
  • auth_header 2.1.4
  • boolean_selector 2.0.0
  • charcode 1.1.3
  • cli_util 0.2.0
  • collection 1.14.13
  • convert 2.1.1
  • coverage 0.14.2
  • crypto 2.1.5
  • file 5.2.1
  • get_core 3.13.0
  • get_instance 3.13.0
  • get_rx 3.13.0
  • get_server 0.90.0
  • getstream 1.2.1
  • glob 1.2.0
  • http 0.12.2
  • http_multi_server 2.2.0
  • http_parser 3.1.4
  • http_server 0.9.8+3
  • intl 0.16.1
  • io 0.3.4
  • jaguar_jwt 2.1.6
  • js 0.6.2
  • logging 0.11.4
  • matcher 0.12.9
  • meta 1.2.4
  • mime 0.9.7
  • node_interop 1.2.1
  • node_io 1.2.0
  • node_preamble 1.4.12
  • package_config 1.9.3
  • path 1.7.0
  • pedantic 1.9.2
  • pool 1.4.0
  • pub_semver 1.4.4
  • shelf 0.7.9
  • shelf_packages_handler 2.0.0
  • shelf_static 0.2.8
  • shelf_web_socket 0.2.3
  • source_map_stack_trace 2.0.0
  • source_maps 0.10.9
  • source_span 1.7.0
  • stack_trace 1.9.6
  • stream_channel 2.0.0
  • string_scanner 1.0.5
  • term_glyph 1.1.0
  • test 1.15.7
  • test_api 0.2.18+1
  • test_core 0.3.11+4
  • typed_data 1.2.0
  • vm_service 4.2.0 (5.5.0 available)
  • watcher 0.9.7+15
  • web_socket_channel 1.1.0
  • webkit_inspection_protocol 0.7.4
  • yaml 2.2.1
    Changed 59 dependencies!

$ dart lib/main.dart
lib/main.dart: Warning: Interpreting this as package URI, 'package:newproject/main.dart'.
lib/app/modules/home/controllers/home_controller.dart:6:19: Error: The getter 'obs' isn't defined for the class 'int'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'obs'.
final count = 0.obs;
^^^

`

dart version

$ dart --version Dart SDK version: 2.12.0-76.0.dev (dev) (Wed Nov 25 05:22:28 2020 -0800) on "linux_x64"

void Oninit dosen't Working -Please Provide a fix or example on how to use the Controller

What I want to help me to use the Controller as I tried the docs and it didn't work with me

This is my View

class SplashScreenView extends GetView<SplashScreenController> {
  final SplashScreenController c = Get.find();

  Widget build(BuildContext context) {
    return Scaffold(
      body: SplashScreen(
        navigateAfterSeconds: HomeView(),

        //  imageBackground: ,
        seconds: 1,

        image: Image.asset(
          'assets/SplashScreen.png',
          fit: BoxFit.cover,
          height: Get.height,
          width: Get.width,
        ), //     child: ,
        loaderColor: Colors.red,
        loadingText: Text("جاري التحميل..."),
      ),
    );
  }
}

And this my Controller

class SplashScreenController extends GetxController {
  @override
  void onInit() {
    FlutterStatusbarManager.setNavigationBarColor(Color(0xfff00),
        animated: true);
    FlutterStatusbarManager.setColor(Color(0xfff00), animated: true);
  }

  @override
  void onReady() {}

  @override
  void onClose() {}
  void Print() => print("clicked");
}

Page Creation Ends In Error

when i enter the page creation command it ends in an error which closes the terminal. The folder is created though.

Error while creating Page

get create page:booking ✓ File: booking_controller.dart created successfully at path: ./lib\app\modules\booking\\controllers\\booking_controller.dart ✓ File: booking_view.dart created successfully at path: ./lib\app\modules\booking\\views\\booking_view.dart ✓ File: booking_binding.dart created successfully at path: ./lib\app\modules\booking\\bindings\\booking_binding.dart ✖ error_unexpected FormatException: Not a properly formatted version string
OS: Windows 10
get_cli Version: 1.4.4

cannot create child page on module (windows) - NoSuchMethodError: The getter 'path' was called on null.

I want to create a child page on the parent page:
get create page:takeaway_checkout on takeaway

But it created only empty folder with error message:

✖  + Folder .\lib\app\modules\takeaway\takeaway_checkout not found

Unhandled exception:
NoSuchMethodError: The getter 'path' was called on null.
Receiver: null
Tried calling: path
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1      Structure.model (package:get_cli/core/structure.dart:68:20)
#2      handleFileCreate (package:get_cli/functions/create/create_single_file.dart:20:31)
#3      CreatePageCommand._writeFiles (package:get_cli/commands/impl/create/page/page.dart:76:26)
#4      CreatePageCommand.checkForAlreadyExists (package:get_cli/commands/impl/create/page/page.dart:69:7)
#5      CreatePageCommand.execute (package:get_cli/commands/impl/create/page/page.dart:33:5)
#6      main (file:///C:/Users/AKbalthom/AppData/Local/Pub/Cache/git/get_cli-c27ea6d11ec0efcd1c9f72ab3726467268ec0855/bin/get.dart:18:
23)
#7      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:281:32)
#8      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

The page [takeaway_checkout] already exists, do you want to overwrite it?

  1) Yes!
  2) No
  3) I want to rename

Even I chose option 1(yes), it still creates an empty folder only.

Cant find the Controller ?

why can find controller when i get create page: testpage ?

checking router is ok
checking app.page is ok

image

Package get_cli is currently active at version 0.11.2

A NEW VERSION IS AVAILABLE!
░██████╗░███████╗████████╗   ░█████╗░██╗░░░░░░██╗
██╔════╝░██╔════╝╚══██╔══╝   ██╔══██╗██║░░░░░░██║
██║░░██╗░█████╗░░░░░██║░░░   ██║░░╚═╝██║░░░░░░██║
██║░░╚██╗██╔══╝░░░░░██║░░░   ██║░░██╗██║░░░░░░██║
╚██████╔╝███████╗░░░██║░░░   ╚█████╔╝███████╗ ██║
░╚═════╝░╚══════╝░░░╚═╝░░░   ░╚════╝░╚══════╝ ╚═╝

Version: 0.11.2
VERSION AVAILABLE: 1.4.5
Run: get update

DART VERSION:
~ dart --version
Dart VM version: 2.7.2 (Mon Mar 23 22:11:27 2020 +0100) on "macos_x64"

Error generating capital letters

I am generating localization with the command:
get generate locales assets/locales
At some point, for properties that have capital letters in the name, when generating into a class, an error occurs in the property name.
static const error_SERVICE_NOT_AVAILABLE = 'error_SERVICE_NOT_AVAILABLE';
'error_s_e_r_v_i_c_e_n_o_t_a_v_a_i_l_a_b_l_e': '推送通知服务不可用。',
Property names are different.

get_cli 1.4.1

Wrong folder on Generate models

Hi,
steps to reproduce:

get create project -> name -> GetX pattern
get create page:posts
get create page:post
get generate model on post with assets/models/model_post.json

Model output is on page "posts"instead of "post".

Thanks for the amazing work!

terminal doesn't see Get

I run flutter pub global activate get_cli
get_cli installed successfully

My PATH variable
image

I reboot my PC
Try to use get
image

Despite it actually exists
image

CLEAN (by Arktekko) documentation

Hello
I am trying to use the CLEAN architecture by Arktekko, but there is no documentation or any instruction how to use this architecture or Getx architecture.
Is there any that i didn't find??!
Or there is really no documentation for them??

Error on "get create page"

get_cli Version: 1.3.12
Calling get create page:any gives the following error:

Checking project type


Flutter project detected!

✖ Folder app/modules/any not found

✖ Unexpected error occurred:
NoSuchMethodError: The getter 'path' was called on null.
Receiver: null
Tried calling: path

It creates an empty folder any in app/modules, but doesn't generate any routes or files inside

any get command is closing the terminal

Hello, I have Dart 2.10.4 (stable), flutter 1.22.5 (stable), get 1.3.15, windows 7. Somehow any "get" command is closing the terminal it's launched in. Is it a default behavior or it can be changed anywhere?

Reorganize the CLI structure ?

I propose to reorganize the CLI structure, there are not many functions yet.
it would be wise to store commands in the map

import './commands/init/init.dart';
import './commands/create/project/project.dart';
import './commands/create/page/page.dart';
import './commands/create/view/view.dart';
import './commands/generate/locales/locales.dart';
import './commands/install/install.dart';
import './commands/version/version.dart';

const commands = {
  'init': initCommand,
  'create': {
    'project': createProjectCommand,
    'page': createPageCommand,
    'view': createViewCommand,
    ...
  },
  'generate': {
    'locales': generateLocalesCommand,
    ...
  },
  'install': installCommand,
  '-v', versionCommand, // change to `version`, to have the same structure everywhere?
  '-version', versionCommand, // and remove this alias?
  ...
};

// map for help in console 
const hints = {
  'init': 'generate the chosen structure on an existing project',
  'create': {
    'project': 'create a flutter project in the current directory',
    ...
  },
  ...
};

running the command can generate multiple files

./commands/create/page/samples/controller.dart
./commands/create/page/samples/binding.dart
./commands/create/page/samples/view.dart

Motivation:

  • All commands have one clear structure.
  • To add a new command, you need to create a separate independent directory.
  • Easily generate help in the console.
  • It is easy to check that the command exists and at this nesting level is a function.
  • Easy to expand functionality name unlimited command nesting.

Failed to precompile get_cli:get

After running command flutter pub cache repair I got this error.

Reactivating get_cli 1.4.1...
Precompiling executables...
Failed to precompile get_cli:get:
Error: Could not resolve the package 'get_cli' in 'package:get_cli/exception_handler/exception_handler.dart'.
Error: Could not resolve the package 'get_cli' in 'package:get_cli/functions/version/version_update.dart'.
Error: Could not resolve the package 'get_cli' in 'package:get_cli/get_cli.dart'.
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:1:8: Error: Not found: 'package:get_cli/exception_handler/exception_handler.dart'
import 'package:get_cli/exception_handler/exception_handler.dart';
       ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:2:8: Error: Not found: 'package:get_cli/functions/version/version_update.dart'
import 'package:get_cli/functions/version/version_update.dart';
       ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:3:8: Error: Not found: 'package:get_cli/get_cli.dart'
import 'package:get_cli/get_cli.dart';
       ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:6:19: Error: Method not found: 'GetCli'.
  final command = GetCli(arguments).findCommand();
                  ^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:10:47: Error: Method not found: 'checkForUpdate'.
      await command.execute().then((value) => checkForUpdate());
                                              ^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:15:49: Error: Method not found: 'checkForUpdate'.
        await command.execute().then((value) => checkForUpdate());
                                                ^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:18:7: Error: Method not found: 'ExceptionHandler'.
      ExceptionHandler().handle(e);
      ^^^^^^^^^^^^^^^^
Failed to reactivate get_cli 1.4.1: Failed to precompile get_cli:get:
Error: Could not resolve the package 'get_cli' in 'package:get_cli/exception_handler/exception_handler.dart'.
Error: Could not resolve the package 'get_cli' in 'package:get_cli/functions/version/version_update.dart'.
Error: Could not resolve the package 'get_cli' in 'package:get_cli/get_cli.dart'.
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:1:8: Error: Not found: 'package:get_cli/exception_handler/exception_handler.dart'
import 'package:get_cli/exception_handler/exception_handler.dart';
       ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:2:8: Error: Not found: 'package:get_cli/functions/version/version_update.dart'
import 'package:get_cli/functions/version/version_update.dart';
       ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:3:8: Error: Not found: 'package:get_cli/get_cli.dart'
import 'package:get_cli/get_cli.dart';
       ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:6:19: Error: Method not found: 'GetCli'.
  final command = GetCli(arguments).findCommand();
                  ^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:10:47: Error: Method not found: 'checkForUpdate'.
      await command.execute().then((value) => checkForUpdate());
                                              ^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:15:49: Error: Method not found: 'checkForUpdate'.
        await command.execute().then((value) => checkForUpdate());
                                                ^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get_cli-1.4.1/bin/get.dart:18:7: Error: Method not found: 'ExceptionHandler'.
      ExceptionHandler().handle(e);
      ^^^^^^^^^^^^^^^^
Binstubs exist for non-activated packages:
  From get_cli: get
Failed to reactivate 1 package:
- get_cli
pub finished with exit code 69

Error with single quotes

Put any key like the following:
"my_key": "Today's",

on a json file and generate with:
get locales assets/locale

The generated file is wrong and bad formatting on that key due the single quotes.

Error Create GetX Pattern

PS C:\Users\Gustavo\androidstudioprojects> get create project

  1. Flutter Project
  2. Get Server
    1
    ? what is the name of the project? juegosx
    ? What is your company's domain? example: com.yourcompany com.senior

Running flutter create C:\Users\Gustavo\androidstudioprojects/juegosx

$ flutter create --org com.senior C:\Users\Gustavo\androidstudioprojects/juegosx
Recreating project ....
Wrote 3 files.

All done!
[✓] Flutter: is fully installed. (Channel master, 1.23.0-14.0.pre.136, on Microsoft Windows [Versión 10.0.19041.450], locale es-VE)
[✓] Android toolchain - develop for Android devices: is fully installed. (Android SDK version 29.0.2)
[✓] Chrome - develop for the web: is fully installed.
[✓] Android Studio: is fully installed. (version 4.0)
[✓] VS Code: is fully installed. (version 1.50.0)
[✓] Connected device: is fully installed. (3 available)

In order to run your application, type:

$ cd .
$ flutter run

Your application code is in .\lib\main.dart.

  1. GetX Pattern (by Kauê)
  2. CLEAN (by Arktekko)
    1

Your lib folder is not empty. Are you sure you want to overwrite your project?
WARNING: This action is irreversible

  1. Yes
  2. No
    1
    ✓ Main sample created successfully 👍

Checking project type

Flutter project detected!

Checking project type

Flutter project detected!

✖ Folder app/modules/home not found

✓ main.dart created
✓ app_routes.dart created
✓ app_pages.dart created
✖ Unexpected error occurred:
NoSuchMethodError: The getter 'path' was called on null.
Receiver: null
Tried calling: path

Create theme command

I would like if possible to have a command to manage the themes of the application.

what is the difference between view and screen?

get create screen:main

and

get create view:main

I saw they generate something similar.

and have not document about screen.

and are you interesting to generate a controller based on http request?

Can't install a local package

Can't install a local package by providing the path to.

dependencies:
  flutter:
    sdk: flutter
  muqel_api: # <-- my local package
    path: ./api/muqel_api
  provider: ^4.3.3

get create project - by default kotlin/swift

would be nice to be able to select project language kotlin or java for android and swift or objc for IOS, like flutter do "flutter create -a java -i swift"

workaround:
1-run "flutter create -i swift -a java --org com.example project_name"
2-run "get init"

Running get create project:test - Can't create directory

Hi,

Running the get create project:test I get the following error:

ProcessException: No such file or directory
Command: flutter create --org org.jdallc /Users/johndestefano/IdeaProjects/test

The parent test directory does get created though.

I'm using version 1.3.14 on a Mac.

Thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.