refactors on codes

This commit is contained in:
amirrezaghabeli
2025-09-18 10:27:16 +03:30
parent 1242252b25
commit 5689e98a43
18 changed files with 857 additions and 871 deletions
@@ -0,0 +1,66 @@
import 'package:flutter/material.dart';
import 'package:tm_app/core/utils/size_config.dart';
import '../../../core/theme/colors.dart';
import '../../shared/base_button.dart';
import '../strings/liked_tenders_strings.dart';
class LikeFiltersBottomSheet extends StatelessWidget {
const LikeFiltersBottomSheet({super.key});
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 10.0.h()),
Text(
LikedTendersStrings.filter,
style: TextStyle(
fontWeight: FontWeight.w600,
color: AppColors.grey70,
fontSize: 20.0.sp(),
),
),
SizedBox(height: 20.0.h()),
_buildFilterOption('Industry'),
_buildFilterOption('Finance'),
_buildFilterOption('Business'),
_buildFilterOption('IT'),
_buildFilterOption('Software'),
SizedBox(height: 20.0.h()),
BaseButton(
backgroundColor: AppColors.primary2,
borderRadius: 24,
isEnabled: true,
onPressed: () => Navigator.pop(context),
text: 'Apply',
textColor: AppColors.textBlue,
),
],
),
),
);
}
Widget _buildFilterOption(String title) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 8.0.h()),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
title,
style: TextStyle(
fontSize: 16.0.sp(),
color: AppColors.grey80,
fontWeight: FontWeight.w400,
),
),
),
);
}
}
@@ -0,0 +1,73 @@
import 'package:flutter/material.dart';
import 'package:tm_app/core/utils/size_config.dart';
import '../../../core/theme/colors.dart';
import '../../shared/base_button.dart';
import '../strings/liked_tenders_strings.dart';
class LikeFiltersDrawer extends StatelessWidget {
const LikeFiltersDrawer({super.key});
@override
Widget build(BuildContext context) {
return Drawer(
backgroundColor: AppColors.backgroundColor,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 30.0.h()),
Text(
LikedTendersStrings.filter,
style: TextStyle(
fontWeight: FontWeight.w600,
color: AppColors.grey70,
fontSize: 20.0.sp(),
),
),
SizedBox(height: 20.0.h()),
_buildFilterOption('Industry'),
_buildFilterOption('Finance'),
_buildFilterOption('Business'),
_buildFilterOption('IT'),
_buildFilterOption('Software'),
const Spacer(),
BaseButton(
backgroundColor: AppColors.primary2,
borderRadius: 24,
isEnabled: true,
onPressed: () {
Navigator.pop(context);
},
text: LikedTendersStrings.apply,
textColor: AppColors.textBlue,
),
SizedBox(height: 20.0.h()),
],
),
),
);
}
Widget _buildFilterOption(String title) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 8.0.h()),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
title,
style: TextStyle(
fontSize: 16.0.sp(),
color: AppColors.grey80,
fontWeight: FontWeight.w400,
),
),
),
);
}
}
@@ -1,136 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:tm_app/core/constants/assets.dart';
import 'package:tm_app/core/theme/colors.dart';
import 'package:tm_app/core/utils/size_config.dart';
import 'package:tm_app/views/liked_tenders/strings/liked_tenders_strings.dart';
import '../../shared/base_button.dart';
class LikedTendersFilterDrawer extends StatelessWidget {
const LikedTendersFilterDrawer({required this.isTablet, super.key});
final bool isTablet;
@override
Widget build(BuildContext context) {
return isTablet
? IconButton(
icon: SvgPicture.asset(
AssetsManager.filter,
height: 24.0.w(),
width: 24.0.w(),
),
onPressed: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: AppColors.backgroundColor,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width,
maxHeight: MediaQuery.of(context).size.height,
),
builder: (context) {
return SizedBox(
width: double.infinity,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 10.0.h()),
Text(
LikedTendersStrings.filter,
style: TextStyle(
fontWeight: FontWeight.w600,
color: AppColors.grey70,
fontSize: 20.0.sp(),
),
),
SizedBox(height: 20.0.h()),
_buildFilterOption('Industry'),
_buildFilterOption('Finance'),
_buildFilterOption('Business'),
_buildFilterOption('IT'),
_buildFilterOption('Software'),
SizedBox(height: 20.0.h()),
BaseButton(
backgroundColor: AppColors.primary2,
borderRadius: 24,
isEnabled: true,
onPressed: () => Navigator.pop(context),
text: 'Apply',
textColor: AppColors.textBlue,
),
],
),
),
);
},
);
},
)
: Drawer(
backgroundColor: AppColors.backgroundColor,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 30.0.h()),
Text(
LikedTendersStrings.filter,
style: TextStyle(
fontWeight: FontWeight.w600,
color: AppColors.grey70,
fontSize: 20.0.sp(),
),
),
SizedBox(height: 20.0.h()),
_buildFilterOption('Industry'),
_buildFilterOption('Finance'),
_buildFilterOption('Business'),
_buildFilterOption('IT'),
_buildFilterOption('Software'),
const Spacer(),
BaseButton(
backgroundColor: AppColors.primary2,
borderRadius: 24,
isEnabled: true,
onPressed: () {
Navigator.pop(context);
},
text: LikedTendersStrings.apply,
textColor: AppColors.textBlue,
),
SizedBox(height: 20.0.h()),
],
),
),
);
}
Widget _buildFilterOption(String title) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 8.0.h()),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
title,
style: TextStyle(
fontSize: 16.0.sp(),
color: AppColors.grey80,
fontWeight: FontWeight.w400,
),
),
),
);
}
}