diff --git a/lib/components/TaskTile.dart b/lib/components/TaskTile.dart index c49ea45..3d307d5 100644 --- a/lib/components/TaskTile.dart +++ b/lib/components/TaskTile.dart @@ -41,7 +41,7 @@ class TaskTileState extends State { strokeWidth: 2.0, )), ), - title: Text(_currentTask.text), + title: Text(_currentTask.title), subtitle: _currentTask.description == null || _currentTask.description.isEmpty ? null @@ -54,7 +54,7 @@ class TaskTileState extends State { ); } return CheckboxListTile( - title: Text(_currentTask.text), + title: Text(_currentTask.title), controlAffinity: ListTileControlAffinity.leading, value: _currentTask.done ?? false, subtitle: @@ -83,7 +83,7 @@ class TaskTileState extends State { return VikunjaGlobal.of(context).taskService.update(Task( id: task.id, done: checked, - text: task.text, + title: task.title, description: task.description, owner: null, )); diff --git a/lib/models/namespace.dart b/lib/models/namespace.dart index f271914..e851761 100644 --- a/lib/models/namespace.dart +++ b/lib/models/namespace.dart @@ -4,19 +4,19 @@ import 'package:meta/meta.dart'; class Namespace { final int id; final DateTime created, updated; - final String name, description; + final String title, description; final User owner; Namespace( {@required this.id, this.created, this.updated, - @required this.name, + @required this.title, this.description, this.owner}); Namespace.fromJson(Map json) - : name = json['name'], + : title = json['title'], description = json['description'], id = json['id'], created = DateTime.parse(json['created']), @@ -26,7 +26,7 @@ class Namespace { toJSON() => { "created": created?.toIso8601String(), "updated": updated?.toIso8601String(), - "name": name, + "title": title, "owner": owner?.toJSON(), "description": description }; diff --git a/lib/models/task.dart b/lib/models/task.dart index 0a83f7a..7f4d800 100644 --- a/lib/models/task.dart +++ b/lib/models/task.dart @@ -5,7 +5,7 @@ class Task { final int id; final DateTime created, updated, due; final List reminders; - final String text, description; + final String title, description; final bool done; final User owner; @@ -15,7 +15,7 @@ class Task { this.updated, this.reminders, this.due, - @required this.text, + @required this.title, this.description, @required this.done, @required this.owner}); @@ -29,7 +29,7 @@ class Task { ?.toList(), due = DateTime.parse(json['dueDate']), description = json['description'], - text = json['text'], + title = json['title'], done = json['done'], owner = User.fromJson(json['createdBy']); @@ -41,7 +41,7 @@ class Task { reminders?.map((date) => date.toIso8601String())?.toList(), 'dueDate': due?.toIso8601String(), 'description': description, - 'text': text, + 'title': title, 'done': done ?? false, 'createdBy': owner?.toJSON() }; diff --git a/lib/pages/home.dart b/lib/pages/home.dart index 089cf07..eeeb4b3 100644 --- a/lib/pages/home.dart +++ b/lib/pages/home.dart @@ -37,7 +37,7 @@ class HomePageState extends State with AfterLayoutMixin { .asMap() .forEach((i, namespace) => namespacesList.add(new ListTile( leading: const Icon(Icons.folder), - title: new Text(namespace.name), + title: new Text(namespace.title), selected: i == _selectedDrawerIndex, onTap: () => _onSelectItem(i), ))); @@ -72,7 +72,7 @@ class HomePageState extends State with AfterLayoutMixin { return new Scaffold( appBar: AppBar( - title: new Text(_currentNamespace?.name ?? 'Vikunja'), + title: new Text(_currentNamespace?.title ?? 'Vikunja'), actions: _currentNamespace == null ? null : [ @@ -156,7 +156,7 @@ class HomePageState extends State with AfterLayoutMixin { _addNamespace(String name, BuildContext context) { VikunjaGlobal.of(context) .namespaceService - .create(Namespace(id: null, name: name)) + .create(Namespace(id: null, title: name)) .then((_) { _loadNamespaces(); Scaffold.of(context).showSnackBar(SnackBar( diff --git a/lib/pages/list/list.dart b/lib/pages/list/list.dart index f963a2a..d5640c2 100644 --- a/lib/pages/list/list.dart +++ b/lib/pages/list/list.dart @@ -111,7 +111,7 @@ class _ListPageState extends State { _addItem(String name, BuildContext context) { var globalState = VikunjaGlobal.of(context); var newTask = - Task(id: null, text: name, owner: globalState.currentUser, done: false); + Task(id: null, title: name, owner: globalState.currentUser, done: false); setState(() => _loadingTasks.add(newTask)); globalState.taskService.add(_list.id, newTask).then((task) { setState(() { diff --git a/lib/pages/namespace/namespace_edit.dart b/lib/pages/namespace/namespace_edit.dart index a9d21cd..b77abb8 100644 --- a/lib/pages/namespace/namespace_edit.dart +++ b/lib/pages/namespace/namespace_edit.dart @@ -36,7 +36,7 @@ class _NamespaceEditPageState extends State { child: TextFormField( maxLines: null, keyboardType: TextInputType.multiline, - initialValue: widget.namespace.name, + initialValue: widget.namespace.title, onSaved: (name) => _name = name, validator: (name) { if (name.length < 3 || name.length > 250) { @@ -98,7 +98,7 @@ class _NamespaceEditPageState extends State { // aka updating the existing namespace we got from context (setters?) Namespace updatedNamespace = Namespace( id: widget.namespace.id, - name: _name, + title: _name, description: _description, owner: widget.namespace.owner); diff --git a/lib/service/mocked_services.dart b/lib/service/mocked_services.dart index 35d5fbb..1980e31 100644 --- a/lib/service/mocked_services.dart +++ b/lib/service/mocked_services.dart @@ -12,7 +12,7 @@ var _users = {1: User(1, 'test@testuser.org', 'test1')}; var _namespaces = { 1: Namespace( id: 1, - name: 'Test 1', + title: 'Test 1', created: DateTime.now(), updated: DateTime.now(), description: 'A namespace for testing purposes', @@ -38,7 +38,7 @@ var _lists = { var _tasks = { 1: Task( id: 1, - text: 'Task 1', + title: 'Task 1', owner: _users[1], updated: DateTime.now(), created: DateTime.now(),