Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README bd_BN #213

Open
wants to merge 73 commits into
base: add_lints
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
37dfdb2
Update README-zh_CN.md
register2019 May 5, 2022
1c10c61
Update README-zh_CN.md
register2019 May 5, 2022
8103bac
Merge pull request #173 from register2019/patch-1
jonataslaw May 23, 2022
b52d145
Merge pull request #174 from register2019/patch-2
jonataslaw May 23, 2022
e8af944
fixed null check in version pub.dev
arjundevlucid Jun 15, 2022
5c08e38
fixed pub version
arjundevlucid Jun 15, 2022
ac2a090
Merge branch 'add_lints'
arjundevlucid Jun 15, 2022
ebdaaa4
fixed
arjundevlucid Jun 15, 2022
ea16e01
Merge branch 'add_lints'
arjundevlucid Jun 15, 2022
68584cb
Merge pull request #182 from jonataslaw/add_lints
jonataslaw Jun 20, 2022
567e7ef
Merge branch 'master' into master
jonataslaw Jun 20, 2022
ed5b8d0
Merge pull request #185 from Shreemanarjun/master
jonataslaw Jun 20, 2022
0e5d1a4
replaced cli_dialog with dcli
arjundevlucid Jun 21, 2022
5438ce6
Merge branch 'add_lints'
arjundevlucid Jun 21, 2022
76e7092
Merge branch 'master' of https://github.com/Shreemanarjun/get_cli
arjundevlucid Jun 21, 2022
89a2c91
added default value to menu
arjundevlucid Jun 21, 2022
7199e37
Merge branch 'add_lints'
arjundevlucid Jun 21, 2022
8032148
added create project title
arjundevlucid Jun 21, 2022
bebd69d
Merge branch 'add_lints'
arjundevlucid Jun 21, 2022
a368b2b
added consts to views
arjundevlucid Jun 21, 2022
37ba024
Merge branch 'add_lints'
arjundevlucid Jun 21, 2022
8ead14b
updated version dependency
arjundevlucid Jun 21, 2022
4da54ad
Merge branch 'add_lints'
arjundevlucid Jun 21, 2022
77ada34
adding spaces to menus
arjundevlucid Jun 21, 2022
f881051
Merge branch 'add_lints'
arjundevlucid Jun 21, 2022
89f68e4
Merge pull request #186 from Shreemanarjun/master
jonataslaw Jun 21, 2022
4d4be0e
Version updated to 1.8.2 with changelog
arjundevlucid Jun 22, 2022
ddfa2e8
Merge branch 'add_lints'
arjundevlucid Jun 22, 2022
8211d72
Merge pull request #187 from Shreemanarjun/master
jonataslaw Jun 22, 2022
b0426db
i18n: add arabic translation
va0000ll Jun 26, 2022
6d4c86a
Merge pull request #188 from va0000ll/master
CpdnCristiano Aug 4, 2022
1392323
Add sub_folder configuration documentation
heralight Dec 12, 2022
d497ec9
Merge pull request #206 from heralight/master
jonataslaw Feb 27, 2023
33147cb
Remove empty space in Structure page directory path
BunnarithHeang Apr 9, 2023
5d1f21e
Update project.dart
shinriyo May 4, 2023
de098ee
Update locales.g.dart
shinriyo May 4, 2023
5359675
Update README-zh_CN.md
iwpz May 14, 2023
87b5dbe
deleting dart migrate
padukadafa Jul 2, 2023
ab98502
upgrade flutter version
padukadafa Jul 2, 2023
89a54b9
upgrade dcli version
padukadafa Jul 2, 2023
f2bec58
fixing error while compiling get_cli
padukadafa Jul 2, 2023
4c0d9ba
adding nullsafety migration for dart version 3 lower
padukadafa Jul 2, 2023
8119d37
change dart version
padukadafa Jul 2, 2023
41b68b6
change dcli version to 2.3.0
padukadafa Jul 2, 2023
471ec67
remove dart migrate, fix generate optional double
knottx May 5, 2023
da84a97
fix-typo: update `tranlations` to `translations`
siddsarkar Aug 22, 2023
659c20f
Changing extesion name for clarity
CpdnCristiano Sep 8, 2023
7205c1d
refactor the get_cli
CpdnCristiano Sep 8, 2023
ea54073
Merge pull request #235 from siddsarkar/master-1
CpdnCristiano Sep 8, 2023
173fb0d
Merge branch 'master' of github.com:jonataslaw/get_cli
CpdnCristiano Sep 8, 2023
d4d954d
Merge pull request #230 from padukadafa/master
CpdnCristiano Sep 8, 2023
44dec44
Merge pull request #223 from iwpz/master
CpdnCristiano Sep 8, 2023
89ec8a6
Merge pull request #221 from knottx/fix-generate-double-type
CpdnCristiano Sep 8, 2023
5013070
Merge branch 'master' of github.com:jonataslaw/get_cli
CpdnCristiano Sep 8, 2023
0cbdef3
remove nullsafe option
CpdnCristiano Sep 8, 2023
b1ed3db
add french translations
Feb 14, 2024
3a65ab9
update dependencies
knottx Mar 3, 2024
34dbd66
Merge pull request #250 from knottx/knottx
CpdnCristiano Mar 5, 2024
0d643cb
update dcli
knottx Apr 5, 2024
434af78
Merge pull request #252 from knottx/knottx
jonataslaw Apr 5, 2024
6d029c7
Merge pull request #246 from Martzolff/master
jonataslaw Apr 5, 2024
cbee5b5
Merge pull request #220 from shinriyo/patch-2
jonataslaw Apr 5, 2024
e14ad36
Merge pull request #219 from shinriyo/patch-1
jonataslaw Apr 5, 2024
d6e0f69
UPDATE: Update impl/get_view.dart to adhere Flutter's - Convert 'key'…
hakimzuldev Apr 24, 2024
2f8ffc1
Update README-zh_CN.md
openapphub Aug 2, 2024
7356aa3
update to 1.9.0
jonataslaw Aug 20, 2024
1f569e5
add dart 3 constraint
jonataslaw Aug 20, 2024
87699b1
Merge pull request #267 from jonataslaw/1.9.0
jonataslaw Aug 20, 2024
3ef1079
Merge pull request #255 from hakimzuldev/master
jonataslaw Aug 20, 2024
9fc39ef
Merge pull request #216 from BunnarithHeang/master
jonataslaw Aug 20, 2024
d271562
Merge pull request #266 from openapphub/master
jonataslaw Aug 20, 2024
cd22dc7
fix yaml parser
jonataslaw Aug 20, 2024
6d9ca78
Merge pull request #268 from jonataslaw/fix-parser
jonataslaw Aug 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
## [1.9.0]

