chore: update device_preview_plus version to 2.5.6, change Flutter build mode to debug, adjust image picker widget color opacity, and clean up unused assets script formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
sdk.dir=C:\\Users\\Housh11\\AppData\\Local\\Android\\sdk
|
sdk.dir=C:\\Users\\Housh11\\AppData\\Local\\Android\\sdk
|
||||||
flutter.sdk=C:\\src\\flutter
|
flutter.sdk=C:\\src\\flutter
|
||||||
flutter.buildMode=release
|
flutter.buildMode=debug
|
||||||
flutter.versionName=1.3.41
|
flutter.versionName=1.3.41
|
||||||
flutter.versionCode=37
|
flutter.versionCode=37
|
||||||
158
packages/core/lib/presentation/widget/image_list/image_list.dart
Normal file
158
packages/core/lib/presentation/widget/image_list/image_list.dart
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
/* import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ImageList extends StatelessWidget {
|
||||||
|
const ImageList({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
PageView.builder(
|
||||||
|
controller: pageController,
|
||||||
|
itemCount: images.length,
|
||||||
|
onPageChanged: (index) {
|
||||||
|
currentIndex.value = index;
|
||||||
|
},
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return InteractiveViewer(
|
||||||
|
minScale: 0.5,
|
||||||
|
maxScale: 4.0,
|
||||||
|
child: Center(
|
||||||
|
child: Image.file(
|
||||||
|
File(images[index].path),
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return Center(
|
||||||
|
child: Icon(
|
||||||
|
Icons.error,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 50,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 40,
|
||||||
|
right: 16,
|
||||||
|
child: IconButton(
|
||||||
|
icon: Icon(Icons.close, color: Colors.white, size: 30),
|
||||||
|
onPressed: () => Get.back(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (images.length > 1)
|
||||||
|
Positioned(
|
||||||
|
bottom: 20,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Center(
|
||||||
|
child: Obx(
|
||||||
|
() => Container(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 12,
|
||||||
|
vertical: 6,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black54,
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'${currentIndex.value + 1} / ${images.length}',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 14),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void _showLocalImageDialog(List<XFile> images, int initialIndex) {
|
||||||
|
final pageController = PageController(initialPage: initialIndex);
|
||||||
|
final currentIndex = initialIndex.obs;
|
||||||
|
|
||||||
|
Get.dialog(
|
||||||
|
Dialog(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
insetPadding: EdgeInsets.zero,
|
||||||
|
child: Container(
|
||||||
|
width: Get.width,
|
||||||
|
height: Get.height,
|
||||||
|
color: Colors.black,
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
PageView.builder(
|
||||||
|
controller: pageController,
|
||||||
|
itemCount: images.length,
|
||||||
|
onPageChanged: (index) {
|
||||||
|
currentIndex.value = index;
|
||||||
|
},
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return InteractiveViewer(
|
||||||
|
minScale: 0.5,
|
||||||
|
maxScale: 4.0,
|
||||||
|
child: Center(
|
||||||
|
child: Image.file(
|
||||||
|
File(images[index].path),
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return Center(
|
||||||
|
child: Icon(
|
||||||
|
Icons.error,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 50,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 40,
|
||||||
|
right: 16,
|
||||||
|
child: IconButton(
|
||||||
|
icon: Icon(Icons.close, color: Colors.white, size: 30),
|
||||||
|
onPressed: () => Get.back(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (images.length > 1)
|
||||||
|
Positioned(
|
||||||
|
bottom: 20,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Center(
|
||||||
|
child: Obx(
|
||||||
|
() => Container(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 12,
|
||||||
|
vertical: 6,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black54,
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'${currentIndex.value + 1} / ${images.length}',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 14),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
barrierDismissible: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
*/
|
||||||
@@ -59,7 +59,7 @@ class _RImagePickerState extends State<RImagePicker> {
|
|||||||
width: 40.w,
|
width: 40.w,
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white.withAlpha(50),
|
color: Colors.white.withAlpha(80),
|
||||||
borderRadius: BorderRadius.circular(10.r),
|
borderRadius: BorderRadius.circular(10.r),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
|
|||||||
@@ -365,10 +365,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: device_preview_plus
|
name: device_preview_plus
|
||||||
sha256: eb3e67929c9f04759e0d3708ad91d1018235549bcf8699f8a94909684c6555ae
|
sha256: d55e6197bad38b5eb304ba4e3ec3979971d8f69599b5109406022cf978dd2be2
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.5"
|
version: "2.5.6"
|
||||||
dio:
|
dio:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -63,7 +63,9 @@ void main() async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// پیدا کردن assets استفاده نشده
|
// پیدا کردن assets استفاده نشده
|
||||||
final unusedAssets = assets.where((asset) => !usedAssets.contains(asset)).toList();
|
final unusedAssets = assets
|
||||||
|
.where((asset) => !usedAssets.contains(asset))
|
||||||
|
.toList();
|
||||||
|
|
||||||
print('✅ Assets استفاده شده: ${usedAssets.length}');
|
print('✅ Assets استفاده شده: ${usedAssets.length}');
|
||||||
print('❌ Assets استفاده نشده: ${unusedAssets.length}\n');
|
print('❌ Assets استفاده نشده: ${unusedAssets.length}\n');
|
||||||
@@ -97,4 +99,3 @@ String _getAssetCategory(String assetPath) {
|
|||||||
if (assetPath.contains('anim/')) return 'anim';
|
if (assetPath.contains('anim/')) return 'anim';
|
||||||
return 'unknown';
|
return 'unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user