2019-02-21 11:43:41 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2019-09-27 14:52:38 +02:00
|
|
|
import 'package:git_touch/models/auth.dart';
|
2019-09-25 11:06:36 +02:00
|
|
|
import 'package:git_touch/scaffolds/single.dart';
|
2019-09-11 13:59:47 +02:00
|
|
|
import 'package:git_touch/widgets/app_bar_title.dart';
|
2019-09-08 14:07:35 +02:00
|
|
|
import 'package:provider/provider.dart';
|
2019-02-21 11:43:41 +01:00
|
|
|
|
|
|
|
class LoginGitlabScreen extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
_LoginGitlabScreenState createState() => _LoginGitlabScreenState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _LoginGitlabScreenState extends State<LoginGitlabScreen> {
|
|
|
|
String _token;
|
|
|
|
String _domain;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2019-09-25 11:06:36 +02:00
|
|
|
return SingleScaffold(
|
2019-09-11 13:59:47 +02:00
|
|
|
title: AppBarTitle('Login to GitLab'),
|
2019-09-25 11:06:36 +02:00
|
|
|
body: Column(
|
2019-09-25 08:24:20 +02:00
|
|
|
children: <Widget>[
|
|
|
|
TextField(
|
|
|
|
// decoration: InputDecoration(icon: Icon(Icons.more_vert)),
|
|
|
|
onChanged: (value) {
|
|
|
|
_domain = value;
|
|
|
|
},
|
|
|
|
),
|
|
|
|
TextField(
|
|
|
|
onChanged: (value) {
|
|
|
|
_token = value;
|
|
|
|
},
|
|
|
|
),
|
|
|
|
MaterialButton(
|
|
|
|
child: Text('Login'),
|
|
|
|
onPressed: () {
|
2019-09-27 14:52:38 +02:00
|
|
|
Provider.of<AuthModel>(context).loginToGitlab(_domain, _token);
|
2019-09-25 08:24:20 +02:00
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
2019-02-21 11:43:41 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|