- Update to dart 3
- Make null safety mandatory

## [1.8.2]

- Replace cli_dialog with dcli
- version dependency updated
- Added dafault value to menu & spaces
- Fixed some lints with views

## [1.8.1]

- Fixed null error in pub version
- Fixed get view by adding const

## [1.8.0]

- Update dependencies, remove pedantic and effective dart from lints options

## [1.7.1]

- Remove unmaintained dependencies

## [1.7.0]

- Fix Path and null safety errors (@CpdnCristiano)
- Translation to Chinese (@iwpz @zhangwanping)
- Update Portugueses docs @ricardodalarme
- Update Portugueses docs @ricardodalarme
- Add Italian translation (@giannuzzoexe)
- Fix Generate Model null-safety error (@maxzod)
- Fixed errors in Arc clean: (@Babar-Bashir, @shawon1fb)



## [1.6.0]

- Fix cast error on local dependencies (@ahmednfwela)
- Fix null safety model creator (@prabhah)
- Fix windows path separator error (@CpdnCristiano)
- Added new official linter (@Illusion47586)
- Added german language(@ngjoni)


## [1.5.0]

- Add support to null safety
Expand All @@ -39,11 +57,11 @@
- Add alias for install: `get -i PACKAGE`
- Add alias for create: `get -c page:name`
- Add alias for generate: `get -g locales`
- add turkish translation by @ahm3tcelik
- add turkish translation by @ahm3tcelik

## [1.4.4]

- Add alias getx: `getx command`
- Add alias getx: `getx command`

## [1.4.3]

