250 lines
9.2 KiB
Dart
250 lines
9.2 KiB
Dart
// import 'dart:io';
|
|
// import 'package:flutter/material.dart';
|
|
// import 'package:flutter_bloc/flutter_bloc.dart';
|
|
// import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
// import 'package:google_fonts/google_fonts.dart';
|
|
// import '../../common_packages/app_bar.dart';
|
|
// import '../blocs/postcard_creation_bloc.dart';
|
|
// import '../blocs/postcard_creation_state.dart';
|
|
// import '../widgets/purchase_details_bottom_sheet.dart';
|
|
// import '../widgets/step_progressbar.dart';
|
|
//
|
|
// class PreviewPostcardStepPageView extends StatefulWidget {
|
|
// const PreviewPostcardStepPageView({super.key});
|
|
//
|
|
// @override
|
|
// State<PreviewPostcardStepPageView> createState() =>
|
|
// _PreviewPostcardStepPageViewState();
|
|
// }
|
|
//
|
|
// class _PreviewPostcardStepPageViewState
|
|
// extends State<PreviewPostcardStepPageView> {
|
|
// bool showImage = false; // ✅ tracks which side is visible
|
|
//
|
|
// @override
|
|
// Widget build(BuildContext context) {
|
|
// return BlocBuilder<PostcardCreationBloc, PostcardCreationState>(
|
|
// builder: (context, state) {
|
|
// return SafeArea(
|
|
// child: SingleChildScrollView(
|
|
// padding: const EdgeInsets.all(16),
|
|
// child: Column(
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
// children: [
|
|
// CommonAppBar(isWhiteLogo: false, isProfilePage: false),
|
|
// StepProgressBar(totalSteps: 4, currentStep: 4),
|
|
// const SizedBox(height: 24),
|
|
//
|
|
// Text(
|
|
// "Preview your Postcard",
|
|
// style: TextStyle(
|
|
// fontSize: 20.sp,
|
|
// fontWeight: FontWeight.w600,
|
|
// color: const Color(0xff1A1A1A),
|
|
// ),
|
|
// ),
|
|
// const SizedBox(height: 20),
|
|
//
|
|
// // 🖼️ Preview Section
|
|
// Container(
|
|
// padding: const EdgeInsets.all(12),
|
|
// decoration: BoxDecoration(
|
|
// color: const Color(0xFFFFF5F5),
|
|
// borderRadius: BorderRadius.circular(12),
|
|
// ),
|
|
// child: Column(
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
// children: [
|
|
// if (showImage)
|
|
// // ✅ Show image side
|
|
// ClipRRect(
|
|
// borderRadius: BorderRadius.circular(8),
|
|
// child: state.imagePath != null
|
|
// ? Image.file(
|
|
// File(state.imagePath!),
|
|
// height: 180.h,
|
|
// width: double.infinity,
|
|
// fit: BoxFit.cover,
|
|
// )
|
|
// : const Center(
|
|
// child: Padding(
|
|
// padding: EdgeInsets.all(40),
|
|
// child: Text(
|
|
// "No image selected",
|
|
// style:
|
|
// TextStyle(color: Color(0xff999999)),
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// )
|
|
// else
|
|
// // ✅ Show message side
|
|
// CustomPaint(
|
|
// painter: _LinedPaperPainter(),
|
|
// child: Container(
|
|
// width: double.infinity,
|
|
// padding: const EdgeInsets.symmetric(
|
|
// horizontal: 10,
|
|
// vertical: 12,
|
|
// ),
|
|
// child: Text(
|
|
// state.message ?? "",
|
|
// style: TextStyle(
|
|
// fontFamily: state.selectedFont ??
|
|
// GoogleFonts.poppins().fontFamily,
|
|
// fontSize: 14.sp,
|
|
// color: const Color(0xff1A1A1A),
|
|
// height: 1.8,
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
//
|
|
// const SizedBox(height: 24),
|
|
//
|
|
// // 🔁 Flip Buttons (toggle state)
|
|
// Row(
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
// children: [
|
|
// TextButton.icon(
|
|
// onPressed: showImage
|
|
// ? () => setState(() => showImage = false)
|
|
// : null,
|
|
// icon: const Icon(Icons.arrow_back,
|
|
// color: Color(0xffF95F62), size: 18),
|
|
// label: Text(
|
|
// "Flip",
|
|
// style: TextStyle(
|
|
// color: showImage
|
|
// ? const Color(0xffF95F62)
|
|
// : const Color(0xffC8C8C8),
|
|
// fontWeight: FontWeight.w500,
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// TextButton.icon(
|
|
// onPressed: showImage
|
|
// ? null
|
|
// : () => setState(() => showImage = true),
|
|
// icon: Text(
|
|
// "Flip",
|
|
// style: TextStyle(
|
|
// color: showImage
|
|
// ? const Color(0xffC8C8C8)
|
|
// : const Color(0xffF95F62),
|
|
// fontWeight: FontWeight.w500,
|
|
// ),
|
|
// ),
|
|
// label: const Icon(Icons.arrow_forward,
|
|
// color: Color(0xffF95F62), size: 18),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
//
|
|
// const SizedBox(height: 16),
|
|
//
|
|
// // ▶ Next Button
|
|
// SizedBox(
|
|
// width: double.infinity,
|
|
// child: ElevatedButton(
|
|
// onPressed: () {
|
|
// PurchaseDetailsBottomSheet.show(context);
|
|
// },
|
|
// style: ElevatedButton.styleFrom(
|
|
// backgroundColor: const Color(0xffF95F62),
|
|
// padding: EdgeInsets.symmetric(vertical: 16.h),
|
|
// shape: RoundedRectangleBorder(
|
|
// borderRadius: BorderRadius.circular(40),
|
|
// ),
|
|
// ),
|
|
// child: Text(
|
|
// "Next",
|
|
// style: TextStyle(
|
|
// color: Colors.white,
|
|
// fontSize: 14.sp,
|
|
// fontWeight: FontWeight.w600,
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
// );
|
|
// },
|
|
// );
|
|
// }
|
|
// }
|
|
//
|
|
// /// 📜 Custom Painter for lined message area
|
|
// class _LinedPaperPainter extends CustomPainter {
|
|
// @override
|
|
// void paint(Canvas canvas, Size size) {
|
|
// final paint = Paint()
|
|
// ..color = const Color(0xffE6DCDC)
|
|
// ..strokeWidth = 1;
|
|
//
|
|
// const lineHeight = 30.0;
|
|
// for (double y = 20; y < size.height; y += lineHeight) {
|
|
// canvas.drawLine(Offset(0, y), Offset(size.width, y), paint);
|
|
// }
|
|
// }
|
|
//
|
|
// @override
|
|
// bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
|
|
// // }
|
|
// import 'package:citycards_customer/core/route_constants.dart';
|
|
// import 'package:citycards_customer/intro_screens/views/intro_screen_view.dart';
|
|
// import 'package:flutter/material.dart';
|
|
// import 'package:flutter/services.dart';
|
|
// import 'package:lottie/lottie.dart';
|
|
//
|
|
// class SplashScreen extends StatefulWidget {
|
|
// const SplashScreen({super.key});
|
|
//
|
|
// @override
|
|
// State<SplashScreen> createState() => _SplashScreenState();
|
|
// }
|
|
//
|
|
// class _SplashScreenState extends State<SplashScreen> {
|
|
// @override
|
|
// void initState() {
|
|
// super.initState();
|
|
// timeCounter();
|
|
// }
|
|
//
|
|
// void timeCounter() async {
|
|
// try {
|
|
// Future.delayed(const Duration(seconds: 3), () {
|
|
// Navigator.pushReplacement(
|
|
// context,
|
|
// MaterialPageRoute(
|
|
// builder: (_) {
|
|
// return IntroScreensView();
|
|
// },
|
|
// ),
|
|
// );
|
|
// });
|
|
// } catch (e) {
|
|
// print('Error Occurs ${e.toString()}');
|
|
// }
|
|
// }
|
|
//
|
|
// @override
|
|
// Widget build(BuildContext context) {
|
|
// return Scaffold(
|
|
// backgroundColor: const Color(0xFFF95F62),
|
|
// body: Center(
|
|
// child: Lottie.asset(
|
|
// 'assets/intro/anim.json', // your animated Lottie file
|
|
// fit: BoxFit.cover,
|
|
// repeat: true,
|
|
// ),
|
|
// ),
|
|
// );
|
|
// }
|
|
// }
|