import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:tm_app/core/utils/size_config.dart'; import '../../../core/constants/assets.dart'; import '../../../core/theme/colors.dart'; import '../../../data/services/model/profile_data/profile_data.dart'; import '../strings/profile_strings.dart'; import 'theme_toggle.dart'; import 'title_description.dart'; class MainDataTab extends StatelessWidget { const MainDataTab({ required this.profileData, required this.onLogout, super.key, }); final ProfileData profileData; final VoidCallback onLogout; @override Widget build(BuildContext context) { return SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.min, children: [ SizedBox(height: 36.0.h()), Align( alignment: AlignmentDirectional.centerStart, child: Text( 'Last Notification', style: TextStyle( fontSize: 18.0.sp(), fontWeight: FontWeight.w600, color: AppColors.grey70, ), ), ), SizedBox(height: 24.0.h()), TitleDescription( title: ProfileStrings.fullname, description: profileData.fullName ?? '', ), TitleDescription( title: ProfileStrings.username, description: profileData.username ?? '', ), TitleDescription( title: ProfileStrings.email, description: profileData.email ?? '', ), TitleDescription( title: ProfileStrings.phone, description: profileData.phone ?? '', ), TitleDescription( title: ProfileStrings.companyName, description: profileData.companies!.first.name ?? '', ), SizedBox(height: 32.0.h()), Align( alignment: AlignmentDirectional.centerStart, child: Text( ProfileStrings.settings, style: TextStyle( fontSize: 20.0.sp(), fontWeight: FontWeight.w600, color: AppColors.grey70, ), ), ), SizedBox(height: 36.0.h()), _themeChangeRow(), SizedBox(height: 24.0.h()), Divider(color: AppColors.dividerColor, thickness: 1), SizedBox(height: 24.0.h()), InkWell( onTap: onLogout, borderRadius: BorderRadius.circular(100), child: Container( width: double.infinity, height: 56.0.h(), decoration: BoxDecoration( color: AppColors.primary20, borderRadius: BorderRadius.circular(100), ), alignment: Alignment.center, child: Text( ProfileStrings.logout, style: TextStyle( fontSize: 14.0.sp(), fontWeight: FontWeight.w500, color: AppColors.primaryColor, ), ), ), ), SizedBox(height: 24.0.h()), Text( ProfileStrings.appVersion, style: TextStyle( fontSize: 12.0.sp(), fontWeight: FontWeight.w400, color: AppColors.grey70, ), ), ], ), ); } Widget _themeChangeRow() { return Padding( padding: EdgeInsets.symmetric(horizontal: 8.0.w()), child: Row( children: [ Text( ProfileStrings.appTheme, style: TextStyle( fontSize: 16.0.sp(), fontWeight: FontWeight.w400, color: AppColors.grey70, ), ), const Spacer(), SvgPicture.asset(AssetsManager.sun), SizedBox(width: 12.0.w()), SizedBox( width: 52.0.w(), height: 32.0.h(), child: const ThemeToggle(), ), SizedBox(width: 12.0.w()), SvgPicture.asset(AssetsManager.moon), ], ), ); } }