diff --git a/lib/models/theme.dart b/lib/models/theme.dart index de7536b..c54db8c 100644 --- a/lib/models/theme.dart +++ b/lib/models/theme.dart @@ -224,6 +224,7 @@ class ThemeModel with ChangeNotifier { Future showConfirm(BuildContext context, Widget content) { switch (theme) { case AppThemeType.cupertino: + default: return showCupertinoDialog( context: context, builder: (context) { @@ -247,29 +248,29 @@ class ThemeModel with ChangeNotifier { ); }, ); - default: - return showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - content: content, - actions: [ - FlatButton( - child: const Text('CANCEL'), - onPressed: () { - Navigator.pop(context, false); - }, - ), - FlatButton( - child: const Text('OK'), - onPressed: () { - Navigator.pop(context, true); - }, - ) - ], - ); - }, - ); + // default: + // return showDialog( + // context: context, + // builder: (BuildContext context) { + // return AlertDialog( + // content: content, + // actions: [ + // FlatButton( + // child: const Text('CANCEL'), + // onPressed: () { + // Navigator.pop(context, false); + // }, + // ), + // FlatButton( + // child: const Text('OK'), + // onPressed: () { + // Navigator.pop(context, true); + // }, + // ) + // ], + // ); + // }, + // ); } } diff --git a/lib/screens/issue_form.dart b/lib/screens/issue_form.dart index 03109f2..632ff8d 100644 --- a/lib/screens/issue_form.dart +++ b/lib/screens/issue_form.dart @@ -22,6 +22,7 @@ class _IssueFormScreenState extends State { @override Widget build(BuildContext context) { + final theme = Provider.of(context); return CommonScaffold( title: Text('Submit an issue'), body: Column( @@ -29,6 +30,7 @@ class _IssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( + style: TextStyle(color: theme.palette.text), placeholder: 'Title', onChanged: (v) { setState(() { @@ -40,6 +42,7 @@ class _IssueFormScreenState extends State { Padding( padding: CommonStyle.padding, child: CupertinoTextField( + style: TextStyle(color: theme.palette.text), placeholder: 'Body', onChanged: (v) { setState(() { diff --git a/lib/screens/login.dart b/lib/screens/login.dart index d37c783..bb36e80 100644 --- a/lib/screens/login.dart +++ b/lib/screens/login.dart @@ -6,6 +6,7 @@ import 'package:git_touch/scaffolds/single.dart'; import 'package:git_touch/utils/utils.dart'; import 'package:git_touch/widgets/action_button.dart'; import 'package:git_touch/widgets/app_bar_title.dart'; +import 'package:git_touch/widgets/text_field.dart'; import 'package:provider/provider.dart'; import '../widgets/link.dart'; import '../widgets/loading.dart'; @@ -95,12 +96,12 @@ class _LoginScreenState extends State { return Column( children: [ if (showDomain) - CupertinoTextField( + MyTextField( controller: _domainController, placeholder: 'Domain', ), SizedBox(height: 8), - CupertinoTextField( + MyTextField( placeholder: 'Access token', controller: _tokenController, ), diff --git a/lib/widgets/text_field.dart b/lib/widgets/text_field.dart new file mode 100644 index 0000000..a4763b5 --- /dev/null +++ b/lib/widgets/text_field.dart @@ -0,0 +1,32 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:git_touch/models/theme.dart'; +import 'package:provider/provider.dart'; + +class MyTextField extends StatelessWidget { + final TextEditingController controller; + final String placeholder; + MyTextField({@required this.controller, this.placeholder}); + + @override + Widget build(BuildContext context) { + final theme = Provider.of(context); + switch (theme.theme) { + case AppThemeType.cupertino: + default: + return CupertinoTextField( + controller: controller, + placeholder: placeholder, + style: TextStyle(color: theme.palette.text), + ); + // default: + // return TextField( + // controller: controller, + // decoration: InputDecoration( + // filled: true, + // labelText: placeholder, + // ), + // ); + } + } +}