163 lines
5.8 KiB
Dart
163 lines
5.8 KiB
Dart
import 'package:hub/commons/actions/api_calls.dart';
|
|
import 'package:hub/commons/actions/api_manager.dart';
|
|
|
|
import '/commons/widgets/flutter_flow_icon_button.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:flutter_spinkit/flutter_spinkit.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'model.dart';
|
|
export 'model.dart';
|
|
|
|
class PeopleOnThePropertyPageWidget extends StatefulWidget {
|
|
const PeopleOnThePropertyPageWidget({super.key});
|
|
|
|
@override
|
|
State<PeopleOnThePropertyPageWidget> createState() =>
|
|
_PeopleOnThePropertyPageWidgetState();
|
|
}
|
|
|
|
class _PeopleOnThePropertyPageWidgetState
|
|
extends State<PeopleOnThePropertyPageWidget> {
|
|
late PeopleOnThePropertyPageModel _model;
|
|
|
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_model = createModel(context, () => PeopleOnThePropertyPageModel());
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_model.dispose();
|
|
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
context.watch<FFAppState>();
|
|
|
|
return Scaffold(
|
|
key: scaffoldKey,
|
|
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).getText(
|
|
'nsu13r5d' /* Pessoas na Propriedade */,
|
|
),
|
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
|
fontFamily: 'Nunito',
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
fontSize: 15.0,
|
|
letterSpacing: 0.0,
|
|
fontWeight: FontWeight.bold,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
|
),
|
|
),
|
|
actions: const [],
|
|
centerTitle: true,
|
|
elevation: 0.0,
|
|
),
|
|
body: SafeArea(
|
|
top: true,
|
|
child: FutureBuilder<ApiCallResponse>(
|
|
future: PhpGroup.getPessoasLocalCall.call(
|
|
cliID: FFAppState().cliUUID,
|
|
ownID: FFAppState().ownerUUID,
|
|
devUUID: FFAppState().devUUID,
|
|
userUUID: FFAppState().userUUID,
|
|
),
|
|
builder: (context, snapshot) {
|
|
// Customize what your widget looks like when it's loading.
|
|
if (!snapshot.hasData) {
|
|
return Center(
|
|
child: SizedBox(
|
|
width: 50.0,
|
|
height: 50.0,
|
|
child: SpinKitCircle(
|
|
color: FlutterFlowTheme.of(context).primary,
|
|
size: 50.0,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
final columnGetPessoasLocalResponse = snapshot.data!;
|
|
final getPoepleProperty = PhpGroup.getPessoasLocalCall.pessoas(columnGetPessoasLocalResponse.jsonBody,)?.toList() ??
|
|
[];
|
|
return ListView.builder(
|
|
physics: const AlwaysScrollableScrollPhysics(),
|
|
shrinkWrap: true,
|
|
itemCount: getPoepleProperty.length,
|
|
itemBuilder: (context, index) {
|
|
final getPoeplePropertyItem = getPoepleProperty[index];
|
|
return Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(4.0),
|
|
child: Container(
|
|
width: 50.0,
|
|
height: 50.0,
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: const BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
),
|
|
child: CachedNetworkImage(
|
|
fadeInDuration: const Duration(milliseconds: 500),
|
|
fadeOutDuration: const Duration(milliseconds: 500),
|
|
imageUrl:
|
|
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
),
|
|
Text(
|
|
getJsonField(
|
|
getPoeplePropertyItem,
|
|
r'''$.USU_NOME''',
|
|
).toString(),
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
fontSize: 14.0,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
),
|
|
),
|
|
]
|
|
.divide(const SizedBox(width: 20.0))
|
|
.addToStart(const SizedBox(width: 40.0)),
|
|
);
|
|
},
|
|
);
|
|
},
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|