jonataslaw / get_cli Goto Github PK
View Code? Open in Web Editor NEWOfficial Getx CLI
License: Apache License 2.0
Official Getx CLI
License: Apache License 2.0
I using get cli to init but has an error alert?
https://ibb.co/L64Q30n
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
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...
Version: 0.11.2
VERSION AVAILABLE: 1.0.3
Run: get update
Model / query generator from grapqhl schema,
existing solutions depend on the build - this is very slow and not suitable for a large project.
Generated model with List show deprecated code:
user = List<User>();
to install specific version of package
$ get install package_info:0.4.2
but this is not mentioned in readme or in any documentation
and also how to give range of version for package?
so shall i add this to readme file?
Regarding from the getx_pattern from kauemurakami.
The module folder has not sub folders. Only an optionnal local_widgets folder.
I personnaly remove all subfolders (binding, controller, view) to avoid click effort when I'm navigating between files.
Might be create subfolders only with a command flag ?
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?
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
Dart: 2.10.1
get_cli: ^1.3.11
get: 3.13.2
get create view:homeview on screens
✖ File not found in pubspec.yaml
issuing this command doesn't install both package at one go $get install firebase_core firebase_auth
when i enter the page creation command it ends in an error which closes the terminal. The folder is created though.
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.
How would I create page with dynamic route such as /sports/:name
?
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)
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
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)
$ 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 SDK version: 2.12.0-76.0.dev (dev) (Wed Nov 25 05:22:28 2020 -0800) on "linux_x64"
When using the get create page: name
command and the page already exists it should ask whether you want to replace the existing page or not. This is most likely applicable to other commands that create files.
After installing get_cli from pub with pub global activate get_cli
, type in any get command in the terminal, it just force close the terminal after execute the command.
get_cli: 1.3.12
OS: Window 10
When you create the default project it is putting the package com.example.nameDir
. It would be nice to be able to pass you the package you want to put on.
how to use https://pub.flutter-io.cn/ replace pub.dev request
I would like if possible to have a command to manage the themes of the application.
Installation successful without any problem, but when run any command it did not work, and show (lwp-request version 2.07) commands
get install file_picker
executing this command more than once should return in terminal like it is already defined and want to update ?(interactive manner)
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"}
I generated the project with Getx, and it's strange that initialRoute's Build method is executed twice. What causes this? Can I turn off this multiple refresh?
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!
A NEW VERSION IS AVAILABLE!
░██████╗░███████╗████████╗ ░█████╗░██╗░░░░░░██╗
██╔════╝░██╔════╝╚══██╔══╝ ██╔══██╗██║░░░░░░██║
██║░░██╗░█████╗░░░░░██║░░░ ██║░░╚═╝██║░░░░░░██║
██║░░╚██╗██╔══╝░░░░░██║░░░ ██║░░██╗██║░░░░░░██║
╚██████╔╝███████╗░░░██║░░░ ╚█████╔╝███████╗ ██║
░╚═════╝░╚══════╝░░░╚═╝░░░ ░╚════╝░╚══════╝ ╚═╝
DART VERSION:
~ dart --version
Dart VM version: 2.7.2 (Mon Mar 23 22:11:27 2020 +0100) on "macos_x64"
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"
Can you elaborate in readme, how to generate child modules based on this update https://github.com/jonataslaw/get_cli/blob/master/CHANGELOG.md#1316 ?
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
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.
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");
}
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
I guess config.dart should be something like that:
enum Environments {
PRODUCTION,
QAS,
}
class ConfigEnvironments {
static Map<String, dynamic> _env = {
"env":
Environments.PRODUCTION
};
static Map<String, dynamic> getEnvironments() {
return _env;
}
}
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
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:
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??
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?
When I run
pub global activate get_cli
I get this
Package get_cli is currently active at version 1.3.13.
How do i get the latest version?
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.
PS C:\Users\Gustavo\androidstudioprojects> get create project
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.
Your lib folder is not empty. Are you sure you want to overwrite your project?
WARNING: This action is irreversible
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
not able to generate model from url
Would like to have analysis_options.yaml generated with an import either from pedantic or effective dart. Could even be an optional flag.
i was wondering is there any way to achieve tab completion while using
get remove package-name
since pubspec.yaml file is there, why can't we just infer that and give this feature to the user
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.