Expand Down
29 changes: 23 additions & 6 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GetX™ 框架的官方 CLI。
```dart
// 安装:
pub global activate get_cli
// 使用本命令需要设置系统环境变量: [FlutterSDK安装目录]\bin\cache\dart-sdk\bin
// 使用本命令需要设置系统环境变量: [FlutterSDK安装目录]\bin\cache\dart-sdk\bin 和 [FlutterSDK安装目录]\.pub-cache\bin

flutter pub global activate get_cli

Expand All @@ -21,11 +21,18 @@ get create project
// 在现有项目中生成所选结构:
get init

// 创建页面:
// 创建page:
// (页面包括 controller, view, 和 binding)
// 注: 你可以随便命名, 例如: `get create page:login`
// 注: 选择了 Getx_pattern 结构才用这个选项
get create page:home

// 创建 Screen:
// (Screens 有 controller, view, 和 binding)
// 注: 你可以随便命名,例如: `get screen page:login`
// 注: 选择了 CLEAN 结构才用这个选项 (by Arktekko)
get create screen:home

// 在指定文件夹创建新 controller:
// 注: 你无需引用文件夹, Getx 会自动搜索 home 目录,
// 并把你的controller放在那儿
Expand Down Expand Up @@ -114,10 +121,9 @@ get help
```shell
get create page:name
```
该命令允许您创建模块,建议选择使用 getx_pattern 的用户使用,

这条命令允许你创建模块,建议选择getx_pattern的人使用。

创建 view, controller 和 binding 文件, 除了自动添加路由。
创建 view, controller 和 binding 文件, 此外还可以自动添加路由。

你可以在一个模块内创建另一个模块。

Expand Down Expand Up @@ -193,7 +199,7 @@ class AuthController extends GetxController {

在指定目录创建 view

### 生成国家化文件
### 生成国际化文件

在 assets/locales 目录创建 json 格式的语言文件

Expand Down Expand Up @@ -347,6 +353,17 @@ get_cli:
separator: "."
```

### 配置 Getx 路径样式

当你创建一个 Page 或 Screen 时,每个模块都会有 binding , controller, view 子目录。

如果你更想要一个平级文件结构,添加以下内容到你的`pubspec.yaml`:

```yml
get_cli:
sub_folder: false
```

### 你的 import 乱不乱?

