git-touch-android-ios-app/lib/screens/issue.dart

48 lines
1003 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
2019-01-25 18:43:09 +01:00
import 'package:flutter/cupertino.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/widgets.dart';
2019-01-25 18:43:09 +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
}
}
}
}
}
''');
return data['repository']['issue'];
}
class IssueScreen extends StatelessWidget {
final int id;
final String owner;
final String name;
IssueScreen(this.id, this.owner, this.name);
2019-01-25 18:43:09 +01:00
@override
Widget build(BuildContext context) {
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
),
);
}
}