1
0
mirror of https://github.com/git-touch/git-touch synced 2025-02-21 22:07:51 +01:00

feat: add artemis

This commit is contained in:
Rongjian Zhang 2019-11-06 21:27:37 +08:00
parent 1b7578f4b4
commit 716924d27d
4 changed files with 35 additions and 1 deletions

View File

@ -21,3 +21,15 @@ targets:
# include_if_null: true # include_if_null: true
# nullable: true # nullable: true
# use_wrappers: false # use_wrappers: false
artemis:
options:
schema_mapping:
- schema: lib/github.schema.json
output: lib/graphql/gh_user.dart
queries_glob: lib/graphql/user.graphql
- schema: lib/github.schema.json
output: lib/graphql/gh_repository.dart
queries_glob: lib/graphql/repository.graphql
scalar_mapping:
- graphql_type: URI
dart_type: String

View File

@ -1,6 +1,8 @@
import 'dart:io'; import 'dart:io';
import 'dart:convert'; import 'dart:convert';
import 'dart:async'; import 'dart:async';
// import 'package:artemis/client.dart';
// import 'package:gql_http_link/gql_http_link.dart';
import 'package:fimber/fimber.dart'; import 'package:fimber/fimber.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:uni_links/uni_links.dart'; import 'package:uni_links/uni_links.dart';
@ -179,6 +181,20 @@ class AuthModel with ChangeNotifier {
var _timeoutDuration = Duration(seconds: 10); var _timeoutDuration = Duration(seconds: 10);
// var _timeoutDuration = Duration(seconds: 1); // var _timeoutDuration = Duration(seconds: 1);
// ArtemisClient _gqlClient;
// ArtemisClient get gqlClient {
// if (token == null) return null;
// if (_gqlClient == null) {
// _gqlClient = ArtemisClient.fromLink(
// HttpLink(_apiPrefix + '/graphql',
// defaultHeaders: {HttpHeaders.authorizationHeader: 'token $token'}),
// );
// }
// return _gqlClient;
// }
Future<dynamic> query(String query, [String _token]) async { Future<dynamic> query(String query, [String _token]) async {
if (_token == null) { if (_token == null) {
_token = token; _token = token;

View File

@ -89,7 +89,7 @@ class ThemeModel with ChangeNotifier {
int get theme => _theme; int get theme => _theme;
bool get ready => _theme != null; bool get ready => _theme != null;
Brightness _brightness = Brightness.dark; Brightness _brightness = Brightness.light;
Brightness get brightness => _brightness; Brightness get brightness => _brightness;
Future<void> setBrightness(Brightness v) async { Future<void> setBrightness(Brightness v) async {
// TODO: Save // TODO: Save

View File

@ -37,6 +37,8 @@ dependencies:
uri: ^0.11.3 uri: ^0.11.3
fimber: ^0.3.2 fimber: ^0.3.2
photo_view: ^0.7.0 photo_view: ^0.7.0
gql: ^0.11.1
artemis: ^2.0.7
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
@ -48,6 +50,10 @@ dev_dependencies:
build_runner: ^1.7.1 build_runner: ^1.7.1
json_serializable: ^3.2.2 json_serializable: ^3.2.2
# dependencies_overrides:
# flutter_highlight:
# path: ../pd4d10/highlight/flutter_highlight
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec # following page: https://www.dartlang.org/tools/pub/pubspec