passo_mobile_app/lib/screens/profile/components/references_screen.dart

57 lines
2.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/references.dart';
import 'package:unit2/theme-data.dart/colors.dart';
class ReferencesScreen extends StatefulWidget {
final List<PersonalReference> references;
const ReferencesScreen({super.key, required this.references});
@override
State<ReferencesScreen> createState() => _ReferencesScreenState();
}
class _ReferencesScreenState extends State<ReferencesScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("Personal References"),centerTitle: true,backgroundColor: primary,),
body: ListView.builder(
itemCount: widget.references.length,
itemBuilder: (BuildContext context, int index){
String fullname = "${widget.references[0].firstName} ${widget.references[0].middleName} ${widget.references[0].lastName}";
String addres = "${widget.references[0].address!.cityMunicipality!.description}, ${widget.references[0].address!.cityMunicipality!.province!.description}, ${widget.references[0].address!.cityMunicipality!.province!.region!.description}";
String mobile = widget.references[0].contactNo.toString();
return Column(children: [
Container(
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8),
decoration: BoxDecoration(
color: Colors.grey[200],
borderRadius: const BorderRadius.all(Radius.circular(12))),
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(fullname,style: Theme.of(context).textTheme.titleLarge!.copyWith(fontWeight: FontWeight.bold)),
const SizedBox(height: 5,),
Text(addres,style: Theme.of(context).textTheme.labelLarge!.copyWith(fontWeight: FontWeight.bold)),
const SizedBox(height: 8,),
Text("PHONE / MOBILE NUMBER $mobile",style: Theme.of(context).textTheme.labelSmall!.copyWith(fontWeight: FontWeight.bold)),
],),
),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert))
],
),
),
const SizedBox(height: 8,),
],);
}) ,
);
}
}