fix: material dark mode text
This commit is contained in:
parent
559d6756e8
commit
a4284d00fb
|
@ -224,6 +224,7 @@ class ThemeModel with ChangeNotifier {
|
|||
Future<bool> 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: <Widget>[
|
||||
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: <Widget>[
|
||||
// FlatButton(
|
||||
// child: const Text('CANCEL'),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context, false);
|
||||
// },
|
||||
// ),
|
||||
// FlatButton(
|
||||
// child: const Text('OK'),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context, true);
|
||||
// },
|
||||
// )
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ class _IssueFormScreenState extends State<IssueFormScreen> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return CommonScaffold(
|
||||
title: Text('Submit an issue'),
|
||||
body: Column(
|
||||
|
@ -29,6 +30,7 @@ class _IssueFormScreenState extends State<IssueFormScreen> {
|
|||
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<IssueFormScreen> {
|
|||
Padding(
|
||||
padding: CommonStyle.padding,
|
||||
child: CupertinoTextField(
|
||||
style: TextStyle(color: theme.palette.text),
|
||||
placeholder: 'Body',
|
||||
onChanged: (v) {
|
||||
setState(() {
|
||||
|
|
|
@ -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<LoginScreen> {
|
|||
return Column(
|
||||
children: <Widget>[
|
||||
if (showDomain)
|
||||
CupertinoTextField(
|
||||
MyTextField(
|
||||
controller: _domainController,
|
||||
placeholder: 'Domain',
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
CupertinoTextField(
|
||||
MyTextField(
|
||||
placeholder: 'Access token',
|
||||
controller: _tokenController,
|
||||
),
|
||||
|
|
|
@ -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<ThemeModel>(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,
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue