1
0
mirror of https://github.com/git-touch/git-touch synced 2025-02-08 23:58:46 +01:00
Rongjian Zhang efe0126bdb build: migrate to NNBD
closes #136
2021-05-16 15:16:35 +08:00

33 lines
933 B
Dart

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,
// ),
// );
}
}
}