批量修改图片cover->fill

main
hs 2025-08-29 11:05:17 +08:00
parent a5a8a7ef34
commit 377500c125
20 changed files with 43 additions and 40 deletions

View File

@ -156,14 +156,14 @@ class ListItemFactory {
url,
height: imageHeight,
width: imageHeight * 3 / 2,
fit: BoxFit.cover,
fit: BoxFit.fill,
);
} else {
img = Image.asset(
url,
height: imageHeight,
width: imageHeight * 3 / 2,
fit: BoxFit.cover,
fit: BoxFit.fill,
);
}
return GestureDetector(

View File

@ -94,6 +94,8 @@ class _PromisePageState extends State<PromisePage> {
context,
MaterialPageRoute(builder: (c) => MineSignPage()),
);
await NativeOrientation.setPortrait();
if (path != null) {
setState(() {
info['FILEPATH'] = path;
@ -197,14 +199,14 @@ class _PromisePageState extends State<PromisePage> {
(baseImgPath ?? '') + signImagePath,
width: 100,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
);
} else if (signImagePath.isNotEmpty && File(signImagePath).existsSync()) {
signPreview = Image.file(
File(signImagePath),
width: 100,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
);
} else {
signPreview = const SizedBox.shrink();

View File

@ -201,18 +201,19 @@ class _HomePageState extends State<HomePage> {
final corppromiseData = await ApiService.checkSafeCorppromise();
if (corppromiseData['ISSIGN'] == 1) {
//
CustomAlertDialog.showConfirm(
final confirmed = await CustomAlertDialog.showConfirm(
context,
title: '温馨提示',
content: '有未签署的安全承诺,点击确认前往签署',
force: true,
onConfirm: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (_) => const PromisePage()),
);
},
);
if (confirmed) {
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (_) => const PromisePage()),
);
}
return;
}

View File

@ -255,7 +255,7 @@ class _StudyDetailPageState extends State<StudyDetailPage>
void _onTimeUpdate() {
if (_videoController == null || !_videoController!.value.isPlaying) return;
final curr = _videoController!.value.position;
if (!_throttleFlag && (curr - _lastReported).inSeconds >= 5) {
if (!_throttleFlag && (curr - _lastReported).inSeconds >= 0) {
_throttleFlag = true;
_lastReported = curr;
_submitPlayTime(

View File

@ -704,7 +704,7 @@ class ItemListWidget {
'${ApiService.baseImgPath}${imageUrls![index] ?? ''}',
width: 80, //
height: 80, //
fit: BoxFit.cover,
fit: BoxFit.fill,
loadingBuilder: (context, child, loadingProgress) {
if (loadingProgress == null) return child;
return Container(

View File

@ -420,7 +420,7 @@ class OtherMeasuresWidget extends StatelessWidget {
'$baseImgPath$path',
width: 60,
height: 60,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(Icons.broken_image),
),
),

View File

@ -135,7 +135,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -175,7 +175,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -109,7 +109,7 @@ class _HotworkGasListState extends State<HotworkGasList> {
img,
width: 50,
height: 30,
fit: BoxFit.cover,
fit: BoxFit.fill,
),
);
}),

View File

@ -163,7 +163,7 @@ class _CutroadDetailFormWidgetState extends State<CutroadDetailFormWidget> {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -203,7 +203,7 @@ class _CutroadDetailFormWidgetState extends State<CutroadDetailFormWidget> {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -134,7 +134,7 @@ class CutroadFormBaseWork extends StatelessWidget {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -174,7 +174,7 @@ class CutroadFormBaseWork extends StatelessWidget {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -170,7 +170,7 @@ class _BreakgroundDetailFormWidgetState
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder:
(_, __, ___) => const Icon(
Icons.broken_image,
@ -214,7 +214,7 @@ class _BreakgroundDetailFormWidgetState
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder:
(_, __, ___) => const Icon(
Icons.broken_image,
@ -349,7 +349,7 @@ class _BreakgroundDetailFormWidgetState
onTap: () {
presentOpaque(SingleImageViewer(imageUrl: fullUrl), context);
},
child: Image.network(fullUrl, fit: BoxFit.cover),
child: Image.network(fullUrl, fit: BoxFit.fill),
),
);
}),

View File

@ -135,7 +135,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -175,7 +175,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -165,7 +165,7 @@ class _HoistworkDetailFormWidgetState extends State<HoistWorkDetailFormWidget> {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -205,7 +205,7 @@ class _HoistworkDetailFormWidgetState extends State<HoistWorkDetailFormWidget> {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -134,7 +134,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -174,7 +174,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -134,7 +134,7 @@ class HighWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -174,7 +174,7 @@ class HighWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -135,7 +135,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -175,7 +175,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -110,7 +110,7 @@ class _ElectricityGasListState extends State<ElectricityGasList> {
img,
width: 50,
height: 30,
fit: BoxFit.cover,
fit: BoxFit.fill,
),
);
}),

View File

@ -137,7 +137,7 @@ class BlindboardFormBaseWork extends StatelessWidget {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -177,7 +177,7 @@ class BlindboardFormBaseWork extends StatelessWidget {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -135,7 +135,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: 50,
height: 50,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) => const Icon(
Icons.broken_image,
size: 40,
@ -175,7 +175,7 @@ class SpecialWorkFormBaseWork extends StatelessWidget {
fullUrl,
width: imageWidth,
height: imageHeight,
fit: BoxFit.cover,
fit: BoxFit.fill,
errorBuilder: (_, __, ___) =>
const Icon(Icons.broken_image, size: 60),
),

View File

@ -111,7 +111,7 @@ class _SpaceworkGasListState extends State<SpaceworkGasList> {
img,
width: 50,
height: 30,
fit: BoxFit.cover,
fit: BoxFit.fill,
),
);
}),