mirror of
https://github.com/go-vikunja/app
synced 2024-09-16 12:51:46 +00:00
feat: added "add project" button
This commit is contained in:
parent
c39aadabe0
commit
fa48c80bb7
@ -12,8 +12,10 @@ class ProjectAPIService extends APIService implements ProjectService {
|
||||
|
||||
@override
|
||||
Future<Project?> create(Project p) {
|
||||
// TODO: implement create
|
||||
throw UnimplementedError();
|
||||
return client.put('/projects', body: p.toJSON()).then((response) {
|
||||
if (response == null) return null;
|
||||
return Project.fromJson(response.body);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -121,6 +121,12 @@ class _ProjectOverviewPageState extends State<ProjectOverviewPage>
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: Text("Projects"),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.add),
|
||||
onPressed: () => _addProjectDialog(context),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -158,7 +164,6 @@ class _ProjectOverviewPageState extends State<ProjectOverviewPage>
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text('The project was created successfully!'),
|
||||
));
|
||||
}).catchError((error) => showDialog(
|
||||
context: context, builder: (context) => ErrorDialog(error: error)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user