384 lines
17 KiB
Dart
384 lines
17 KiB
Dart
import '/commons/widgets/flutter_flow_theme.dart';
|
|
import '/commons/widgets/flutter_flow_util.dart';
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'model.dart';
|
|
export 'model.dart';
|
|
|
|
class AccessNotificationModalTemplateComponentWidget extends StatefulWidget {
|
|
const AccessNotificationModalTemplateComponentWidget({
|
|
super.key,
|
|
required this.name,
|
|
required this.type,
|
|
required this.datetime,
|
|
required this.id,
|
|
required this.drive,
|
|
});
|
|
|
|
final String? name;
|
|
final String? type;
|
|
final String? datetime;
|
|
final String? id;
|
|
final String? drive;
|
|
|
|
@override
|
|
State<AccessNotificationModalTemplateComponentWidget> createState() =>
|
|
_AccessNotificationModalTemplateComponentWidgetState();
|
|
}
|
|
|
|
class _AccessNotificationModalTemplateComponentWidgetState
|
|
extends State<AccessNotificationModalTemplateComponentWidget> {
|
|
late AccessNotificationModalTemplateComponentModel _model;
|
|
|
|
@override
|
|
void setState(VoidCallback callback) {
|
|
super.setState(callback);
|
|
_model.onUpdate();
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
|
|
_model = createModel(
|
|
context, () => AccessNotificationModalTemplateComponentModel());
|
|
|
|
_model.textController1 ??= TextEditingController(text: widget.name);
|
|
_model.textFieldFocusNode1 ??= FocusNode();
|
|
|
|
_model.textController2 ??= TextEditingController(text: widget.type);
|
|
_model.textFieldFocusNode2 ??= FocusNode();
|
|
|
|
_model.textController3 ??= TextEditingController(text: widget.datetime);
|
|
_model.textFieldFocusNode3 ??= FocusNode();
|
|
|
|
_model.textController4 ??= TextEditingController(text: widget.drive);
|
|
_model.textFieldFocusNode4 ??= FocusNode();
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_model.maybeDispose();
|
|
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
context.watch<FFAppState>();
|
|
|
|
String labelTypeResident = FFLocalizations.of(context).getVariableText(
|
|
enText: 'Resident',
|
|
ptText: 'Morador'
|
|
);
|
|
|
|
String labelTypeVisitor = FFLocalizations.of(context).getVariableText(
|
|
enText: 'Visitor',
|
|
ptText: 'Visitante'
|
|
);
|
|
|
|
return Align(
|
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0),
|
|
child: Container(
|
|
width: MediaQuery.sizeOf(context).width * 0.9,
|
|
decoration: BoxDecoration(
|
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
borderRadius: const BorderRadius.only(
|
|
bottomLeft: Radius.circular(25.0),
|
|
bottomRight: Radius.circular(25.0),
|
|
topLeft: Radius.circular(25.0),
|
|
topRight: Radius.circular(25.0),
|
|
),
|
|
),
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Container(
|
|
width: 150.0,
|
|
height: 150.0,
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: const BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
),
|
|
child: CachedNetworkImage(
|
|
fadeInDuration: const Duration(milliseconds: 100),
|
|
fadeOutDuration: const Duration(milliseconds: 100),
|
|
imageUrl: valueOrDefault<String>(
|
|
// widget.type == 'O'
|
|
// ? 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=O'
|
|
// : 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=E',
|
|
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=${widget.type}',
|
|
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
|
),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
]
|
|
.addToStart(const SizedBox(width: 10.0))
|
|
.addToEnd(const SizedBox(width: 10.0)),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
24.0, 0.0, 24.0, 0.0),
|
|
child: TextFormField(
|
|
controller: _model.textController1,
|
|
focusNode: _model.textFieldFocusNode1,
|
|
autofocus: false,
|
|
textInputAction: TextInputAction.next,
|
|
readOnly: true,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
isDense: true,
|
|
labelText: FFLocalizations.of(context).getText(
|
|
'dvag09pq' /* Nome */,
|
|
),
|
|
labelStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
),
|
|
hintStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
),
|
|
enabledBorder: InputBorder.none,
|
|
focusedBorder: InputBorder.none,
|
|
errorBorder: InputBorder.none,
|
|
focusedErrorBorder: InputBorder.none,
|
|
suffixIcon: Icon(
|
|
Icons.person,
|
|
color: FlutterFlowTheme.of(context).accent1,
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
),
|
|
textAlign: TextAlign.start,
|
|
maxLines: null,
|
|
keyboardType: TextInputType.name,
|
|
validator:
|
|
_model.textController1Validator.asValidator(context),
|
|
),
|
|
),
|
|
Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Expanded(
|
|
child: TextFormField(
|
|
controller: TextEditingController(text: widget.type == 'O' ? labelTypeResident : labelTypeVisitor),
|
|
focusNode: _model.textFieldFocusNode2,
|
|
autofocus: false,
|
|
textInputAction: TextInputAction.next,
|
|
readOnly: true,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
isDense: true,
|
|
labelText: FFLocalizations.of(context).getText(
|
|
'h3s0r1he' /* Tipo */,
|
|
),
|
|
labelStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily: FlutterFlowTheme.of(context)
|
|
.labelMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context)
|
|
.labelMediumFamily),
|
|
),
|
|
hintStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily: FlutterFlowTheme.of(context)
|
|
.labelMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context)
|
|
.labelMediumFamily),
|
|
),
|
|
enabledBorder: InputBorder.none,
|
|
focusedBorder: InputBorder.none,
|
|
errorBorder: InputBorder.none,
|
|
focusedErrorBorder: InputBorder.none,
|
|
suffixIcon: Icon(
|
|
Icons.merge_type,
|
|
color: FlutterFlowTheme.of(context).accent1,
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context)
|
|
.bodyMediumFamily),
|
|
),
|
|
textAlign: TextAlign.start,
|
|
maxLines: null,
|
|
keyboardType: TextInputType.name,
|
|
validator: _model.textController2Validator
|
|
.asValidator(context),
|
|
),
|
|
),
|
|
]
|
|
.addToStart(const SizedBox(width: 24.0))
|
|
.addToEnd(const SizedBox(width: 24.0)),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
24.0, 0.0, 24.0, 0.0),
|
|
child: TextFormField(
|
|
controller: _model.textController3,
|
|
focusNode: _model.textFieldFocusNode3,
|
|
autofocus: false,
|
|
textInputAction: TextInputAction.next,
|
|
readOnly: true,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
isDense: true,
|
|
labelText: FFLocalizations.of(context).getText(
|
|
'jveeqpdz' /* Acesso */,
|
|
),
|
|
labelStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
),
|
|
hintStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
),
|
|
enabledBorder: InputBorder.none,
|
|
focusedBorder: InputBorder.none,
|
|
errorBorder: InputBorder.none,
|
|
focusedErrorBorder: InputBorder.none,
|
|
suffixIcon: Icon(
|
|
Icons.date_range,
|
|
color: FlutterFlowTheme.of(context).accent1,
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
),
|
|
textAlign: TextAlign.start,
|
|
maxLines: null,
|
|
keyboardType: TextInputType.name,
|
|
validator:
|
|
_model.textController3Validator.asValidator(context),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
24.0, 0.0, 24.0, 0.0),
|
|
child: TextFormField(
|
|
controller: _model.textController4,
|
|
focusNode: _model.textFieldFocusNode4,
|
|
autofocus: false,
|
|
textCapitalization: TextCapitalization.none,
|
|
textInputAction: TextInputAction.next,
|
|
readOnly: true,
|
|
obscureText: false,
|
|
decoration: InputDecoration(
|
|
isDense: true,
|
|
labelText: FFLocalizations.of(context).getVariableText(
|
|
enText: 'Access Sector',
|
|
ptText: 'Setor de Acesso',
|
|
),
|
|
labelStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
),
|
|
hintStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
),
|
|
enabledBorder: InputBorder.none,
|
|
focusedBorder: InputBorder.none,
|
|
errorBorder: InputBorder.none,
|
|
focusedErrorBorder: InputBorder.none,
|
|
suffixIcon: Icon(
|
|
Icons.message,
|
|
color: FlutterFlowTheme.of(context).accent1,
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily:
|
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
),
|
|
textAlign: TextAlign.start,
|
|
validator:
|
|
_model.textController4Validator.asValidator(context),
|
|
),
|
|
),
|
|
]
|
|
.divide(const SizedBox(height: 10.0))
|
|
.addToStart(const SizedBox(height: 20.0))
|
|
.addToEnd(const SizedBox(height: 20.0)),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|