Skip to content
Snippets Groups Projects
Commit d06e4e93 authored by Rakshitha Salian's avatar Rakshitha Salian
Browse files

Refractor code

parent feb9f5bf
No related branches found
No related tags found
1 merge request!2Verify OTP screen- FE -ECAP1-24
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../app_text.dart';
import '../../res/app_color_text_size.dart';
Future<dynamic> verificationSuccess(
{required BuildContext context,
required String assetName,
required String title,
required String subtitle}) {
return Get.dialog(
barrierDismissible: false,
barrierColor: AppColor.black.withOpacity(0.5),
Center(
child: SingleChildScrollView(
child: AlertDialog(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(12.0))),
backgroundColor: AppColor.white,
contentPadding: EdgeInsets.zero,
content: Padding(
padding: EdgeInsets.all(24.0.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
assetName,
width: 64,
height: 64,
),
AppText(
text: title,
fontSize: TextSize.textSubHeadingSize,
fontWeight: FontWeight.w500,
textColor: AppColor.slateGray,
).paddingOnly(top: 16.0),
AppText(
text: subtitle,
fontSize: TextSize.textSmallSize,
fontWeight: FontWeight.w400,
textColor: AppColor.lightGrey,
maxLine: 2,
textAlign: TextAlign.center,
).paddingOnly(top: 8.0),
],
),
),
),
),
));
}
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import '../../../customWidget/app_text.dart';
import '../../../res/app_color_text_size.dart';
verificationSuccess(
{required BuildContext context,
required String assetName,
required String title,
required String subtitle}) {
return Get.dialog(
barrierDismissible: false,
Center(
child: SingleChildScrollView(
child: AlertDialog(shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(12.0))),
backgroundColor: AppColor.white,
contentPadding: EdgeInsets.zero,
content: Padding(
padding: EdgeInsets.all(24.0.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
assetName,
width: 64,
height: 64,
),
Padding(
padding: EdgeInsets.only(top: 16.0),
child: AppText(
text: title,
fontSize: 18,
fontWeight: FontWeight.w500,
textColor: AppColor.slateGray,
),
),
Padding(
padding: EdgeInsets.only(top: 8.0),
child: AppText(
text: subtitle,
fontSize: 14,
fontWeight: FontWeight.w400,
textColor: AppColor.lightGrey,maxLine: 2,textAlign: TextAlign.center,
),
),
],
),
),
),
),
));
// showDialog(barrierDismissible: false,
// context: context,
// builder: (_) => Dialog(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Image.asset(
// assetName,
// width: 64,
// height: 64,
// ),
// Padding(
// padding: EdgeInsets.only(left: 16.0.h),
// child: AppText(
// text:title,
// fontSize: 18,
// fontWeight: FontWeight.w500,
// textColor: AppColor.slateGray,
// ),
// ),
// Padding(
// padding: EdgeInsets.only(left: 8.0.h),
// child: AppText(
// text: subtitle,
// fontSize: 14,
// fontWeight: FontWeight.w400,
// textColor: AppColor.lightGrey,
// ),
// ),
// ],
// ),
// ));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment