This is flutter sqlite local notification project. User can add task.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.3 KiB

2 years ago
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter/src/foundation/key.dart';
  4. import 'package:flutter/src/widgets/framework.dart';
  5. import 'package:get/get.dart';
  6. import '../utils/textStyles.dart';
  7. class MyInputField extends StatelessWidget {
  8. final String title;
  9. final String hint;
  10. final TextEditingController? controller;
  11. final Widget? widget;
  12. const MyInputField(
  13. {Key? key,
  14. required this.title,
  15. required this.hint,
  16. this.controller,
  17. this.widget})
  18. : super(key: key);
  19. @override
  20. Widget build(BuildContext context) {
  21. return Container(
  22. margin: const EdgeInsets.only(top: 10),
  23. child: Column(
  24. crossAxisAlignment: CrossAxisAlignment.start,
  25. children: [
  26. Text(
  27. title,
  28. style: titleStyle,
  29. ),
  30. Container(
  31. height: 52,
  32. margin: const EdgeInsets.only(top: 8.0),
  33. padding: const EdgeInsets.only(left: 14),
  34. decoration: BoxDecoration(
  35. border: Border.all(color: Colors.grey, width: 1.0),
  36. borderRadius: BorderRadius.circular(12)),
  37. child: Row(children: [
  38. Expanded(
  39. child: TextFormField(
  40. readOnly: widget == null ? false : true,
  41. autofocus: false,
  42. cursorColor:
  43. Get.isDarkMode ? Colors.green[100] : Colors.grey[700],
  44. controller: controller,
  45. style: subTitleStyle,
  46. decoration: InputDecoration(
  47. hintText: hint,
  48. hintStyle: subTitleStyle,
  49. focusedBorder: UnderlineInputBorder(
  50. borderSide: BorderSide(
  51. color: context.theme.backgroundColor, width: 0)),
  52. enabledBorder: UnderlineInputBorder(
  53. borderSide: BorderSide(
  54. color: context.theme.backgroundColor, width: 0)),
  55. ),
  56. )),
  57. widget == null
  58. ? Container()
  59. : Container(
  60. child: widget,
  61. )
  62. ]),
  63. )
  64. ],
  65. ));
  66. }
  67. }