diff --git a/lib/screens/login.dart b/lib/screens/login.dart index 0774e34..341d662 100644 --- a/lib/screens/login.dart +++ b/lib/screens/login.dart @@ -19,6 +19,8 @@ class LoginScreen extends StatefulWidget { class _LoginScreenState extends State { String _token = ''; + String _gitlabToken = ''; + String _gitlabDomain = 'https://gitlab.com'; Widget _buildAccountItem(int index) { final settings = Provider.of(context); @@ -141,11 +143,20 @@ class _LoginScreenState extends State { context, Column( children: [ + CupertinoTextField( + placeholder: 'Domain', + onChanged: (v) { + setState(() { + _gitlabDomain = v; + }); + }, + ), + SizedBox(height: 8), CupertinoTextField( placeholder: 'Access token', onChanged: (v) { setState(() { - _token = v; + _gitlabToken = v; }); }, ), @@ -166,8 +177,7 @@ class _LoginScreenState extends State { ); if (result == true) { try { - await auth.loginToGitlab( - 'https://gitlab.com', _token); + await auth.loginToGitlab(_gitlabDomain, _gitlabToken); // TODO: Custom domain } catch (err) { Provider.of(context).showConfirm(