Guest User

Untitled

a guest
Mar 2nd, 2021
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.99 KB | None | 0 0
  1. @override
  2. Widget build(BuildContext context) {
  3. final double bottomPadding = MediaQuery.of(context).viewInsets.bottom +
  4. MediaQuery.of(context).padding.bottom;
  5. return Positioned(
  6. bottom: bottomPadding,
  7. child: Material(
  8. color: Colors.transparent,
  9. child: Stack(
  10. children: [
  11. GestureDetector(
  12. behavior: HitTestBehavior.opaque,
  13. onTap: widget.onOutsideTap,
  14. child: Container(
  15. color: Colors.black.withOpacity(0.35),
  16. height: MediaQuery.of(context).size.height,
  17. width: MediaQuery.of(context).size.width,
  18. ),
  19. ),
  20. Positioned(
  21. bottom: 0,
  22. child: Container(
  23. color: AppTheme.accentLightBlue,
  24. width: MediaQuery.of(context).size.width,
  25. child: Column(
  26. children: [
  27. SizedBox(
  28. height: 70,
  29. child: ListView.builder(
  30. scrollDirection: Axis.horizontal,
  31. itemCount: _files.length,
  32. itemBuilder: (context, index) {
  33. return Padding(
  34. padding: const EdgeInsets.all(8.0),
  35. child: ClipRRect(
  36. borderRadius: BorderRadius.circular(12),
  37. child: Image.file(
  38. _files[index],
  39. height: 54,
  40. width: 54,
  41. cacheHeight: 54,
  42. cacheWidth: 54,
  43. errorBuilder: (_, __, ___) =>
  44. const SizedBox.shrink(),
  45. ),
  46. ),
  47. );
  48. },
  49. ),
  50. ),
  51. TextField(
  52. controller: widget.controller,
  53. autofocus: true,
  54. style: const TextStyle(
  55. color: AppTheme.typoDarkGrey,
  56. fontSize: 16,
  57. ),
  58. maxLines: 5,
  59. minLines: 1,
  60. textInputAction: TextInputAction.done,
  61. onSubmitted: (value) {
  62. widget.onSubmit?.call(widget.type);
  63. },
  64. focusNode: _focusNode,
  65. decoration: InputDecoration(
  66. suffixIcon: SizedBox(
  67. width: 80,
  68. child: FittedBox(
  69. fit: BoxFit.fitHeight,
  70. child: Padding(
  71. padding: const EdgeInsets.only(right: 8.0),
  72. child: Row(
  73. crossAxisAlignment: CrossAxisAlignment.start,
  74. children: [
  75. IconButton(
  76. padding: const EdgeInsets.all(4),
  77. icon: const Icon(
  78. Icons.photo_camera,
  79. size: 20,
  80. color: Colors.black,
  81. ),
  82. onPressed: () {
  83. BlocProvider.of<ImageProviderBLoC>(
  84. context)
  85. .add(
  86. const ImageProviderEvent
  87. .getFromCamera(),
  88. );
  89. },
  90. ),
  91. IconButton(
  92. icon: const Icon(
  93. Icons.collections,
  94. color: Colors.black,
  95. ),
  96. onPressed: () {
  97. BlocProvider.of<ImageProviderBLoC>(
  98. context)
  99. .add(
  100. const ImageProviderEvent
  101. .getFromGallery(),
  102. );
  103. },
  104. ),
  105. ],
  106. ),
  107. ),
  108. )),
  109. border: const OutlineInputBorder(
  110. borderSide: BorderSide.none,
  111. borderRadius: BorderRadius.zero,
  112. ),
  113. enabledBorder: const OutlineInputBorder(
  114. borderSide: BorderSide.none,
  115. borderRadius: BorderRadius.zero,
  116. ),
  117. focusedBorder: const UnderlineInputBorder(
  118. borderSide: BorderSide.none,
  119. borderRadius: BorderRadius.zero,
  120. ),
  121. hintText: widget.hintText,
  122. filled: true,
  123. hintStyle: const TextStyle(
  124. color: AppTheme.typoDarkGrey,
  125. fontSize: 16,
  126. ),
  127. fillColor: AppTheme.accentLightBlue,
  128. ),
  129. ),
  130. ],
  131. ),
  132. ),
  133. ),
  134. ],
  135. ),
  136. ),
  137. );
  138. }
Advertisement
Add Comment
Please, Sign In to add comment