Merge branch 'main' into fix/login
This commit is contained in:
commit
dfa3d0c970
|
@ -1,3 +0,0 @@
|
||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
HostUrl=https://github.com/
|
|
|
@ -1,3 +0,0 @@
|
||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
HostUrl=https://github.com/
|
|
|
@ -1,3 +0,0 @@
|
||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
HostUrl=https://github.com/
|
|
|
@ -1,3 +0,0 @@
|
||||||
[ZoneTransfer]
|
|
||||||
ZoneId=3
|
|
||||||
HostUrl=https://github.com/
|
|
|
@ -51,6 +51,8 @@
|
||||||
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
|
6436409D27A31CDC00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||||
|
6436409227A31CDD00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
C1B4A503715BC7B0F8826983 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
C1B4A503715BC7B0F8826983 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
@ -299,6 +301,8 @@
|
||||||
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
|
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
|
||||||
isa = PBXVariantGroup;
|
isa = PBXVariantGroup;
|
||||||
children = (
|
children = (
|
||||||
|
6436409D27A31CDC00820AF7 /* pt */,
|
||||||
|
6436409227A31CDD00820AF7 /* en */,
|
||||||
);
|
);
|
||||||
name = InfoPlist.strings;
|
name = InfoPlist.strings;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
|
|
@ -1,199 +1,25 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
import 'package:hub/app_state.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
|
||||||
import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
|
class AtomImageSvgTheme extends StatelessWidget {
|
||||||
|
final String filename;
|
||||||
|
final double width;
|
||||||
|
final double height;
|
||||||
|
|
||||||
class PreferencesPageWidget extends StatelessWidget {
|
const AtomImageSvgTheme({
|
||||||
const PreferencesPageWidget({super.key});
|
super.key,
|
||||||
|
required this.filename,
|
||||||
|
required this.width,
|
||||||
|
required this.height
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ChangeNotifierProvider<PreferencesPageModel>(
|
final brightness = MediaQuery.of(context).platformBrightness;
|
||||||
create: (_) => PreferencesPageModel(),
|
final isDarkMode = brightness == Brightness.dark;
|
||||||
child: Consumer<PreferencesPageModel>(
|
final path = "assets/images/${isDarkMode ? "dark" : "light"}/$filename.svg";
|
||||||
builder: (context, model, child) => GestureDetector(
|
|
||||||
onTap: () => model.unfocusNode.canRequestFocus
|
return SvgPicture.asset(path, width: width, height: height);
|
||||||
? FocusScope.of(context).requestFocus(model.unfocusNode)
|
|
||||||
: FocusScope.of(context).unfocus(),
|
|
||||||
child: Scaffold(
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
appBar: AppBar(
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
forceMaterialTransparency: true,
|
|
||||||
leading: FlutterFlowIconButton(
|
|
||||||
borderColor: Colors.transparent,
|
|
||||||
borderRadius: 30.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 60.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.keyboard_arrow_left,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
size: 30.0,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
context.pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Preferences',
|
|
||||||
ptText: 'Preferências',
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 17.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
centerTitle: true,
|
|
||||||
elevation: 0.0,
|
|
||||||
),
|
|
||||||
body: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Container(),
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: ListView.builder(
|
|
||||||
// gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
// crossAxisCount: 3,
|
|
||||||
// crossAxisSpacing: 12.0,
|
|
||||||
// mainAxisSpacing: 12.0,
|
|
||||||
// childAspectRatio: 1.0,
|
|
||||||
// mainAxisExtent: 100.0,
|
|
||||||
// ),
|
|
||||||
itemCount: 6, // Assuming 4 items for simplicity
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
return _buildIconButton(context, index, model);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) {
|
|
||||||
IconData icon;
|
|
||||||
Function() onPressed =() => {};
|
|
||||||
bool isEnabled;
|
|
||||||
String content;
|
|
||||||
|
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
icon = Icons.fingerprint;
|
|
||||||
onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false
|
|
||||||
isEnabled = FFAppState().fingerprint;
|
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Ative a autenticação por impressão digital para login seguro.',
|
|
||||||
enText: 'Enable fingerprint authentication for secure login.',
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
icon = Icons.person;
|
|
||||||
onPressed = () => model.enablePerson(context);
|
|
||||||
isEnabled = FFAppState().person;
|
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Exibir código de identificação remota',
|
|
||||||
enText: 'Display remote identification code',
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
icon = Icons.notifications;
|
|
||||||
onPressed = model.toggleNotify;
|
|
||||||
isEnabled = FFAppState().notify;
|
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Ative para receber sua notificação de acesso',
|
|
||||||
enText: 'Enable to receive your access notification',
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
icon = Icons.lock_clock_sharp;
|
|
||||||
// onLongPress = model.togglePass(context, model);
|
|
||||||
isEnabled = FFAppState().pass;
|
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Ative para inserir uma credencial de acesso para o QRCode',
|
|
||||||
enText: 'Enable to enter an access credential for the QRCode',
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
icon = Icons.landscape;
|
|
||||||
onPressed = model.localLogout;
|
|
||||||
isEnabled = false;
|
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Ative para se desvincular do local selecionado',
|
|
||||||
enText: 'Enable to unlink from the selected location',
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
icon = Icons.delete;
|
|
||||||
onPressed = () => model.deleteAccount(context);
|
|
||||||
isEnabled = false;
|
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Delete sua conta e todos os dados associados permanentemente.',
|
|
||||||
enText: 'Delete your account and all associated data permanently.',
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw Exception('Invalid index: $index');
|
|
||||||
}
|
|
||||||
|
|
||||||
return Container(
|
|
||||||
height: 100,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: index != 3 ? onPressed : () {model.togglePass(context);},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
CircleAvatar(
|
|
||||||
backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate,
|
|
||||||
child: Icon(
|
|
||||||
icon,
|
|
||||||
color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary,
|
|
||||||
// icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0),
|
|
||||||
// onPressed: index != 3 ? onPressed : () {model.togglePass(context);},
|
|
||||||
// borderRadius: 20.0,
|
|
||||||
// borderWidth: 1.0,
|
|
||||||
// buttonSize: 40.0,
|
|
||||||
// fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate,
|
|
||||||
// disabledColor: FlutterFlowTheme.of(context).alternate,
|
|
||||||
// disabledIconColor: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 8.0),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
content,
|
|
||||||
style: FlutterFlowTheme.of(context).bodySmall.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.normal,
|
|
||||||
fontStyle: FontStyle.normal,
|
|
||||||
),
|
|
||||||
overflow: TextOverflow.clip,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,13 +1,9 @@
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:hub/app_state.dart';
|
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
|
||||||
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart';
|
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|
||||||
|
|
||||||
|
import '/backend/api_requests/api_calls.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:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
@ -84,6 +80,32 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
topRight: Radius.circular(0.0),
|
topRight: Radius.circular(0.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 100.0,
|
||||||
|
height: 100.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.secondaryBackground,
|
||||||
|
),
|
||||||
|
child: FlutterFlowIconButton(
|
||||||
|
borderRadius: 20.0,
|
||||||
|
borderWidth: 1.0,
|
||||||
|
buttonSize: 40.0,
|
||||||
|
fillColor: FlutterFlowTheme.of(context).accent1,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
size: 24.0,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
print('IconButton pressed ...');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
child: FutureBuilder<ApiCallResponse>(
|
child: FutureBuilder<ApiCallResponse>(
|
||||||
future: PhpGroup.getLocalsCall.call(
|
future: PhpGroup.getLocalsCall.call(
|
||||||
devUUID: FFAppState().devUUID,
|
devUUID: FFAppState().devUUID,
|
||||||
|
@ -97,18 +119,20 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
height: 50.0,
|
height: 50.0,
|
||||||
child: SpinKitCircle(
|
child: SpinKitCircle(
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color:
|
||||||
|
FlutterFlowTheme.of(context).primary,
|
||||||
size: 50.0,
|
size: 50.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
final localsResponse = snapshot.data!;
|
final gridViewGetLocalsResponse = snapshot.data!;
|
||||||
|
|
||||||
return Builder(
|
return Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final linkedLocals = PhpGroup.getLocalsCall
|
final eachLocals = PhpGroup.getLocalsCall
|
||||||
.locais(
|
.locais(
|
||||||
localsResponse.jsonBody,
|
gridViewGetLocalsResponse.jsonBody,
|
||||||
)
|
)
|
||||||
?.map((e) => e)
|
?.map((e) => e)
|
||||||
.toList()
|
.toList()
|
||||||
|
@ -125,37 +149,32 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
childAspectRatio: 1.0,
|
childAspectRatio: 1.0,
|
||||||
),
|
),
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: linkedLocals.length,
|
itemCount: eachLocals.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, eachLocalsIndex) {
|
||||||
final localItem =
|
final eachLocalsItem =
|
||||||
linkedLocals[index];
|
eachLocals[eachLocalsIndex];
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (localItem['CLU_STATUS'] == 'A') {
|
FFAppState().cliUUID = getJsonField(
|
||||||
|
eachLocalsItem,
|
||||||
FFAppState().cliUUID = localItem['CLI_ID'];
|
r'''$.CLI_ID''',
|
||||||
|
).toString();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
FFAppState().local = localItem['CLI_NOME'];
|
FFAppState().local = getJsonField(
|
||||||
|
eachLocalsItem,
|
||||||
|
r'''$.CLI_NOME''',
|
||||||
|
).toString();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
FFAppState().ownerUUID = localItem['CLU_OWNER_ID'];
|
FFAppState().ownerUUID = getJsonField(
|
||||||
|
eachLocalsItem,
|
||||||
|
r'''$.CLU_OWNER_ID''',
|
||||||
|
).toString();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
log('Local: ${FFAppState().local}');
|
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
} else {
|
|
||||||
log('Local não disponível');
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
const SnackBar(
|
|
||||||
content: Text(
|
|
||||||
'Local não disponível',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
|
@ -172,19 +191,23 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
.primaryText,
|
.primaryText,
|
||||||
borderRadius:
|
borderRadius:
|
||||||
const BorderRadius.only(
|
const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(25.0),
|
bottomLeft:
|
||||||
|
Radius.circular(25.0),
|
||||||
bottomRight:
|
bottomRight:
|
||||||
Radius.circular(25.0),
|
Radius.circular(25.0),
|
||||||
topLeft: Radius.circular(25.0),
|
topLeft:
|
||||||
topRight: Radius.circular(25.0),
|
Radius.circular(25.0),
|
||||||
|
topRight:
|
||||||
|
Radius.circular(25.0),
|
||||||
),
|
),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color:
|
color: FlutterFlowTheme.of(
|
||||||
FlutterFlowTheme.of(context)
|
context)
|
||||||
.secondaryText,
|
.secondaryText,
|
||||||
width: 3.0,
|
width: 3.0,
|
||||||
),
|
),
|
||||||
|
@ -192,17 +215,20 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
const BorderRadius.only(
|
const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(25.0),
|
bottomLeft:
|
||||||
|
Radius.circular(25.0),
|
||||||
bottomRight:
|
bottomRight:
|
||||||
Radius.circular(25.0),
|
Radius.circular(25.0),
|
||||||
topLeft: Radius.circular(25.0),
|
topLeft:
|
||||||
topRight: Radius.circular(25.0),
|
Radius.circular(25.0),
|
||||||
|
topRight:
|
||||||
|
Radius.circular(25.0),
|
||||||
),
|
),
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
"https://freaccess.com.br/freaccess/Images/Clients/${getJsonField(
|
'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField(
|
||||||
localItem,
|
eachLocalsItem,
|
||||||
r'''$.CLI_ID''',
|
r'''$.CLI_ID''',
|
||||||
).toString()}.png",
|
).toString()}.png',
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
|
@ -213,20 +239,23 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional
|
||||||
.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
.fromSTEB(
|
||||||
|
0.0, 10.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
getJsonField(
|
getJsonField(
|
||||||
localItem,
|
eachLocalsItem,
|
||||||
r'''$.CLI_NOME''',
|
r'''$.CLI_NOME''',
|
||||||
).toString(),
|
).toString(),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(
|
||||||
context)
|
context)
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(
|
color:
|
||||||
|
FlutterFlowTheme.of(
|
||||||
context)
|
context)
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
|
@ -250,6 +279,9 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
].addToStart(const SizedBox(width: 20.0)),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -58,35 +58,35 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final options = widget.item == MenuItem.button
|
final options = widget.item == MenuItem.button
|
||||||
? <MenuEntry>[
|
? <MenuEntry>[
|
||||||
MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar/Visita' ,),),
|
MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar\nVisita' ,),),
|
||||||
|
|
||||||
MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro de Visitante' ,),),
|
MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro\nde Visitante' ,),),
|
||||||
|
|
||||||
// MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),),
|
// MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),),
|
||||||
// MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
// MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
||||||
|
|
||||||
MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'' ,),),
|
MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'QRCode\nde Acesso' ,),),
|
||||||
|
|
||||||
MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'' ,),),
|
MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'Pessoas na\nPropriedade' ,),),
|
||||||
|
|
||||||
MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'' ,),),
|
MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'Consultar\nHistóricos' ,),),
|
||||||
|
|
||||||
MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'' ,),),
|
MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'Configurações' ,),),
|
||||||
] : <MenuEntry>[
|
] : <MenuEntry>[
|
||||||
MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar/Visita' ,),),
|
MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar\nVisita' ,),),
|
||||||
|
|
||||||
MenuCardItem(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register Visitor' , ptText:'Cadastro de Visitante' ,),),
|
MenuCardItem(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register Visitor' , ptText:'Cadastro de Visitante' ,),),
|
||||||
|
|
||||||
// MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),),
|
// MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),),
|
||||||
// MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
// MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
||||||
|
|
||||||
MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'' ,),),
|
MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'QRCode de Acesso' ,),),
|
||||||
|
|
||||||
MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'' ,),),
|
MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'Pessoas na Propriedade' ,),),
|
||||||
|
|
||||||
MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'' ,),),
|
MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'Consultar Historicos' ,),),
|
||||||
|
|
||||||
MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'' ,),),
|
MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'Configurações' ,),),
|
||||||
|
|
||||||
];
|
];
|
||||||
return Padding(
|
return Padding(
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
||||||
|
import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart';
|
||||||
import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart';
|
import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart';
|
||||||
import 'package:hub/components/view_visit_detail/view_visit_detail_widget.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
|
|
||||||
class VisitDetailsModalTemplateComponentWidget extends StatefulWidget {
|
class VisitDetailsModalTemplateComponentWidget extends StatefulWidget {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_animations.dart';
|
import '/flutter_flow/flutter_flow_animations.dart';
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -164,12 +166,7 @@ class _WelcomeTemplateComponentWidgetState
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(0.0),
|
borderRadius: BorderRadius.circular(0.0),
|
||||||
child: SvgPicture.network(
|
child: const AtomImageSvgTheme(filename: 'welcome', width: 600, height: double.infinity),
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg',
|
|
||||||
width: 603.0,
|
|
||||||
height: double.infinity,
|
|
||||||
fit: BoxFit.contain,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
|
|
|
@ -1,959 +0,0 @@
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_model.dart';
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
|
||||||
import 'package:hub/flutter_flow/nav/serialization_util.dart';
|
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
|
||||||
import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.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:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/scheduler.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ViewVisitDetailWidget extends StatefulWidget {
|
|
||||||
const ViewVisitDetailWidget({
|
|
||||||
super.key,
|
|
||||||
this.visitorImgPath,
|
|
||||||
required this.visitStartDate,
|
|
||||||
required this.visitEndDate,
|
|
||||||
required this.visitReasonStr,
|
|
||||||
required this.visitLevelStr,
|
|
||||||
required this.visitTempStr,
|
|
||||||
required this.visitObsStr,
|
|
||||||
required this.visitStatusStr,
|
|
||||||
required this.visitorStrList,
|
|
||||||
this.visitorJsonList,
|
|
||||||
required this.visitIdStr,
|
|
||||||
required this.visitStatusColor,
|
|
||||||
});
|
|
||||||
|
|
||||||
final String? visitorImgPath;
|
|
||||||
final String? visitStartDate;
|
|
||||||
final String? visitEndDate;
|
|
||||||
final String? visitReasonStr;
|
|
||||||
final String? visitLevelStr;
|
|
||||||
final String? visitTempStr;
|
|
||||||
final String? visitObsStr;
|
|
||||||
final String? visitStatusStr;
|
|
||||||
final String? visitorStrList;
|
|
||||||
final List<dynamic>? visitorJsonList;
|
|
||||||
final String? visitIdStr;
|
|
||||||
final Color? visitStatusColor;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<ViewVisitDetailWidget> createState() => _ViewVisitDetailWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<dynamic>? findVisitorById(List<dynamic>? jsonList, String? id) {
|
|
||||||
if (jsonList == null || id == null) return null;
|
|
||||||
try {
|
|
||||||
var foundItem = jsonList.firstWhere(
|
|
||||||
(item) => item["VAW_ID"] == id,
|
|
||||||
orElse: () => null,
|
|
||||||
);
|
|
||||||
return foundItem != null ? [foundItem] : null;
|
|
||||||
} catch (e) {
|
|
||||||
log("Error searching item: $e");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|
||||||
late ViewVisitDetailModel _model;
|
|
||||||
bool isLoading = true;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void setState(VoidCallback callback) {
|
|
||||||
super.setState(callback);
|
|
||||||
_model.onUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_model = createModel(context, () => ViewVisitDetailModel());
|
|
||||||
|
|
||||||
// On component load action.
|
|
||||||
// SchedulerBinding.instance.addPostFrameCallback((_) async {
|
|
||||||
// if (widget.visitStatusStr != null) {
|
|
||||||
// _model.visitStatusColor = await action_blocks.manageStatusColorAction(
|
|
||||||
// context,
|
|
||||||
// visitStatusStr: widget.visitStatusStr!,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
_model.textController1 = TextEditingController(
|
|
||||||
text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.textController2 ??=
|
|
||||||
TextEditingController(text: widget.visitStartDate);
|
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.textController3 ??=
|
|
||||||
TextEditingController(text: widget.visitEndDate);
|
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.textController4 ??=
|
|
||||||
TextEditingController(text: widget.visitReasonStr);
|
|
||||||
_model.textFieldFocusNode4 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.textController5 ??=
|
|
||||||
TextEditingController(text: widget.visitLevelStr);
|
|
||||||
_model.textFieldFocusNode5 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
|
||||||
_model.textFieldFocusNode6 ??= FocusNode();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_model.maybeDispose();
|
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
var filteredVisitorJsonList =
|
|
||||||
findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null';
|
|
||||||
|
|
||||||
context.watch<FFAppState>();
|
|
||||||
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: double.infinity,
|
|
||||||
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: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 35.0,
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(0.0),
|
|
||||||
bottomRight: Radius.circular(0.0),
|
|
||||||
topLeft: Radius.circular(25.0),
|
|
||||||
topRight: Radius.circular(25.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Align(
|
|
||||||
alignment: const AlignmentDirectional(1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
15.0, 0.0, 15.0, 0.0),
|
|
||||||
child: FlutterFlowIconButton(
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.close,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
shape: BoxShape.rectangle,
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 20.0, 20.0),
|
|
||||||
child: Container(
|
|
||||||
width: 100.0,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
|
||||||
),
|
|
||||||
child: Align(
|
|
||||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
|
||||||
child: InkWell(
|
|
||||||
splashColor: Colors.transparent,
|
|
||||||
focusColor: Colors.transparent,
|
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.pop(context);
|
|
||||||
await showModalBottomSheet(
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
useSafeArea: true,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child:
|
|
||||||
const VisitorDetailsModalTemplateComponentWidget(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
},
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
|
||||||
child: CachedNetworkImage(
|
|
||||||
fadeInDuration:
|
|
||||||
const Duration(milliseconds: 500),
|
|
||||||
fadeOutDuration:
|
|
||||||
const Duration(milliseconds: 500),
|
|
||||||
imageUrl: valueOrDefault<String>(
|
|
||||||
widget.visitorImgPath,
|
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
|
||||||
),
|
|
||||||
width: 100.0,
|
|
||||||
height: 100.0,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
8.0, 0.0, 8.0, 10.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController1,
|
|
||||||
focusNode: _model.textFieldFocusNode1,
|
|
||||||
autofocus: false,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'9yu35pzg' /* Encerramento da Visita */,
|
|
||||||
),
|
|
||||||
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: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
validator: _model.textController1Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 10.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController2,
|
|
||||||
focusNode: _model.textFieldFocusNode2,
|
|
||||||
autofocus: false,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'aj6scczp' /* Início */,
|
|
||||||
),
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
hintText: FFLocalizations.of(context).getText(
|
|
||||||
'ub084nhy' /* dd/mm/yyyy */,
|
|
||||||
),
|
|
||||||
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: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
validator: _model.textController2Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController3,
|
|
||||||
focusNode: _model.textFieldFocusNode3,
|
|
||||||
autofocus: false,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'rvi5z7wg' /* Término */,
|
|
||||||
),
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
hintText: FFLocalizations.of(context).getText(
|
|
||||||
'ixs67mrz' /* dd/mm/yyyy */,
|
|
||||||
),
|
|
||||||
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: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
validator: _model.textController3Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 10.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController4,
|
|
||||||
focusNode: _model.textFieldFocusNode4,
|
|
||||||
autofocus: false,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'yxilg7ek' /* Motivo da Visita */,
|
|
||||||
),
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
hintText: FFLocalizations.of(context).getText(
|
|
||||||
'ypeydbem' /* Motivo */,
|
|
||||||
),
|
|
||||||
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: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
validator: _model.textController4Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController5,
|
|
||||||
focusNode: _model.textFieldFocusNode5,
|
|
||||||
autofocus: false,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'dgr3pk3a' /* Nível 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),
|
|
||||||
),
|
|
||||||
hintText: FFLocalizations.of(context).getText(
|
|
||||||
'rs3d4gb8' /* Nível de Acesso */,
|
|
||||||
),
|
|
||||||
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: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
validator: _model.textController5Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
8.0, 0.0, 8.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController6,
|
|
||||||
focusNode: _model.textFieldFocusNode6,
|
|
||||||
autofocus: false,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'lppn9rxa' /* Observações da Visita */,
|
|
||||||
),
|
|
||||||
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: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
validator: _model.textController6Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 35.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: widget.visitStatusColor,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(0.0),
|
|
||||||
bottomRight: Radius.circular(0.0),
|
|
||||||
topLeft: Radius.circular(0.0),
|
|
||||||
topRight: Radius.circular(0.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
if (widget.visitStatusStr == 'A') {
|
|
||||||
return Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
|
||||||
FlutterFlowIconButton(
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.block_sharp,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
_model.deleteVisit =
|
|
||||||
await PhpGroup.deleteVisitCall.call(
|
|
||||||
devUUID: FFAppState().devUUID,
|
|
||||||
userUUID: FFAppState().userUUID,
|
|
||||||
cliID: FFAppState().cliUUID,
|
|
||||||
atividade: 'cancelaVisita',
|
|
||||||
idVisita: widget.visitIdStr,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (PhpGroup.deleteVisitCall.error(
|
|
||||||
(_model.deleteVisit?.jsonBody ?? ''),
|
|
||||||
) ==
|
|
||||||
false) {
|
|
||||||
Navigator.pop(context);
|
|
||||||
} else {
|
|
||||||
await showModalBottomSheet(
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
enableDrag: false,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Padding(
|
|
||||||
padding:
|
|
||||||
MediaQuery.viewInsetsOf(context),
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg: PhpGroup.deleteVisitCall.msg(
|
|
||||||
(_model.deleteVisit?.jsonBody ??
|
|
||||||
''),
|
|
||||||
)!,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
}
|
|
||||||
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
FlutterFlowIconButton(
|
|
||||||
borderColor: Colors.transparent,
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.share,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
log('IconButton pressed ...');
|
|
||||||
// Implement share functionality here
|
|
||||||
Share.share(
|
|
||||||
'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.',
|
|
||||||
);
|
|
||||||
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
} else if ((widget.visitStatusStr == 'C') ||
|
|
||||||
(widget.visitStatusStr == 'F') ||
|
|
||||||
(widget.visitStatusStr == 'B') ||
|
|
||||||
(widget.visitStatusStr == 'I')) {
|
|
||||||
return InkWell(
|
|
||||||
splashColor: Colors.transparent,
|
|
||||||
focusColor: Colors.transparent,
|
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.pop(context);
|
|
||||||
|
|
||||||
context.pushNamed(
|
|
||||||
'scheduleCompleteVisitPage',
|
|
||||||
queryParameters: {
|
|
||||||
'visitStartDateStr': serializeParam(
|
|
||||||
dateTimeFormat(
|
|
||||||
'd/M/y H:mm:ss',
|
|
||||||
getCurrentTimestamp,
|
|
||||||
locale: FFLocalizations.of(context)
|
|
||||||
.languageCode,
|
|
||||||
),
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
'visitEndDateStr': serializeParam(
|
|
||||||
'',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
'visitReasonStr': serializeParam(
|
|
||||||
widget.visitReasonStr,
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
'visitLevelStr': serializeParam(
|
|
||||||
widget.visitLevelStr,
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
'visitTempBol': serializeParam(
|
|
||||||
widget.visitTempStr == 'Sim' ? true : false,
|
|
||||||
ParamType.bool,
|
|
||||||
),
|
|
||||||
'visitObsStr': serializeParam(
|
|
||||||
widget.visitObsStr,
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
'visitorStrList': serializeParam(
|
|
||||||
widget.visitorStrList,
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
'visitorJsonList': serializeParam(
|
|
||||||
filteredVisitorJsonList,
|
|
||||||
ParamType.JSON,
|
|
||||||
isList: true,
|
|
||||||
),
|
|
||||||
}.withoutNulls,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Icon(
|
|
||||||
Icons.repeat,
|
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Container(
|
|
||||||
width: 100.0,
|
|
||||||
height: 100.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.secondaryBackground,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue