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