2019-01-27 17:37:44 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2019-01-25 18:43:09 +01:00
|
|
|
import 'package:flutter/cupertino.dart';
|
2019-01-30 08:09:27 +01:00
|
|
|
import 'package:git_touch/utils/utils.dart';
|
|
|
|
import 'package:git_touch/widgets/widgets.dart';
|
2019-01-25 18:43:09 +01:00
|
|
|
|
2019-01-28 14:32:01 +01:00
|
|
|
Future queryIssue(int id, String owner, String name) async {
|
|
|
|
var data = await query('''
|
|
|
|
{
|
|
|
|
repository(owner: "$owner", name: "$name") {
|
|
|
|
issue(number: $id) {
|
|
|
|
$graphqlChunk1
|
|
|
|
timeline(first: $pageSize) {
|
|
|
|
pageInfo {
|
|
|
|
hasNextPage
|
|
|
|
endCursor
|
|
|
|
}
|
|
|
|
nodes {
|
|
|
|
$graghqlChunk
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-01-27 17:37:44 +01:00
|
|
|
}
|
2019-01-28 14:32:01 +01:00
|
|
|
''');
|
|
|
|
return data['repository']['issue'];
|
|
|
|
}
|
|
|
|
|
|
|
|
class IssueScreen extends StatelessWidget {
|
|
|
|
final int id;
|
|
|
|
final String owner;
|
|
|
|
final String name;
|
2019-01-27 17:37:44 +01:00
|
|
|
|
2019-01-28 14:32:01 +01:00
|
|
|
IssueScreen(this.id, this.owner, this.name);
|
2019-01-27 17:37:44 +01:00
|
|
|
|
2019-01-25 18:43:09 +01:00
|
|
|
@override
|
2019-01-27 17:37:44 +01:00
|
|
|
Widget build(BuildContext context) {
|
2019-01-28 14:32:01 +01:00
|
|
|
return IssuePullRequestScreen(
|
|
|
|
id: id,
|
|
|
|
owner: owner,
|
|
|
|
name: name,
|
|
|
|
init: () => queryIssue(id, owner, name),
|
|
|
|
extra: Row(
|
|
|
|
children: <Widget>[Text('test')],
|
2019-01-25 18:43:09 +01:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|