chore: hide unfinished gitlab login entry

This commit is contained in:
Rongjian Zhang 2020-01-14 14:01:26 +08:00
parent 36c9eda9ac
commit c15c7096e9
1 changed files with 51 additions and 51 deletions

View File

@ -140,57 +140,57 @@ class _LoginScreenState extends State<LoginScreen> {
}
},
),
_buildAddItem(
text: 'GitLab Account by Token',
onTap: () async {
var result =
await Provider.of<ThemeModel>(context).showConfirm(
context,
Column(
children: <Widget>[
CupertinoTextField(
placeholder: 'Domain',
onChanged: (v) {
setState(() {
_gitlabDomain = v;
});
},
),
SizedBox(height: 8),
CupertinoTextField(
placeholder: 'Access token',
onChanged: (v) {
setState(() {
_gitlabToken = v;
});
},
),
SizedBox(height: 8),
Text(
'GitTouch needs these permissions',
style: TextStyle(
fontSize: 14, fontWeight: FontWeight.w400),
),
SizedBox(height: 8),
Text(
'api, read_user, read_repository',
style: TextStyle(
fontSize: 16, color: theme.palette.primary),
)
],
),
);
if (result == true) {
try {
await auth.loginToGitlab(_gitlabDomain, _gitlabToken);
// TODO: Custom domain
} catch (err) {
Provider.of<ThemeModel>(context).showConfirm(
context, Text('Token invalid: $err'));
}
}
},
)
// _buildAddItem(
// text: 'GitLab Account by Token',
// onTap: () async {
// var result =
// await Provider.of<ThemeModel>(context).showConfirm(
// context,
// Column(
// children: <Widget>[
// CupertinoTextField(
// placeholder: 'Domain',
// onChanged: (v) {
// setState(() {
// _gitlabDomain = v;
// });
// },
// ),
// SizedBox(height: 8),
// CupertinoTextField(
// placeholder: 'Access token',
// onChanged: (v) {
// setState(() {
// _gitlabToken = v;
// });
// },
// ),
// SizedBox(height: 8),
// Text(
// 'GitTouch needs these permissions',
// style: TextStyle(
// fontSize: 14, fontWeight: FontWeight.w400),
// ),
// SizedBox(height: 8),
// Text(
// 'api, read_user, read_repository',
// style: TextStyle(
// fontSize: 16, color: theme.palette.primary),
// )
// ],
// ),
// );
// if (result == true) {
// try {
// await auth.loginToGitlab(_gitlabDomain, _gitlabToken);
// // TODO: Custom domain
// } catch (err) {
// Provider.of<ThemeModel>(context).showConfirm(
// context, Text('Token invalid: $err'));
// }
// }
// },
// )
],
),
),