feat: update UI components for improved consistency and add tab indicator styling
This commit is contained in:
parent
a0f1602f4e
commit
83ad10ffb4
@ -4,6 +4,7 @@ import 'package:marco/helpers/widgets/my_snackbar.dart';
|
||||
import 'package:marco/helpers/services/app_logger.dart';
|
||||
|
||||
class LauncherUtils {
|
||||
/// Launches the phone dialer with the provided phone number
|
||||
static Future<void> launchPhone(String phoneNumber) async {
|
||||
logSafe('Attempting to launch phone: $phoneNumber', sensitive: true);
|
||||
|
||||
@ -11,6 +12,7 @@ class LauncherUtils {
|
||||
await _tryLaunch(url, 'Could not launch phone');
|
||||
}
|
||||
|
||||
/// Launches the email app with the provided email address
|
||||
static Future<void> launchEmail(String email) async {
|
||||
logSafe('Attempting to launch email: $email', sensitive: true);
|
||||
|
||||
@ -18,9 +20,9 @@ class LauncherUtils {
|
||||
await _tryLaunch(url, 'Could not launch email');
|
||||
}
|
||||
|
||||
/// Launches WhatsApp with the provided phone number
|
||||
static Future<void> launchWhatsApp(String phoneNumber) async {
|
||||
logSafe('Attempting to launch WhatsApp with: $phoneNumber',
|
||||
sensitive: true);
|
||||
logSafe('Attempting to launch WhatsApp with: $phoneNumber', sensitive: true);
|
||||
|
||||
String normalized = phoneNumber.replaceAll(RegExp(r'\D'), '');
|
||||
if (!normalized.startsWith('91')) {
|
||||
@ -43,8 +45,8 @@ class LauncherUtils {
|
||||
await _tryLaunch(url, 'Could not open WhatsApp');
|
||||
}
|
||||
|
||||
static Future<void> copyToClipboard(String text,
|
||||
{required String typeLabel}) async {
|
||||
/// Copies text to clipboard with feedback
|
||||
static Future<void> copyToClipboard(String text, {required String typeLabel}) async {
|
||||
try {
|
||||
logSafe('Copying "$typeLabel" to clipboard');
|
||||
|
||||
@ -56,9 +58,12 @@ class LauncherUtils {
|
||||
type: SnackbarType.success,
|
||||
);
|
||||
} catch (e, st) {
|
||||
logSafe('Failed to copy $typeLabel to clipboard: $e',
|
||||
stackTrace: st, level: LogLevel.error, sensitive: true);
|
||||
|
||||
logSafe(
|
||||
'Failed to copy $typeLabel to clipboard: $e',
|
||||
stackTrace: st,
|
||||
level: LogLevel.error,
|
||||
sensitive: true,
|
||||
);
|
||||
showAppSnackbar(
|
||||
title: 'Error',
|
||||
message: 'Failed to copy $typeLabel',
|
||||
@ -67,17 +72,23 @@ class LauncherUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/// Internal function to launch a URL and show error if failed
|
||||
static Future<void> _tryLaunch(Uri url, String errorMsg) async {
|
||||
try {
|
||||
logSafe('Trying to launch URL: ${url.toString()}');
|
||||
|
||||
if (await canLaunchUrl(url)) {
|
||||
await launchUrl(url, mode: LaunchMode.externalApplication);
|
||||
final bool launched = await launchUrl(
|
||||
url,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
|
||||
if (launched) {
|
||||
logSafe('URL launched successfully: ${url.toString()}');
|
||||
} else {
|
||||
logSafe(
|
||||
'Launch failed - canLaunchUrl returned false: ${url.toString()}',
|
||||
level: LogLevel.warning);
|
||||
'launchUrl returned false: ${url.toString()}',
|
||||
level: LogLevel.warning,
|
||||
);
|
||||
showAppSnackbar(
|
||||
title: 'Error',
|
||||
message: errorMsg,
|
||||
@ -85,9 +96,11 @@ class LauncherUtils {
|
||||
);
|
||||
}
|
||||
} catch (e, st) {
|
||||
logSafe('Exception during launch of ${url.toString()}: $e',
|
||||
stackTrace: st, level: LogLevel.error);
|
||||
|
||||
logSafe(
|
||||
'Exception during launch of ${url.toString()}: $e',
|
||||
stackTrace: st,
|
||||
level: LogLevel.error,
|
||||
);
|
||||
showAppSnackbar(
|
||||
title: 'Error',
|
||||
message: '$errorMsg: $e',
|
||||
|
@ -71,52 +71,62 @@ class _AttendanceScreenState extends State<AttendanceScreen> with UIMixin {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(80),
|
||||
preferredSize: const Size.fromHeight(72),
|
||||
child: AppBar(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
elevation: 0.5,
|
||||
foregroundColor: Colors.black,
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0),
|
||||
child: IconButton(
|
||||
title: Padding(
|
||||
padding: MySpacing.xy(16, 0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new,
|
||||
color: Colors.black, size: 20),
|
||||
onPressed: () {
|
||||
Get.offNamed('/dashboard');
|
||||
},
|
||||
onPressed: () => Get.offNamed('/dashboard'),
|
||||
),
|
||||
),
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0),
|
||||
MySpacing.width(8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
MyText.titleLarge(
|
||||
'Attendance',
|
||||
fontWeight: 700,
|
||||
color: Colors.black,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
MySpacing.height(2),
|
||||
GetBuilder<ProjectController>(
|
||||
builder: (projectController) {
|
||||
final projectName =
|
||||
projectController.selectedProject?.name ??
|
||||
'Select Project';
|
||||
return MyText.bodySmall(
|
||||
return Row(
|
||||
children: [
|
||||
const Icon(Icons.work_outline,
|
||||
size: 14, color: Colors.grey),
|
||||
MySpacing.width(4),
|
||||
Expanded(
|
||||
child: MyText.bodySmall(
|
||||
projectName,
|
||||
fontWeight: 600,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:marco/controller/project_controller.dart';
|
||||
import 'package:marco/controller/directory/directory_controller.dart';
|
||||
import 'package:marco/helpers/widgets/my_spacing.dart';
|
||||
@ -8,94 +9,115 @@ import 'package:marco/helpers/widgets/my_text.dart';
|
||||
import 'package:marco/model/directory/contact_model.dart';
|
||||
import 'package:marco/helpers/widgets/avatar.dart';
|
||||
import 'package:marco/helpers/utils/launcher_utils.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:tab_indicator_styler/tab_indicator_styler.dart';
|
||||
|
||||
class ContactDetailScreen extends StatelessWidget {
|
||||
final ContactModel contact;
|
||||
|
||||
const ContactDetailScreen({super.key, required this.contact});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final directoryController = Get.find<DirectoryController>();
|
||||
final projectController = Get.find<ProjectController>();
|
||||
|
||||
Future.microtask(() {
|
||||
if (!directoryController.contactCommentsMap.containsKey(contact.id)) {
|
||||
directoryController.fetchCommentsForContact(contact.id);
|
||||
}
|
||||
});
|
||||
final email = contact.contactEmails.isNotEmpty
|
||||
? contact.contactEmails.first.emailAddress
|
||||
: "-";
|
||||
final phone = contact.contactPhones.isNotEmpty
|
||||
? contact.contactPhones.first.phoneNumber
|
||||
: "-";
|
||||
final createdDate = DateTime.now();
|
||||
final formattedDate = DateFormat('MMMM dd, yyyy').format(createdDate);
|
||||
final tags = contact.tags.map((e) => e.name).join(", ");
|
||||
final bucketNames = contact.bucketIds
|
||||
.map((id) => directoryController.contactBuckets
|
||||
.firstWhereOrNull((b) => b.id == id)
|
||||
?.name)
|
||||
.whereType<String>()
|
||||
.join(", ");
|
||||
final projectNames = contact.projectIds
|
||||
?.map((id) => projectController.projects
|
||||
.firstWhereOrNull((p) => p.id == id)
|
||||
?.name)
|
||||
.whereType<String>()
|
||||
.join(", ") ??
|
||||
"-";
|
||||
final category = contact.contactCategory?.name ?? "-";
|
||||
|
||||
return DefaultTabController(
|
||||
length: 2,
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(170),
|
||||
child: AppBar(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
elevation: 0.5,
|
||||
automaticallyImplyLeading: false,
|
||||
flexibleSpace: SafeArea(
|
||||
child: Padding(
|
||||
padding: MySpacing.xy(10, 12),
|
||||
appBar: _buildMainAppBar(projectController),
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Back button and title
|
||||
Row(
|
||||
_buildSubHeader(),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
children: [
|
||||
_buildDetailsTab(directoryController, projectController),
|
||||
_buildCommentsTab(directoryController),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
PreferredSizeWidget _buildMainAppBar(ProjectController projectController) {
|
||||
return AppBar(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
elevation: 0.2,
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
title: Padding(
|
||||
padding: MySpacing.xy(16, 0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new,
|
||||
color: Colors.black, size: 20),
|
||||
onPressed: () => Get.back(),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Column(
|
||||
MySpacing.width(8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
MyText.titleLarge('Contact Profile',
|
||||
fontWeight: 700, color: Colors.black),
|
||||
const SizedBox(height: 2),
|
||||
MyText.titleLarge(
|
||||
'Contact Profile',
|
||||
fontWeight: 700,
|
||||
color: Colors.black,
|
||||
),
|
||||
MySpacing.height(2),
|
||||
GetBuilder<ProjectController>(
|
||||
builder: (_) {
|
||||
builder: (projectController) {
|
||||
final projectName =
|
||||
projectController.selectedProject?.name ??
|
||||
'Select Project';
|
||||
return MyText.bodySmall(
|
||||
return Row(
|
||||
children: [
|
||||
const Icon(Icons.work_outline,
|
||||
size: 14, color: Colors.grey),
|
||||
MySpacing.width(4),
|
||||
Expanded(
|
||||
child: MyText.bodySmall(
|
||||
projectName,
|
||||
fontWeight: 600,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
// Avatar + name + org
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSubHeader() {
|
||||
return Padding(
|
||||
padding: MySpacing.xy(16, 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Avatar(
|
||||
firstName: contact.name.split(" ").first,
|
||||
@ -105,105 +127,118 @@ class ContactDetailScreen extends StatelessWidget {
|
||||
size: 35,
|
||||
backgroundColor: Colors.indigo,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
MySpacing.width(12),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
MyText.titleSmall(
|
||||
contact.name,
|
||||
fontWeight: 600,
|
||||
color: Colors.black,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
MyText.titleSmall(
|
||||
contact.organization,
|
||||
fontWeight: 500,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
MyText.titleSmall(contact.name,
|
||||
fontWeight: 600, color: Colors.black),
|
||||
MySpacing.height(2),
|
||||
MyText.bodySmall(contact.organization,
|
||||
fontWeight: 500, color: Colors.grey[700]),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 6),
|
||||
|
||||
// Tab Bar
|
||||
const TabBar(
|
||||
indicatorColor: Colors.indigo,
|
||||
TabBar(
|
||||
labelColor: Colors.indigo,
|
||||
unselectedLabelColor: Colors.grey,
|
||||
tabs: [
|
||||
indicator: MaterialIndicator(
|
||||
color: Colors.indigo,
|
||||
height: 4,
|
||||
topLeftRadius: 8,
|
||||
topRightRadius: 8,
|
||||
bottomLeftRadius: 8,
|
||||
bottomRightRadius: 8,
|
||||
),
|
||||
tabs: const [
|
||||
Tab(text: "Details"),
|
||||
Tab(text: "Comments"),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
// Details Tab
|
||||
SingleChildScrollView(
|
||||
padding: MySpacing.xy(9, 10),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDetailsTab(DirectoryController directoryController,
|
||||
ProjectController projectController) {
|
||||
final email = contact.contactEmails.isNotEmpty
|
||||
? contact.contactEmails.first.emailAddress
|
||||
: "-";
|
||||
|
||||
final phone = contact.contactPhones.isNotEmpty
|
||||
? contact.contactPhones.first.phoneNumber
|
||||
: "-";
|
||||
|
||||
final createdDate = DateTime.now();
|
||||
final formattedDate = DateFormat('MMMM dd, yyyy').format(createdDate);
|
||||
final tags = contact.tags.map((e) => e.name).join(", ");
|
||||
|
||||
final bucketNames = contact.bucketIds
|
||||
.map((id) => directoryController.contactBuckets
|
||||
.firstWhereOrNull((b) => b.id == id)
|
||||
?.name)
|
||||
.whereType<String>()
|
||||
.join(", ");
|
||||
|
||||
final projectNames = contact.projectIds
|
||||
?.map((id) => projectController.projects
|
||||
.firstWhereOrNull((p) => p.id == id)
|
||||
?.name)
|
||||
.whereType<String>()
|
||||
.join(", ") ??
|
||||
"-";
|
||||
|
||||
final category = contact.contactCategory?.name ?? "-";
|
||||
|
||||
return SingleChildScrollView(
|
||||
padding: MySpacing.xy(8, 8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_infoCard("Basic Info", [
|
||||
_iconInfoRow(
|
||||
Icons.email,
|
||||
"Email",
|
||||
email,
|
||||
_iconInfoRow(Icons.email, "Email", email,
|
||||
onTap: () => LauncherUtils.launchEmail(email),
|
||||
onLongPress: () => LauncherUtils.copyToClipboard(email,
|
||||
typeLabel: "Email"),
|
||||
),
|
||||
_iconInfoRow(
|
||||
Icons.phone,
|
||||
"Phone",
|
||||
phone,
|
||||
onLongPress: () =>
|
||||
LauncherUtils.copyToClipboard(email, typeLabel: "Email")),
|
||||
_iconInfoRow(Icons.phone, "Phone", phone,
|
||||
onTap: () => LauncherUtils.launchPhone(phone),
|
||||
onLongPress: () => LauncherUtils.copyToClipboard(phone,
|
||||
typeLabel: "Phone"),
|
||||
),
|
||||
_iconInfoRow(
|
||||
Icons.calendar_today, "Created", formattedDate),
|
||||
onLongPress: () =>
|
||||
LauncherUtils.copyToClipboard(phone, typeLabel: "Phone")),
|
||||
_iconInfoRow(Icons.calendar_today, "Created", formattedDate),
|
||||
_iconInfoRow(Icons.location_on, "Address", contact.address),
|
||||
]),
|
||||
_infoCard("Organization", [
|
||||
_iconInfoRow(
|
||||
Icons.business, "Organization", contact.organization),
|
||||
_iconInfoRow(Icons.business, "Organization", contact.organization),
|
||||
_iconInfoRow(Icons.category, "Category", category),
|
||||
]),
|
||||
_infoCard("Meta Info", [
|
||||
_iconInfoRow(
|
||||
Icons.label, "Tags", tags.isNotEmpty ? tags : "-"),
|
||||
_iconInfoRow(Icons.folder_shared, "Contat Buckets",
|
||||
_iconInfoRow(Icons.label, "Tags", tags.isNotEmpty ? tags : "-"),
|
||||
_iconInfoRow(Icons.folder_shared, "Contact Buckets",
|
||||
bucketNames.isNotEmpty ? bucketNames : "-"),
|
||||
_iconInfoRow(Icons.work_outline, "Projects", projectNames),
|
||||
]),
|
||||
_infoCard("Description", [
|
||||
const SizedBox(height: 6),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
MySpacing.height(6),
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: MyText.bodyMedium(
|
||||
contact.description,
|
||||
color: Colors.grey[800],
|
||||
maxLines: 10,
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
]),
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Comments Tab
|
||||
// Improved Comments Tab
|
||||
Obx(() {
|
||||
final comments =
|
||||
directoryController.contactCommentsMap[contact.id];
|
||||
Widget _buildCommentsTab(DirectoryController directoryController) {
|
||||
return Obx(() {
|
||||
final comments = directoryController.contactCommentsMap[contact.id];
|
||||
|
||||
if (comments == null) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
@ -211,15 +246,13 @@ class ContactDetailScreen extends StatelessWidget {
|
||||
|
||||
if (comments.isEmpty) {
|
||||
return Center(
|
||||
child:
|
||||
MyText.bodyLarge("No comments yet.", color: Colors.grey),
|
||||
);
|
||||
child: MyText.bodyLarge("No comments yet.", color: Colors.grey));
|
||||
}
|
||||
|
||||
return ListView.separated(
|
||||
padding: MySpacing.xy(12, 16),
|
||||
padding: MySpacing.xy(8, 8),
|
||||
itemCount: comments.length,
|
||||
separatorBuilder: (_, __) => const SizedBox(height: 12),
|
||||
separatorBuilder: (_, __) => MySpacing.height(12),
|
||||
itemBuilder: (_, index) {
|
||||
final comment = comments[index];
|
||||
final initials = comment.createdBy.firstName.isNotEmpty
|
||||
@ -242,26 +275,17 @@ class ContactDetailScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Avatar + By + Date Row at top
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Avatar(
|
||||
firstName: initials,
|
||||
lastName: '',
|
||||
size: 31,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Avatar(firstName: initials, lastName: '', size: 31),
|
||||
MySpacing.width(8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
MyText.bodySmall(
|
||||
"By: ${comment.createdBy.firstName}",
|
||||
fontWeight: 600,
|
||||
color: Colors.indigo[700],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
MyText.bodySmall("By: ${comment.createdBy.firstName}",
|
||||
fontWeight: 600, color: Colors.indigo[700]),
|
||||
MySpacing.height(2),
|
||||
MyText.bodySmall(
|
||||
DateFormat('dd MMM yyyy, hh:mm a')
|
||||
.format(comment.createdAt),
|
||||
@ -280,10 +304,7 @@ class ContactDetailScreen extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 10),
|
||||
|
||||
// Comment content
|
||||
MySpacing.height(10),
|
||||
Html(
|
||||
data: comment.note,
|
||||
style: {
|
||||
@ -305,12 +326,8 @@ class ContactDetailScreen extends StatelessWidget {
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.indigo[700],
|
||||
),
|
||||
"strong": Style(
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
"p": Style(
|
||||
margin: Margins.only(bottom: 8),
|
||||
),
|
||||
"strong": Style(fontWeight: FontWeight.w700),
|
||||
"p": Style(margin: Margins.only(bottom: 8)),
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -318,17 +335,13 @@ class ContactDetailScreen extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _iconInfoRow(IconData icon, String label, String value,
|
||||
{VoidCallback? onTap, VoidCallback? onLongPress}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
padding: MySpacing.y(8),
|
||||
child: GestureDetector(
|
||||
onTap: onTap,
|
||||
onLongPress: onLongPress,
|
||||
@ -336,14 +349,14 @@ class ContactDetailScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Icon(icon, size: 22, color: Colors.indigo),
|
||||
const SizedBox(width: 12),
|
||||
MySpacing.width(12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
MyText.bodySmall(label,
|
||||
fontWeight: 600, color: Colors.black87),
|
||||
const SizedBox(height: 2),
|
||||
MySpacing.height(2),
|
||||
MyText.bodyMedium(value, color: Colors.grey[800]),
|
||||
],
|
||||
),
|
||||
@ -358,7 +371,7 @@ class ContactDetailScreen extends StatelessWidget {
|
||||
return Card(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
elevation: 2,
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
margin: MySpacing.bottom(12),
|
||||
child: Padding(
|
||||
padding: MySpacing.xy(16, 16),
|
||||
child: Column(
|
||||
@ -366,7 +379,7 @@ class ContactDetailScreen extends StatelessWidget {
|
||||
children: [
|
||||
MyText.titleSmall(title,
|
||||
fontWeight: 700, color: Colors.indigo[700]),
|
||||
const SizedBox(height: 8),
|
||||
MySpacing.height(8),
|
||||
...children,
|
||||
],
|
||||
),
|
||||
|
@ -33,52 +33,62 @@ class DirectoryMainScreen extends StatelessWidget {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(80),
|
||||
preferredSize: const Size.fromHeight(72),
|
||||
child: AppBar(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
elevation: 0.5,
|
||||
foregroundColor: Colors.black,
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0),
|
||||
child: IconButton(
|
||||
title: Padding(
|
||||
padding: MySpacing.xy(16, 0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new,
|
||||
color: Colors.black, size: 20),
|
||||
onPressed: () {
|
||||
Get.offNamed('/dashboard');
|
||||
},
|
||||
onPressed: () => Get.offNamed('/dashboard'),
|
||||
),
|
||||
),
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0),
|
||||
MySpacing.width(8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
MyText.titleLarge(
|
||||
'Directory',
|
||||
fontWeight: 700,
|
||||
color: Colors.black,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
MySpacing.height(2),
|
||||
GetBuilder<ProjectController>(
|
||||
builder: (projectController) {
|
||||
final projectName =
|
||||
projectController.selectedProject?.name ??
|
||||
'Select Project';
|
||||
return MyText.bodySmall(
|
||||
return Row(
|
||||
children: [
|
||||
const Icon(Icons.work_outline,
|
||||
size: 14, color: Colors.grey),
|
||||
MySpacing.width(4),
|
||||
Expanded(
|
||||
child: MyText.bodySmall(
|
||||
projectName,
|
||||
fontWeight: 600,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
@ -366,7 +376,7 @@ class DirectoryMainScreen extends StatelessWidget {
|
||||
padding:
|
||||
EdgeInsets.only(right: 8.0),
|
||||
child: Icon(Icons.email_outlined,
|
||||
color: Colors.blue, size: 20),
|
||||
color: Colors.blue, size: 25),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@ -378,7 +388,7 @@ class DirectoryMainScreen extends StatelessWidget {
|
||||
LauncherUtils.copyToClipboard(
|
||||
email,
|
||||
typeLabel: 'Email'),
|
||||
child: MyText.bodySmall(
|
||||
child: MyText.bodyMedium(
|
||||
email,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@ -408,7 +418,7 @@ class DirectoryMainScreen extends StatelessWidget {
|
||||
child: const Icon(
|
||||
Icons.phone_outlined,
|
||||
color: Colors.blue,
|
||||
size: 20),
|
||||
size: 25),
|
||||
),
|
||||
),
|
||||
|
||||
@ -421,7 +431,7 @@ class DirectoryMainScreen extends StatelessWidget {
|
||||
LauncherUtils.copyToClipboard(
|
||||
phone,
|
||||
typeLabel: 'Phone number'),
|
||||
child: MyText.bodySmall(
|
||||
child: MyText.bodyMedium(
|
||||
phone,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@ -445,7 +455,7 @@ class DirectoryMainScreen extends StatelessWidget {
|
||||
child: const FaIcon(
|
||||
FontAwesomeIcons.whatsapp,
|
||||
color: Colors.green,
|
||||
size: 18),
|
||||
size: 25),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -15,6 +15,7 @@ import 'package:marco/helpers/widgets/avatar.dart';
|
||||
import 'package:marco/model/employees/employee_detail_bottom_sheet.dart';
|
||||
import 'package:marco/controller/project_controller.dart';
|
||||
import 'package:marco/helpers/widgets/my_custom_skeleton.dart';
|
||||
|
||||
class EmployeesScreen extends StatefulWidget {
|
||||
const EmployeesScreen({super.key});
|
||||
|
||||
@ -74,52 +75,62 @@ class _EmployeesScreenState extends State<EmployeesScreen> with UIMixin {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(80),
|
||||
preferredSize: const Size.fromHeight(72),
|
||||
child: AppBar(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
elevation: 0.5,
|
||||
foregroundColor: Colors.black,
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0), // Aligns with title
|
||||
child: IconButton(
|
||||
title: Padding(
|
||||
padding: MySpacing.xy(16, 0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new,
|
||||
color: Colors.black, size: 20),
|
||||
onPressed: () {
|
||||
Get.offNamed('/dashboard');
|
||||
},
|
||||
onPressed: () => Get.offNamed('/dashboard'),
|
||||
),
|
||||
),
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0),
|
||||
MySpacing.width(8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
MyText.titleLarge(
|
||||
'Employees',
|
||||
fontWeight: 700,
|
||||
color: Colors.black,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
MySpacing.height(2),
|
||||
GetBuilder<ProjectController>(
|
||||
builder: (projectController) {
|
||||
final projectName =
|
||||
projectController.selectedProject?.name ??
|
||||
'Select Project';
|
||||
return MyText.bodySmall(
|
||||
return Row(
|
||||
children: [
|
||||
const Icon(Icons.work_outline,
|
||||
size: 14, color: Colors.grey),
|
||||
MySpacing.width(4),
|
||||
Expanded(
|
||||
child: MyText.bodySmall(
|
||||
projectName,
|
||||
fontWeight: 600,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
floatingActionButton: InkWell(
|
||||
|
@ -67,52 +67,62 @@ class _DailyProgressReportScreenState extends State<DailyProgressReportScreen>
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(80),
|
||||
preferredSize: const Size.fromHeight(72),
|
||||
child: AppBar(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
elevation: 0.5,
|
||||
foregroundColor: Colors.black,
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0), // Aligns with title
|
||||
child: IconButton(
|
||||
title: Padding(
|
||||
padding: MySpacing.xy(16, 0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new,
|
||||
color: Colors.black, size: 20),
|
||||
onPressed: () {
|
||||
Get.offNamed('/dashboard');
|
||||
},
|
||||
onPressed: () => Get.offNamed('/dashboard'),
|
||||
),
|
||||
),
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0),
|
||||
MySpacing.width(8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
MyText.titleLarge(
|
||||
'Daily Task Progress',
|
||||
fontWeight: 700,
|
||||
color: Colors.black,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
MySpacing.height(2),
|
||||
GetBuilder<ProjectController>(
|
||||
builder: (projectController) {
|
||||
final projectName =
|
||||
projectController.selectedProject?.name ??
|
||||
'Select Project';
|
||||
return MyText.bodySmall(
|
||||
return Row(
|
||||
children: [
|
||||
const Icon(Icons.work_outline,
|
||||
size: 14, color: Colors.grey),
|
||||
MySpacing.width(4),
|
||||
Expanded(
|
||||
child: MyText.bodySmall(
|
||||
projectName,
|
||||
fontWeight: 600,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
|
@ -53,52 +53,62 @@ class _DailyTaskPlaningScreenState extends State<DailyTaskPlaningScreen>
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(80),
|
||||
preferredSize: const Size.fromHeight(72),
|
||||
child: AppBar(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
elevation: 0.5,
|
||||
foregroundColor: Colors.black,
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0), // Aligns with title
|
||||
child: IconButton(
|
||||
title: Padding(
|
||||
padding: MySpacing.xy(16, 0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new,
|
||||
color: Colors.black, size: 20),
|
||||
onPressed: () {
|
||||
Get.offNamed('/dashboard');
|
||||
},
|
||||
onPressed: () => Get.offNamed('/dashboard'),
|
||||
),
|
||||
),
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0),
|
||||
MySpacing.width(8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
MyText.titleLarge(
|
||||
'Daily Task Planning',
|
||||
'Daily Task Planing',
|
||||
fontWeight: 700,
|
||||
color: Colors.black,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
MySpacing.height(2),
|
||||
GetBuilder<ProjectController>(
|
||||
builder: (projectController) {
|
||||
final projectName =
|
||||
projectController.selectedProject?.name ??
|
||||
'Select Project';
|
||||
return MyText.bodySmall(
|
||||
return Row(
|
||||
children: [
|
||||
const Icon(Icons.work_outline,
|
||||
size: 14, color: Colors.grey),
|
||||
MySpacing.width(4),
|
||||
Expanded(
|
||||
child: MyText.bodySmall(
|
||||
projectName,
|
||||
fontWeight: 600,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
|
@ -73,6 +73,7 @@ dependencies:
|
||||
jwt_decoder: ^2.0.1
|
||||
font_awesome_flutter: ^10.8.0
|
||||
flutter_html: ^3.0.0
|
||||
tab_indicator_styler: ^2.0.0
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
Loading…
x
Reference in New Issue
Block a user