improve responsive sizes
This commit is contained in:
parent
ae5b280ffa
commit
0586fde872
|
|
@ -141,12 +141,14 @@ class _OfferCardState extends State<OfferCard> {
|
|||
children: [
|
||||
SvgPicture.asset(Assets.icons.routing.path),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'نوع تخفیف : ${(100 - widget.offer.finalPrice / widget.offer.originalPrice * 100).toInt()}% ${widget.offer.discountType}',
|
||||
style: const TextStyle(
|
||||
color: Color.fromARGB(255, 183, 28, 28), fontSize: 14),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
Flexible(
|
||||
child: Text(
|
||||
'نوع تخفیف : ${(100 - widget.offer.finalPrice / widget.offer.originalPrice * 100).toInt()}% ${widget.offer.discountType}',
|
||||
style: const TextStyle(
|
||||
color: Color.fromARGB(255, 183, 28, 28), fontSize: 13),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:flutter_animate/flutter_animate.dart';
|
|||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:intl/intl.dart' show NumberFormat;
|
||||
import 'package:maps_launcher/maps_launcher.dart';
|
||||
import 'package:proxibuy/core/config/api_config.dart';
|
||||
import 'package:proxibuy/core/config/app_colors.dart';
|
||||
|
|
@ -76,7 +77,7 @@ class ProductDetailPage extends StatelessWidget {
|
|||
|
||||
final dio = Dio();
|
||||
final url = ApiConfig.baseUrl + ApiConfig.addReservation;
|
||||
|
||||
|
||||
final data = {
|
||||
'Discount': offer.id,
|
||||
'Distance': offer.distanceInMeters.toString(),
|
||||
|
|
@ -94,7 +95,7 @@ class ProductDetailPage extends StatelessWidget {
|
|||
|
||||
final response =
|
||||
await dio.post(url, data: data, options: options);
|
||||
|
||||
|
||||
debugPrint("---------- RESPONSE-----------");
|
||||
debugPrint("StatusCode: ${response.statusCode}");
|
||||
debugPrint("Data: ${response.data}");
|
||||
|
|
@ -134,7 +135,7 @@ class ProductDetailPage extends StatelessWidget {
|
|||
debugPrint("StatusCode: ${e.response?.statusCode}");
|
||||
debugPrint("Data: ${e.response?.data}");
|
||||
debugPrint("--------------------------");
|
||||
|
||||
|
||||
final errorMessage = e.response?.data?['message'] ??
|
||||
'خطای سرور هنگام رزرو. لطفاً دوباره تلاش کنید.';
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
|
|
@ -404,6 +405,9 @@ class _ProductDetailViewState extends State<ProductDetailView> {
|
|||
? widget.offer.expiryTime.difference(DateTime.now())
|
||||
: Duration.zero;
|
||||
|
||||
final formatCurrency =
|
||||
NumberFormat.decimalPattern('fa_IR'); // Or 'en_US'
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0)
|
||||
.copyWith(bottom: 5.0, top: 24.0),
|
||||
|
|
@ -588,7 +592,7 @@ class _ProductDetailViewState extends State<ProductDetailView> {
|
|||
children: [
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.singleOfferType,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
|
|
@ -598,7 +602,7 @@ class _ProductDetailViewState extends State<ProductDetailView> {
|
|||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 17,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -612,16 +616,16 @@ class _ProductDetailViewState extends State<ProductDetailView> {
|
|||
Text(
|
||||
'(${(100 - widget.offer.finalPrice / widget.offer.originalPrice * 100).toInt()}%)',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontSize: 14,
|
||||
color: AppColors.singleOfferType,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
widget.offer.originalPrice.toStringAsFixed(0),
|
||||
formatCurrency.format(widget.offer.originalPrice),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
decoration: TextDecoration.lineThrough,
|
||||
),
|
||||
|
|
@ -630,10 +634,10 @@ class _ProductDetailViewState extends State<ProductDetailView> {
|
|||
),
|
||||
const SizedBox(height: 1),
|
||||
Text(
|
||||
'${widget.offer.finalPrice.toStringAsFixed(0)} تومان',
|
||||
'${formatCurrency.format(widget.offer.finalPrice)} تومان',
|
||||
style: const TextStyle(
|
||||
color: AppColors.singleOfferType,
|
||||
fontSize: 22,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:proxibuy/core/gen/assets.gen.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:proxibuy/core/config/app_colors.dart';
|
||||
|
|
@ -64,7 +65,6 @@ class _ReservedListItemCardState extends State<ReservedListItemCard> {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
void _calculateRemainingTime() {
|
||||
final now = DateTime.now();
|
||||
if (widget.offer.expiryTime.isAfter(now)) {
|
||||
|
|
@ -115,7 +115,7 @@ class _ReservedListItemCardState extends State<ReservedListItemCard> {
|
|||
0.2126, 0.7152, 0.0722, 0, 0,
|
||||
0.2126, 0.7152, 0.0722, 0, 0,
|
||||
0.2126, 0.7152, 0.0722, 0, 0,
|
||||
0, 0, 0, 1, 0,
|
||||
0, 0, 0, 1, 0,
|
||||
]),
|
||||
child: cardContent,
|
||||
);
|
||||
|
|
@ -323,6 +323,8 @@ class _ReservedListItemCardState extends State<ReservedListItemCard> {
|
|||
}
|
||||
|
||||
Widget _buildExpansionPanel() {
|
||||
final formatCurrency = NumberFormat.decimalPattern('fa_IR');
|
||||
|
||||
return AnimatedCrossFade(
|
||||
firstChild: Container(),
|
||||
secondChild: Container(
|
||||
|
|
@ -370,7 +372,7 @@ class _ReservedListItemCardState extends State<ReservedListItemCard> {
|
|||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
widget.offer.originalPrice.toStringAsFixed(0),
|
||||
formatCurrency.format(widget.offer.originalPrice),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
|
|
@ -381,7 +383,7 @@ class _ReservedListItemCardState extends State<ReservedListItemCard> {
|
|||
),
|
||||
const SizedBox(height: 1),
|
||||
Text(
|
||||
'${widget.offer.finalPrice.toStringAsFixed(0)} تومان',
|
||||
'${formatCurrency.format(widget.offer.finalPrice)} تومان',
|
||||
style: const TextStyle(
|
||||
color: AppColors.singleOfferType,
|
||||
fontSize: 18,
|
||||
|
|
|
|||
|
|
@ -894,7 +894,7 @@ packages:
|
|||
source: hosted
|
||||
version: "2.4.0"
|
||||
intl:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: intl
|
||||
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ dependencies:
|
|||
connectivity_plus: ^6.1.4
|
||||
dart_jsonwebtoken: ^3.2.0
|
||||
audioplayers: ^6.5.0
|
||||
intl: ^0.19.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
|
|||
Loading…
Reference in New Issue