2019-02-21 11:43:41 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../scaffolds/simple.dart';
|
2019-02-21 14:21:16 +01:00
|
|
|
import '../providers/settings.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) {
|
|
|
|
return SimpleScaffold(
|
|
|
|
title: Text('Login to GitLab'),
|
|
|
|
bodyBuilder: () {
|
|
|
|
return Column(
|
|
|
|
children: <Widget>[
|
|
|
|
TextField(
|
|
|
|
// decoration: InputDecoration(icon: Icon(Icons.more_vert)),
|
|
|
|
onChanged: (value) {
|
|
|
|
_domain = value;
|
|
|
|
},
|
|
|
|
),
|
|
|
|
TextField(
|
|
|
|
onChanged: (value) {
|
|
|
|
_token = value;
|
|
|
|
},
|
|
|
|
),
|
|
|
|
MaterialButton(
|
|
|
|
child: Text('Login'),
|
2019-02-21 14:21:16 +01:00
|
|
|
onPressed: () {
|
|
|
|
SettingsProvider.of(context).loginToGitlab(_domain, _token);
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
2019-02-21 11:43:41 +01:00
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|