为了帮你管理你的 import 我加了个新命令: `get sort`, 除了帮你排序整理 import, 这条命令还帮你格式化 dart 文件。感谢 [dart_style](https://pub.dev/packages/dart_style).
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,17 @@ 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`:

```yml
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](https://pub.dev/packages/dart_style).
Expand All @@ -370,7 +381,7 @@ CLI now has an internationalization system.

to translate the cli into your language:

1. create a new json file with your language, in the [tranlations](/translations) folder
1. create a new json file with your language, in the [translations](/translations) folder
2. Copy the keys from the [file](/translations/en.json), and translate the values
3. send your PR.

Expand Down
5 changes: 0 additions & 5 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

include: package:lints/recommended.yaml

analyzer:
strong-mode:
implicit-casts: false

linter:
rules:
constant_identifier_names: false

2 changes: 1 addition & 1 deletion lib/cli_config/cli_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:path/path.dart';

class CliConfig {
static final DateFormat _formatter = DateFormat('yyyy-MM-dd');
// Em devsevolvimento

static File getFileConfig() {
var scriptFile = Platform.script.toFilePath();
var path = join(dirname(scriptFile), '.get_cli.yaml');
Expand Down
13 changes: 7 additions & 6 deletions lib/commands/impl/create/page/page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:io';

import 'package:cli_dialog/cli_dialog.dart';

import 'package:dcli/dcli.dart';
import 'package:recase/recase.dart';

import '../../../../common/menu/menu.dart';
Expand Down Expand Up @@ -62,11 +63,11 @@ class CreatePageCommand extends Command {
if (result.index == 0) {
_writeFiles(path, name!, overwrite: true);
} else if (result.index == 2) {
final dialog = CLI_Dialog();
dialog.addQuestion(LocaleKeys.ask_new_page_name.tr, 'name');
name = dialog.ask()['name'] as String?;

checkForAlreadyExists(name!.trim().snakeCase);
// final dialog = CLI_Dialog();
// dialog.addQuestion(LocaleKeys.ask_new_page_name.tr, 'name');
// name = dialog.ask()['name'] as String?;
var name = ask(LocaleKeys.ask_new_page_name.tr);
checkForAlreadyExists(name.trim().snakeCase);
}
} else {
Directory(path).createSync(recursive: true);
Expand Down
49 changes: 21 additions & 28 deletions lib/commands/impl/create/project/project.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:io';

import 'package:cli_dialog/cli_dialog.dart';
import 'package:dcli/dcli.dart';
import 'package:path/path.dart' as p;
import 'package:recase/recase.dart';

Expand All @@ -23,32 +23,35 @@ class CreateProjectCommand extends Command {
final menu = Menu([
'Flutter Project',
'Get Server',
]);
], title: 'Select which type of project you want to create ?');
final result = menu.choose();
String? nameProject = name;
if (name == '.') {
final dialog = CLI_Dialog(questions: [
[LocaleKeys.ask_name_to_project.tr, 'name']
]);
nameProject = dialog.ask()['name'] as String?;
// final dialog = CLI_Dialog(questions: [
// [LocaleKeys.ask_name_to_project.tr, 'name']
// ]);
nameProject = ask(LocaleKeys.ask_name_to_project.tr);
}

var path = Structure.replaceAsExpected(
path: Directory.current.path + p.separator + nameProject!.snakeCase);
path: Directory.current.path + p.separator + nameProject.snakeCase);
await Directory(path).create(recursive: true);

Directory.current = path;

if (result.index == 0) {
final dialog = CLI_Dialog(questions: [
[
'${LocaleKeys.ask_company_domain.tr} \x1B[33m '
'${LocaleKeys.example.tr} com.yourcompany \x1B[0m',
'org'
]
]);

var org = dialog.ask()['org'] as String?;
// final dialog = CLI_Dialog(questions: [
// [
// '${LocaleKeys.ask_company_domain.tr} \x1B[33m '
// '${LocaleKeys.example.tr} com.yourcompany \x1B[0m',
// 'org'
// ]
// ]);

var org = ask(
'${LocaleKeys.ask_company_domain.tr} \x1B[33m '
'${LocaleKeys.example.tr} com.yourcompany \x1B[0m',
);

final iosLangMenu =
Menu(['Swift', 'Objective-C'], title: LocaleKeys.ask_ios_lang.tr);
Expand All @@ -62,26 +65,16 @@ class CreateProjectCommand extends Command {

var androidLang = androidResult.index == 0 ? 'kotlin' : 'java';

final nullSafeMenu = Menu(
[LocaleKeys.options_yes.tr, LocaleKeys.options_no.tr],
title: LocaleKeys.ask_use_null_safe.tr);
final nullSafeMenuResult = nullSafeMenu.choose();

var useNullSafe = nullSafeMenuResult.index == 0;

final linterMenu = Menu([
'yes',
'no',
'Yes',
'No',
], title: LocaleKeys.ask_use_linter.tr);
final linterResult = linterMenu.choose();

await ShellUtils.flutterCreate(path, org, iosLang, androidLang);

File('test/widget_test.dart').writeAsStringSync('');

if (useNullSafe) {
await ShellUtils.activatedNullSafe();
}
switch (linterResult.index) {
case 0:
if (PubspecUtils.isServerProject) {
Expand Down
12 changes: 7 additions & 5 deletions lib/commands/impl/generate/model/model.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:io';

import 'package:cli_dialog/cli_dialog.dart';

import 'package:dcli/dcli.dart';
import 'package:http/http.dart';
import 'package:path/path.dart' as p;
import 'package:recase/recase.dart';
Expand All @@ -23,10 +24,11 @@ class GenerateModelCommand extends Command {
Future<void> execute() async {
var name = p.basenameWithoutExtension(withArgument).pascalCase;
if (withArgument.isEmpty) {
final dialog = CLI_Dialog(questions: [
[LocaleKeys.ask_model_name.tr, 'name']
]);
var result = dialog.ask()['name'] as String;
// final dialog = CLI_Dialog(questions: [
// [LocaleKeys.ask_model_name.tr, 'name']
// ]);
// var result = dialog.ask()['name'] as String;
var result = ask(LocaleKeys.ask_model_name.tr);
name = result.pascalCase;
}

Expand Down
20 changes: 11 additions & 9 deletions lib/common/menu/menu.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:cli_dialog/cli_dialog.dart';
import 'package:dcli/dcli.dart';

class Menu {
final List<String> choices;
Expand All @@ -7,15 +7,17 @@ class Menu {
Menu(this.choices, {this.title = ''});

Answer choose() {
final dialog = CLI_Dialog(listQuestions: [
[
{'question': title, 'options': choices},
'result'
]
]);
// final dialog = CLI_Dialog(listQuestions: [
// [
// {'question': title, 'options': choices},
// 'result'
// ]
// ]);

final answer = dialog.ask();
final result = answer['result'] as String;
// final answer = dialog.ask();
// final result = answer['result'] as String;
print("");
final result = menu(title, options: choices, defaultOption: choices[0]);
final index = choices.indexOf(result);

return Answer(result: result, index: index);
Expand Down
4 changes: 2 additions & 2 deletions lib/common/utils/json_serialize/json_ast/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Segment extends Loc {
: super(line: line, column: column);

@override
bool operator ==(dynamic other) =>
bool operator ==(Object other) =>
other is Segment &&
line == other.line &&
column == other.column &&
Expand All @@ -34,7 +34,7 @@ class Location {
const Location(this.start, this.end, [this.source]);

@override
bool operator ==(dynamic other) =>
bool operator ==(Object other) =>
other is Location &&
start == other.start &&
end == other.end &&
Expand Down
Loading