submission dialog for tablet and web

This commit is contained in:
amirrezaghabeli
2025-08-27 09:05:18 +03:30
parent 5aab723ffd
commit 89668fd2f1
4 changed files with 183 additions and 19 deletions
@@ -0,0 +1,144 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:tm_app/core/utils/size_config.dart';
import '../../core/theme/colors.dart';
class SelectSubmissionDialog extends StatefulWidget {
const SelectSubmissionDialog({required this.onConfirm, super.key});
final ValueChanged<String> onConfirm;
@override
State<SelectSubmissionDialog> createState() => _SelectSubmissionDialogState();
}
class _SelectSubmissionDialogState extends State<SelectSubmissionDialog> {
int selectedType = 0;
String type = 'self-apply';
@override
Widget build(BuildContext context) {
return Dialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: BorderSide.none,
),
child: Container(
width: 560,
height: 300,
padding: EdgeInsets.symmetric(horizontal: 24.0.w(), vertical: 16.0.h()),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Text(
'Select Submission',
style: TextStyle(
fontSize: 20.0.sp(),
fontWeight: FontWeight.w600,
color: AppColors.grey70,
),
),
SizedBox(height: 8.0.h()),
_submissionType(
title: 'self-apply',
isSelected: type == 'self-apply',
onTap: () {
selectedType = 0;
type = 'self-apply';
setState(() {});
},
),
SizedBox(height: 8.0.h()),
_submissionType(
title: 'Partnership',
isSelected: type == 'partnership',
onTap: () {
selectedType = 1;
type = 'partnership';
setState(() {});
},
),
SizedBox(height: 8.0.h()),
Align(
alignment: Alignment.centerRight,
child: InkWell(
onTap: () {
widget.onConfirm(type);
context.pop();
},
child: Container(
width: 150,
height: 56.0,
decoration: BoxDecoration(
color: AppColors.primary20,
borderRadius: BorderRadius.circular(100),
),
alignment: Alignment.center,
child: Text(
'Confirm',
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.mainBlue,
),
),
),
),
),
],
),
),
);
}
Widget _submissionType({
required VoidCallback onTap,
required String title,
required bool isSelected,
}) {
return InkWell(
onTap: onTap,
child: SizedBox(
width: double.infinity,
height: 56.0.h(),
child: Row(
children: [
Container(
width: 20.0.w(),
height: 20.0.w(),
margin: EdgeInsets.symmetric(
horizontal: 10.0.w(),
vertical: 10.0.h(),
),
padding: EdgeInsets.all(3),
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
color: isSelected ? AppColors.mainBlue : AppColors.grey70,
width: 2.0,
),
),
alignment: Alignment.center,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: isSelected ? AppColors.mainBlue : Colors.transparent,
),
),
),
Text(
title,
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey80,
),
),
],
),
),
);
}
}