245 lines
8.8 KiB
Dart
245 lines
8.8 KiB
Dart
import '/flutter_flow/flutter_flow_icon_button.dart';
|
|
import '/flutter_flow/flutter_flow_theme.dart';
|
|
import '/flutter_flow/flutter_flow_util.dart';
|
|
import 'package:easy_debounce/easy_debounce.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'prompt_box_model.dart';
|
|
export 'prompt_box_model.dart';
|
|
|
|
class PromptBoxWidget extends StatefulWidget {
|
|
const PromptBoxWidget({super.key});
|
|
|
|
@override
|
|
State<PromptBoxWidget> createState() => _PromptBoxWidgetState();
|
|
}
|
|
|
|
class _PromptBoxWidgetState extends State<PromptBoxWidget> {
|
|
late PromptBoxModel _model;
|
|
|
|
@override
|
|
void setState(VoidCallback callback) {
|
|
super.setState(callback);
|
|
_model.onUpdate();
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_model = createModel(context, () => PromptBoxModel());
|
|
|
|
_model.textController ??= TextEditingController();
|
|
_model.textFieldFocusNode ??= FocusNode();
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_model.maybeDispose();
|
|
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SafeArea(
|
|
child: Container(
|
|
width: double.infinity,
|
|
decoration: BoxDecoration(
|
|
color: FlutterFlowTheme.of(context).secondaryBackground,
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
alignment: AlignmentDirectional(0, 0),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: [
|
|
Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.all(14),
|
|
child: FlutterFlowIconButton(
|
|
borderColor: Colors.transparent,
|
|
borderRadius: 30,
|
|
borderWidth: 1,
|
|
buttonSize: 40,
|
|
icon: Icon(
|
|
Icons.file_upload_outlined,
|
|
color: FlutterFlowTheme.of(context).secondaryText,
|
|
size: 30,
|
|
),
|
|
onPressed: () {
|
|
print('IconButton pressed ...');
|
|
},
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.all(14),
|
|
child: FlutterFlowIconButton(
|
|
borderColor: Colors.transparent,
|
|
borderRadius: 30,
|
|
borderWidth: 1,
|
|
buttonSize: 40,
|
|
icon: Icon(
|
|
Icons.photo_outlined,
|
|
color: FlutterFlowTheme.of(context).secondaryText,
|
|
size: 30,
|
|
),
|
|
onPressed: () {
|
|
print('IconButton pressed ...');
|
|
},
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.all(14),
|
|
child: FlutterFlowIconButton(
|
|
borderColor: Colors.transparent,
|
|
borderRadius: 30,
|
|
borderWidth: 1,
|
|
buttonSize: 40,
|
|
icon: Icon(
|
|
Icons.mic_none,
|
|
color: FlutterFlowTheme.of(context).secondaryText,
|
|
size: 30,
|
|
),
|
|
onPressed: () {
|
|
print('IconButton pressed ...');
|
|
},
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.all(14),
|
|
child: FlutterFlowIconButton(
|
|
borderColor: Colors.transparent,
|
|
borderRadius: 30,
|
|
borderWidth: 1,
|
|
buttonSize: 40,
|
|
icon: Icon(
|
|
Icons.videocam_outlined,
|
|
color: FlutterFlowTheme.of(context).secondaryText,
|
|
size: 30,
|
|
),
|
|
onPressed: () {
|
|
print('IconButton pressed ...');
|
|
},
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.all(14),
|
|
child: FlutterFlowIconButton(
|
|
borderColor: Colors.transparent,
|
|
borderRadius: 30,
|
|
borderWidth: 1,
|
|
buttonSize: 40,
|
|
icon: Icon(
|
|
Icons.camera_alt_outlined,
|
|
color: FlutterFlowTheme.of(context).secondaryText,
|
|
size: 30,
|
|
),
|
|
onPressed: () {
|
|
print('IconButton pressed ...');
|
|
},
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Expanded(
|
|
flex: 7,
|
|
child: Padding(
|
|
padding: EdgeInsetsDirectional.fromSTEB(12, 0, 12, 0),
|
|
child: TextFormField(
|
|
controller: _model.textController,
|
|
focusNode: _model.textFieldFocusNode,
|
|
onChanged: (_) => EasyDebounce.debounce(
|
|
'_model.textController',
|
|
Duration(milliseconds: 2000),
|
|
() => setState(() {}),
|
|
),
|
|
autofocus: true,
|
|
textCapitalization: TextCapitalization.none,
|
|
textInputAction: TextInputAction.go,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
isDense: false,
|
|
counterStyle: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily: 'Readex Pro',
|
|
color: FlutterFlowTheme.of(context).secondaryText,
|
|
letterSpacing: 0,
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: FlutterFlowTheme.of(context).secondaryText,
|
|
width: 2,
|
|
),
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: Color(0x00000000),
|
|
width: 2,
|
|
),
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: Color(0x00000000),
|
|
width: 2,
|
|
),
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
color: Color(0x00000000),
|
|
width: 2,
|
|
),
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
filled: true,
|
|
fillColor: FlutterFlowTheme.of(context).alternate,
|
|
suffixIcon: Icon(
|
|
Icons.send,
|
|
color: FlutterFlowTheme.of(context).primary,
|
|
size: 30,
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily: 'Lato',
|
|
fontSize: 14,
|
|
letterSpacing: 0,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
textAlign: TextAlign.start,
|
|
maxLines: 5,
|
|
minLines: 1,
|
|
validator:
|
|
_model.textControllerValidator.asValidator(context),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|