Rename namespace name and task text to title
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2020-06-15 23:42:12 +02:00
parent 46fc580b7b
commit 68d3ffd30d
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
7 changed files with 19 additions and 19 deletions

View File

@ -41,7 +41,7 @@ class TaskTileState extends State<TaskTile> {
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<TaskTile> {
);
}
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<TaskTile> {
return VikunjaGlobal.of(context).taskService.update(Task(
id: task.id,
done: checked,
text: task.text,
title: task.title,
description: task.description,
owner: null,
));

View File

@ -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<String, dynamic> 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
};

View File

@ -5,7 +5,7 @@ class Task {
final int id;
final DateTime created, updated, due;
final List<DateTime> 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()
};

View File

@ -37,7 +37,7 @@ class HomePageState extends State<HomePage> with AfterLayoutMixin<HomePage> {
.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<HomePage> with AfterLayoutMixin<HomePage> {
return new Scaffold(
appBar: AppBar(
title: new Text(_currentNamespace?.name ?? 'Vikunja'),
title: new Text(_currentNamespace?.title ?? 'Vikunja'),
actions: _currentNamespace == null
? null
: <Widget>[
@ -156,7 +156,7 @@ class HomePageState extends State<HomePage> with AfterLayoutMixin<HomePage> {
_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(

View File

@ -111,7 +111,7 @@ class _ListPageState extends State<ListPage> {
_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(() {

View File

@ -36,7 +36,7 @@ class _NamespaceEditPageState extends State<NamespaceEditPage> {
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<NamespaceEditPage> {
// 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);

View File

@ -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(),