Skip to content

Commit

Permalink
fix: Changed to use FormRef.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Dec 19, 2022
1 parent 1e8a1cf commit 97d00ad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/katana_cli/lib/code/controller_group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ part '$baseName.m.dart';
String body(String path, String baseName, String className) {
return """
/// Controller Group.
@controller
@listenables
@controllerGroup
class ${className}ControllerGroup with _\$${className}ControllerGroup, ChangeNotifier {
factory ${className}ControllerGroup({
// TODO: Define the ChangeNotifier field here.
Expand Down
17 changes: 9 additions & 8 deletions packages/katana_cli/lib/code/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ final theme = AppThemeData(
/// router.pop(); // Pop page.
/// ```
final router = AppRouter(
// TODO: Please configure the initial routing and redirection settings.
boot: ${4:null},
initialQuery: initialQuery,
redirect: [],
pages: [
// TODO: Add the page query to be used for routing.
${5},
]);
// TODO: Please configure the initial routing and redirection settings.
boot: ${4:null},
initialQuery: initialQuery,
redirect: [],
pages: [
// TODO: Add the page query to be used for routing.
${5}
],
);
/// App Localization.
///
Expand Down
6 changes: 3 additions & 3 deletions packages/katana_cli/lib/code/tmp/basic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ class ${className}Form extends FormScopedWidget {
const ${className}Form({super.key});
@override
Widget build(BuildContext context, WidgetRef ref, FormContext form) {
Widget build(BuildContext context, FormRef ref) {
// Describes the process of loading
// and defining variables required for the page.
//
// You can use [form.isAdding] or [form.isEditing] to determine if the form is currently adding new data or editing data.
// You can use [ref.isAdding] or [ref.isEditing] to determine if the form is currently adding new data or editing data.
//
// If editing is in progress, it is possible to get the ID of the item being edited with [form.editId].
// If editing is in progress, it is possible to get the ID of the item being edited with [ref.editId].
// TODO: Implement the variable loading process.
\${9}
Expand Down
6 changes: 3 additions & 3 deletions packages/katana_cli/lib/code/tmp/form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ class ${className}Form extends FormScopedWidget {
static const editQuery = ${className}EditPage.query;
@override
Widget build(BuildContext context, WidgetRef ref, FormContext form) {
Widget build(BuildContext context, FormRef ref) {
// Describes the process of loading
// and defining variables required for the page.
//
// You can use [form.isAdding] or [form.isEditing] to determine if the form is currently adding new data or editing data.
// You can use [ref.isAdding] or [ref.isEditing] to determine if the form is currently adding new data or editing data.
//
// If editing is in progress, it is possible to get the ID of the item being edited with [form.editId].
// If editing is in progress, it is possible to get the ID of the item being edited with [ref.editId].
// TODO: Implement the variable loading process.
\${4}
Expand Down

0 comments on commit 97d00ad

Please sign in to comment.