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

46 lines
1.2 KiB
Dart
Raw Normal View History

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';
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();
},
)
],
),
);
}
}