From 1966f5539801fe010f3c251b878afa60b3680082 Mon Sep 17 00:00:00 2001 From: Hamatoma Date: Sun, 15 Nov 2020 12:01:34 +0100 Subject: [PATCH] daily work: standard pages work --- lib/src/controller/base_controller.dart.01 | 11 -- lib/src/controller/button_controller.dart.01 | 53 --------- .../controller/combobox_controller.dart.01 | 57 ---------- .../controller/text_form_controller.dart.01 | 53 --------- lib/src/model/db_reference_model.dart | 22 +++- lib/src/model/model_base.dart | 4 +- .../configuration_list_page.dart | 3 +- lib/src/page/menu/menu_converter.dart | 101 ++++++++++++++++++ lib/src/page/menu/menu_list_page.dart | 3 +- lib/src/page/role/role_list_page.dart | 3 +- lib/src/page/user/user_list_page.dart | 2 +- lib/src/persistence/persistence_cache.dart | 12 ++- lib/src/persistence/rest_persistence.dart | 21 ++-- lib/src/private/bdrawer.dart | 95 +++++++--------- lib/src/widget/model_list.dart | 1 - lib/src/widget/page_controller_bones.dart | 24 +++-- test/widget/widget_test.dart | 2 +- 17 files changed, 204 insertions(+), 263 deletions(-) delete mode 100644 lib/src/controller/base_controller.dart.01 delete mode 100644 lib/src/controller/button_controller.dart.01 delete mode 100644 lib/src/controller/combobox_controller.dart.01 delete mode 100644 lib/src/controller/text_form_controller.dart.01 create mode 100644 lib/src/page/menu/menu_converter.dart diff --git a/lib/src/controller/base_controller.dart.01 b/lib/src/controller/base_controller.dart.01 deleted file mode 100644 index 46b9533..0000000 --- a/lib/src/controller/base_controller.dart.01 +++ /dev/null @@ -1,11 +0,0 @@ -import 'package:flutter_bones/flutter_bones.dart'; - -/// Base class of all controller classes in this package. -abstract class BaseController { - /// Returns the assigned model. - WidgetModel getModel(); - - /// Returns a unique name of the controller inside the module, mostly the - /// widget name of the assigned model. - String getName(); -} diff --git a/lib/src/controller/button_controller.dart.01 b/lib/src/controller/button_controller.dart.01 deleted file mode 100644 index e608ab7..0000000 --- a/lib/src/controller/button_controller.dart.01 +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bones/flutter_bones.dart'; -import 'package:flutter_bones/src/controller/base_controller.dart'; - -import '../widget/raised_button_bone.dart'; - -class ButtonController extends BaseController - implements ButtonCallbackController { - ButtonModel model; - - ButtonController(this.model); - - @override - WidgetModel getModel() { - return model; - } - - @override - String getName() { - return model.widgetName(); - } - - @override - getOnHighlightChanged(String customString, ButtonCallbackController controller) { - return null; - } - - @override - getOnLongPressed(String customString, ButtonCallbackController controller) { - return null; - } - - @override - getOnPressed(String customString, ButtonCallbackController controller) { - var rc; - switch (model.buttonModelType) { - case ButtonModelType.cancel: - break; - case ButtonModelType.custom: - break; - case ButtonModelType.search: - break; - case ButtonModelType.store: - break; - } - return rc; - } - - @override - BuildContext getContext() { - return null; - } -} diff --git a/lib/src/controller/combobox_controller.dart.01 b/lib/src/controller/combobox_controller.dart.01 deleted file mode 100644 index 322f642..0000000 --- a/lib/src/controller/combobox_controller.dart.01 +++ /dev/null @@ -1,57 +0,0 @@ -import 'package:flutter_bones/flutter_bones.dart'; - -import '../widget/dropdown_button_form_bone.dart'; -import 'base_controller.dart'; - -class ComboboxController extends BaseController - implements ComboboxCallbackController { - ComboboxModel model; - - ComboboxController(this.model); - - @override - WidgetModel getModel() { - return model; - } - - @override - String getName() { - return model.widgetName(); - } - - @override - getOnChanged(String customString, ComboboxCallbackController controller) { - return null; - } - - @override - getOnSaved(String customString, ComboboxCallbackController controller) { - return null; - } - - @override - getOnSelectedItemBuilder( - String customString, ComboboxCallbackController controller) { - return null; - } - - @override - getOnTap(String customString, ComboboxCallbackController controller) { - return null; - } - - @override - getOnValidator(String customString, ComboboxCallbackController controller) { - return null; - } - - @override - List texts() { - return model.texts; - } - - @override - List values() { - return model.values; - } -} diff --git a/lib/src/controller/text_form_controller.dart.01 b/lib/src/controller/text_form_controller.dart.01 deleted file mode 100644 index d7cd775..0000000 --- a/lib/src/controller/text_form_controller.dart.01 +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:flutter_bones/flutter_bones.dart'; - -import '../widget/text_form_field_bone.dart'; -import 'base_controller.dart'; - -class TextFormController extends BaseController - implements TextFormCallbackController { - ComboboxModel model; - - TextFormController(this.model); - - @override - WidgetModel getModel() { - return model; - } - - @override - String getName() { - return model.widgetName(); - } - - @override - getOnChanged(String customString, TextFormCallbackController controller) { - return null; - } - - @override - getOnEditingComplete( - String customString, TextFormCallbackController controller) { - return null; - } - - @override - getOnFieldSubmitted( - String customString, TextFormCallbackController controller) { - return null; - } - - @override - getOnSaved(String customString, TextFormCallbackController controller) { - return null; - } - - @override - getOnTap(String customString, TextFormCallbackController controller) { - return null; - } - - @override - getValidator(String customString, TextFormCallbackController controller) { - return null; - } -} diff --git a/lib/src/model/db_reference_model.dart b/lib/src/model/db_reference_model.dart index cb28c79..3c4c21e 100644 --- a/lib/src/model/db_reference_model.dart +++ b/lib/src/model/db_reference_model.dart @@ -2,9 +2,9 @@ import 'package:dart_bones/dart_bones.dart'; import 'column_model.dart'; import 'combo_base_model.dart'; +import 'model_base.dart'; import 'page_model.dart'; import 'section_model.dart'; -import 'model_base.dart'; /// Describes a form text field widget. class DbReferenceModel extends ComboBaseModel { @@ -77,7 +77,25 @@ class DbReferenceModel extends ComboBaseModel { listOption ??= column?.listOption; listType ??= column?.listType; checkOptionsByRegExpr(regExprOptions); - options += column?.options ?? []; + mergeOptions(column?.options); parseFinish(); } + + /// Merges entries of [options2] into [options]. + void mergeOptions(List options2) { + if (options2 != null) { + for (var option in options2) { + if (hasOption(option)) { + continue; + } + if (filterType != null) { + if (['required', 'notnull', 'unique', 'primary'].contains(option)) { + // list filters do not have this options by default. + continue; + } + } + options.add(option); + } + } + } } diff --git a/lib/src/model/model_base.dart b/lib/src/model/model_base.dart index 8e614c4..9a4efbd 100644 --- a/lib/src/model/model_base.dart +++ b/lib/src/model/model_base.dart @@ -22,7 +22,9 @@ abstract class ModelBase { bool checkOptionsByRegExpr(RegExp regExpr) { bool rc = false; options?.forEach((element) { - if (regExpr.firstMatch(element) == null) { + final toTest = + element.startsWith('not.') ? element.substring(4) : element; + if (regExpr.firstMatch(toTest) == null) { logger.error('wrong option $element in ${fullName()}'); rc = true; } diff --git a/lib/src/page/configuration/configuration_list_page.dart b/lib/src/page/configuration/configuration_list_page.dart index b71130a..64913f8 100644 --- a/lib/src/page/configuration/configuration_list_page.dart +++ b/lib/src/page/configuration/configuration_list_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import '../../model/page_model.dart'; import '../../widget/list_form.dart'; import '../../widget/page_controller_bones.dart'; @@ -57,7 +58,7 @@ class ConfigurationListPageState extends State ), ]), ], - filters: controller.widgetList, + filters: controller.modelList, errorMessage: applicationData.lastErrorMessage(controller.page.fullName()), ), diff --git a/lib/src/page/menu/menu_converter.dart b/lib/src/page/menu/menu_converter.dart new file mode 100644 index 0000000..391455a --- /dev/null +++ b/lib/src/page/menu/menu_converter.dart @@ -0,0 +1,101 @@ +import 'package:dart_bones/dart_bones.dart'; +import 'package:flutter/material.dart'; + +import '../application_data.dart'; +import '../configuration/configuration_list_page.dart'; +import '../demo_page.dart'; +import '../menu/menu_list_page.dart'; +import '../role/role_list_page.dart'; +import '../user/user_list_page.dart'; +import '../user/user_login_page.dart'; +import '../user/user_password_page.dart'; + +/// Converts menu specific strings to objects: +/// [pageByName]() converts a name to a page (of type StatefulWidget) +/// [iconByName]() converts a name to an icon. +/// Override them for more pages / icons. +class MenuConverter { + /// Returns the page given by [name]. + StatefulWidget pageByName(String name, ApplicationData applicationData) { + var rc; + switch (name) { + case 'user.login': + rc = UserLoginPage(applicationData); + break; + case 'user.list': + rc = UserListPage(applicationData); + break; + case 'role.list': + rc = RoleListPage(applicationData); + break; + case 'configuration.list': + rc = ConfigurationListPage(applicationData); + break; + case 'menu.list': + rc = MenuListPage(applicationData); + break; + case 'user.password': + rc = UserPasswordPage(applicationData.currentUserId, + applicationData.currentUserName, applicationData, null); + break; + case 'demo': + rc = DemoPage(applicationData); + break; + default: + applicationData.logger + .error('MenuConverter.pageByName(): unknown page $name'); + break; + } + return rc; + } + + /// Returns the icon given by [name]. + IconData iconByName(String name, BaseLogger logger) { + IconData rc; + switch (name) { + case 'account_box_outlined': + rc = Icons.account_box_outlined; + break; + case 'account_circle_outlined': + rc = Icons.account_circle_outlined; + break; + case 'build_outlined': + rc = Icons.build_outlined; + break; + case 'article_outlined': + rc = Icons.article_outlined; + break; + case 'login_outlined': + rc = Icons.login_outlined; + break; + case 'menu_open_outlined': + rc = Icons.menu_open_outlined; + break; + case 'square_foot_outlined': + rc = Icons.square_foot_outlined; + break; + case 'table_chart_outlined': + rc = Icons.table_chart_outlined; + break; + case 'text_snippet_outlined': + rc = Icons.text_snippet_outlined; + break; + case 'folder_outlined': + rc = Icons.folder_outlined; + break; + case 'watch_later_outlined': + rc = Icons.watch_later_outlined; + break; + case 'account_tree': + rc = Icons.account_tree_outlined; + break; + case 'construction_outlined': + rc = Icons.construction_outlined; + break; + default: + logger.error('MenuConverter.iconByName(): unknown icon $name'); + break; + } + return rc; + } +} diff --git a/lib/src/page/menu/menu_list_page.dart b/lib/src/page/menu/menu_list_page.dart index 2caa054..b7bdf00 100644 --- a/lib/src/page/menu/menu_list_page.dart +++ b/lib/src/page/menu/menu_list_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import '../../model/page_model.dart'; import '../../widget/list_form.dart'; import '../../widget/page_controller_bones.dart'; @@ -56,7 +57,7 @@ class MenuListPageState extends State implements RedrawPage { ), ]), ], - filters: controller.widgetList, + filters: controller.modelList, errorMessage: applicationData.lastErrorMessage(controller.page.fullName()), ), diff --git a/lib/src/page/role/role_list_page.dart b/lib/src/page/role/role_list_page.dart index 4719315..d5966f5 100644 --- a/lib/src/page/role/role_list_page.dart +++ b/lib/src/page/role/role_list_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import '../../model/page_model.dart'; import '../../widget/list_form.dart'; import '../../widget/page_controller_bones.dart'; @@ -56,7 +57,7 @@ class RoleListPageState extends State implements RedrawPage { ), ]), ], - filters: controller.widgetList, + filters: controller.modelList, errorMessage: applicationData.lastErrorMessage(controller.page.fullName()), ), diff --git a/lib/src/page/user/user_list_page.dart b/lib/src/page/user/user_list_page.dart index a18f2cd..ee7b4c9 100644 --- a/lib/src/page/user/user_list_page.dart +++ b/lib/src/page/user/user_list_page.dart @@ -58,7 +58,7 @@ class UserListPageState extends State implements RedrawPage { ), ]), ], - filters: controller.widgetList, + filters: controller.modelList, errorMessage: applicationData.lastErrorMessage(controller.page.fullName()), ), diff --git a/lib/src/persistence/persistence_cache.dart b/lib/src/persistence/persistence_cache.dart index 0ea8870..ff20bb6 100644 --- a/lib/src/persistence/persistence_cache.dart +++ b/lib/src/persistence/persistence_cache.dart @@ -91,12 +91,14 @@ class PersistenceCache { final sourceColumnsParams = key.split(';'); final idModuleName = sourceColumnsParams[0].split('.'); final nameValue = sourceColumnsParams[1].split(' '); - final params = sourceColumnsParams[2].split(' '); final params2 = {}; - params.forEach((element) { - final keyValue = element.split('='); - params2[keyValue[0]] = keyValue[1]; - }); + if (sourceColumnsParams.length > 2 && sourceColumnsParams[2].isNotEmpty) { + final params = sourceColumnsParams[2].split(' '); + params.forEach((element) { + final keyValue = element.split('='); + params2[keyValue[0]] = keyValue[1]; + }); + } final texts = hasUndef ? ['-'] : []; final values = hasUndef ? [null] : []; if (listType == ComboboxListType.configuration) { diff --git a/lib/src/persistence/rest_persistence.dart b/lib/src/persistence/rest_persistence.dart index 70d5300..94c7cc3 100644 --- a/lib/src/persistence/rest_persistence.dart +++ b/lib/src/persistence/rest_persistence.dart @@ -8,6 +8,9 @@ import 'package:meta/meta.dart'; /// A persistence layer using a REST interface to store/fetch the data. class RestPersistence extends Persistence { static RestPersistence _instance; + static final jsonHeader = { + 'Content-Type': 'application/json; charset=utf-8', + }; final String application; final String version; final BaseLogger logger; @@ -19,8 +22,6 @@ class RestPersistence extends Persistence { int sessionTimeout; String uriPrefix; - Map headers; - factory RestPersistence( {String application, String version, @@ -70,7 +71,8 @@ class RestPersistence extends Persistence { var rc; assert(['list', 'record', 'update'].contains(sqlType)); final params2 = params == null ? '{}' : convert.jsonEncode(params); - final answer = await runRequest(module, sqlName, sqlType, body: params2); + final answer = await runRequest(module, sqlName, sqlType, + body: params2, headers: jsonHeader); if (answer.isNotEmpty) { rc = convert.jsonDecode(answer); } @@ -84,7 +86,8 @@ class RestPersistence extends Persistence { Future delete( {@required String module, String sqlName, @required int id}) async { sqlName ??= 'delete'; - await runRequest(module, sqlName, 'delete', body: '{":${module}_id":$id}'); + await runRequest(module, sqlName, 'delete', body: '{":${module}_id":$id}', + headers: jsonHeader); } @override @@ -95,7 +98,8 @@ class RestPersistence extends Persistence { sqlName ??= 'insert'; var rc = 0; final data2 = data == null ? '{}' : convert.jsonEncode(data); - final answer = await runRequest(module, sqlName, 'insert', body: data2); + final answer = await runRequest( + module, sqlName, 'insert', body: data2, headers: jsonHeader); if (answer.isNotEmpty) { final map = convert.jsonDecode(answer); rc = map['id']; @@ -109,7 +113,8 @@ class RestPersistence extends Persistence { sqlName ??= 'list'; Iterable rc; final body = params == null ? '{}' : convert.jsonEncode(params); - final answer = await runRequest(module, sqlName, 'list', body: body); + final answer = await runRequest( + module, sqlName, 'list', body: body, headers: jsonHeader); if (answer.isNotEmpty) { rc = convert.jsonDecode(answer); } @@ -125,7 +130,7 @@ class RestPersistence extends Persistence { sqlName ??= 'record'; Map rc; final answer = await runRequest(module, sqlName, 'record', - body: '{":${module}_id":$id}'); + body: '{":${module}_id":$id}', headers: jsonHeader); if (answer.isNotEmpty) { rc = convert.jsonDecode(answer); } @@ -140,7 +145,7 @@ class RestPersistence extends Persistence { sqlName ??= 'record'; Map rc; final answer = await runRequest(module, sqlName, 'record', - body: convert.jsonEncode(parameters)); + body: convert.jsonEncode(parameters), headers: jsonHeader); if (answer.isNotEmpty) { rc = convert.jsonDecode(answer); } diff --git a/lib/src/private/bdrawer.dart b/lib/src/private/bdrawer.dart index d01a618..e7bb134 100644 --- a/lib/src/private/bdrawer.dart +++ b/lib/src/private/bdrawer.dart @@ -1,12 +1,6 @@ import 'package:flutter/material.dart'; -import '../page/application_data.dart'; -import '../page/configuration/configuration_list_page.dart'; -import '../page/demo_page.dart'; -import '../page/menu/menu_list_page.dart'; -import '../page/role/role_list_page.dart'; -import '../page/user/user_list_page.dart'; -import '../page/user/user_login_page.dart'; +import '../page/menu/menu_converter.dart'; import 'bsettings.dart'; class MenuItem { @@ -16,49 +10,32 @@ class MenuItem { MenuItem(this.title, this.page, this.icon); - static StatefulWidget pageByName( - String name, ApplicationData applicationData) { - var rc; - switch (name) { - case 'user.login': - rc = UserLoginPage(applicationData); - break; - case 'user.list': - rc = UserListPage(applicationData); - break; - case 'role.list': - rc = RoleListPage(applicationData); - break; - case 'configuration.list': - rc = ConfigurationListPage(applicationData); - break; - case 'menu.list': - rc = MenuListPage(applicationData); - break; - case 'demo': - rc = DemoPage(applicationData); - break; - } - return rc; - } - - static List menuItems() { + static List menuItems(MenuConverter converter) { final settings = BSettings.lastInstance; + final logger = settings.logger; return [ - MenuItem('Login', () => pageByName('user.login', settings.pageData), - Icons.account_box_outlined), - MenuItem('Rollen', () => pageByName('role.list', settings.pageData), - Icons.account_box_outlined), - MenuItem('Benutzer', () => pageByName('user.list', settings.pageData), - Icons.account_box_outlined), + MenuItem( + 'Login', + () => converter.pageByName('user.login', settings.pageData), + converter.iconByName('login_outlined', logger)), + MenuItem( + 'Rollen', + () => converter.pageByName('role.list', settings.pageData), + converter.iconByName('account_circle_outlined', logger)), + MenuItem( + 'Benutzer', + () => converter.pageByName('user.list', settings.pageData), + converter.iconByName('account_box_outlined', logger)), MenuItem( 'Konfiguration', - () => pageByName('configuration.list', settings.pageData), - Icons.account_box_outlined), - MenuItem('Startmenü', () => pageByName('menu.list', settings.pageData), - Icons.account_box_outlined), - MenuItem('Demo', () => pageByName('demo', settings.pageData), - Icons.account_box_outlined), + () => converter.pageByName('configuration.list', settings.pageData), + converter.iconByName('build_outlined', logger)), + MenuItem( + 'Startmenü', + () => converter.pageByName('menu.list', settings.pageData), + converter.iconByName('menu_open_outlined', logger)), + MenuItem('Demo', () => converter.pageByName('demo', settings.pageData), + converter.iconByName('article_outlined', logger)), ]; } } @@ -70,13 +47,15 @@ class BonesDrawer extends Drawer { static BonesDrawer builder(dynamic context) => BonesDrawer(context); static Widget buildGrid(context) { - final list = MenuItem.menuItems(); + final converter = MenuConverter(); + final list = MenuItem.menuItems(converter); final rc = Card( child: GridView.count( - crossAxisCount: 2, - crossAxisSpacing: 16.0, - children: list - .map((item) => GridTile( + crossAxisCount: 2, + crossAxisSpacing: 16.0, + children: list + .map((item) => + GridTile( child: new InkResponse( enableFeedback: true, child: Card( @@ -104,17 +83,19 @@ class BonesDrawer extends Drawer { } static Widget buildListView(context) { - final list = MenuItem.menuItems(); + final converter = MenuConverter(); + final list = MenuItem.menuItems(converter); final rc = Card( child: ListView( shrinkWrap: true, physics: ClampingScrollPhysics(), children: list - .map((item) => ListTile( - title: Text(item.title), - onTap: () { - // What happens after you tap the navigation item - Navigator.push( + .map((item) => + ListTile( + title: Text(item.title), + onTap: () { + // What happens after you tap the navigation item + Navigator.push( context, MaterialPageRoute( builder: (context) => item.page())); diff --git a/lib/src/widget/model_list.dart b/lib/src/widget/model_list.dart index b68a890..d0708dd 100644 --- a/lib/src/widget/model_list.dart +++ b/lib/src/widget/model_list.dart @@ -59,7 +59,6 @@ class ModelList { models.add(model); } } - models.add(model); } /// Builds the SQL parameters of all members of the [widgets]. diff --git a/lib/src/widget/page_controller_bones.dart b/lib/src/widget/page_controller_bones.dart index 3c80ffa..9bd8edb 100644 --- a/lib/src/widget/page_controller_bones.dart +++ b/lib/src/widget/page_controller_bones.dart @@ -13,8 +13,8 @@ import '../model/module_model.dart'; import '../model/page_model.dart'; import '../model/widget_model.dart'; import '../page/application_data.dart'; -import 'view.dart'; import 'model_list.dart'; +import 'view.dart'; import 'widget_validators.dart'; typedef RedrawCallbackFunction = Function(RedrawReason reason, @@ -25,7 +25,7 @@ typedef RedrawCallbackFunctionSimple = Function(RedrawReason reason, class PageControllerBones implements ValidatorController { final ModuleModel moduleModel; String primaryColumn; - ModelList widgetList; + ModelList modelList; final RedrawCallbackFunction redrawCallback; final GlobalKey globalKey; final String pageName; @@ -124,7 +124,7 @@ class PageControllerBones implements ValidatorController { /// [initialRow] is null or a map with the field values, /// e.g. { 'role_name': 'admin', ...} void buildModelList([Map initialRow]) { - widgetList.clear(); + modelList.clear(); page.widgets.forEach((model) { if (initialRow != null && model is FieldModel) { model.valueFromRow(initialRow); @@ -136,7 +136,7 @@ class PageControllerBones implements ValidatorController { model.value = value; } completeModels(model); - widgetList.addModel(name, model); + modelList.addModel(name, model); }); page.fields.forEach((element) => prepareModel(element)); } @@ -277,9 +277,11 @@ class PageControllerBones implements ValidatorController { rc = () { if (globalKey.currentState.validate()) { globalKey.currentState.save(); - final params = widgetList.buildSqlParams(this); + final params = modelList.buildSqlParams(this); PageModelType pageType = - moduleModel.pageByName(pageName).pageModelType; + moduleModel + .pageByName(pageName) + .pageModelType; switch (pageType) { case PageModelType.create: applicationData.persistence @@ -363,7 +365,7 @@ class PageControllerBones implements ValidatorController { /// List getWidgets() { List rc; - rc = View(moduleModel.logger).modelsToWidgets(widgetList.models, this); + rc = View(moduleModel.logger).modelsToWidgets(modelList.models, this); return rc ?? []; } @@ -374,7 +376,7 @@ class PageControllerBones implements ValidatorController { /// This method must be called early after the constructor. void initialize() { page = moduleModel.pageByName(pageName); - widgetList = ModelList('${page.fullName()}.widgets', moduleModel.logger); + modelList = ModelList('${page.fullName()}.widgets', moduleModel.logger); buildModelList(); if (page?.pageModelType == PageModelType.list) { buildRows(); @@ -384,9 +386,11 @@ class PageControllerBones implements ValidatorController { /// Copies the values of [initialRow] into the values of the fields. void initializeFields(Map initialRow) { - widgetList.models.forEach((model) { + modelList.models.forEach((model) { if (model is FieldModel && initialRow.containsKey(model.name)) { - page.fieldByName(model.name)?.value = initialRow[model.name]; + page + .fieldByName(model.name) + ?.value = initialRow[model.name]; } }); } diff --git a/test/widget/widget_test.dart b/test/widget/widget_test.dart index ace1c03..cf09564 100644 --- a/test/widget/widget_test.dart +++ b/test/widget/widget_test.dart @@ -53,7 +53,7 @@ void main() { if (lastInstance.controller is String) { lastInstance.initState(); lastInstance.build(context); - final models = lastInstance.controller.widgetList.models; + final models = lastInstance.controller.modelList.models; expect(models.length, equals(3)); } }); -- 2.39.5