rounded_input_field.dart 856 B

1234567891011121314151617181920212223242526272829303132333435
  1. import 'package:flowy_style/text_field_container.dart';
  2. import 'package:flutter/material.dart';
  3. class RoundedInputField extends StatelessWidget {
  4. final String? hintText;
  5. final IconData? icon;
  6. final bool obscureText;
  7. final ValueChanged<String>? onChanged;
  8. const RoundedInputField({
  9. Key? key,
  10. this.hintText,
  11. this.icon = Icons.person,
  12. this.obscureText = false,
  13. this.onChanged,
  14. }) : super(key: key);
  15. @override
  16. Widget build(BuildContext context) {
  17. return TextFieldContainer(
  18. child: TextFormField(
  19. onChanged: onChanged,
  20. cursorColor: const Color(0xFF6F35A5),
  21. obscureText: obscureText,
  22. decoration: InputDecoration(
  23. icon: Icon(
  24. icon,
  25. color: const Color(0xFF6F35A5),
  26. ),
  27. hintText: hintText,
  28. border: InputBorder.none,
  29. ),
  30. ));
  31. }
  32. }