@@ -15,6 +15,7 @@ import 'package:flutter/services.dart';
15
15
import '../constants/constants.dart' ;
16
16
import '../widget/builder/asset_entity_grid_item_builder.dart' ;
17
17
import '../widget/builder/value_listenable_builder_2.dart' ;
18
+ import '../widget/scale_text.dart' ;
18
19
19
20
typedef IndicatorBuilder = Widget Function (
20
21
BuildContext context,
@@ -247,7 +248,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
247
248
color: theme.iconTheme.color! .withOpacity (0.75 ),
248
249
)
249
250
: null ,
250
- child: Text (
251
+ child: ScaleText (
251
252
Constants .textDelegate.gifIndicator,
252
253
style: TextStyle (
253
254
color: isAppleOS
@@ -256,10 +257,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
256
257
fontSize: isAppleOS ? 14.0 : 12.0 ,
257
258
fontWeight: isAppleOS ? FontWeight .w500 : FontWeight .normal,
258
259
),
259
- strutStyle: const StrutStyle (
260
- forceStrutHeight: true ,
261
- height: 1.0 ,
262
- ),
260
+ strutStyle: const StrutStyle (forceStrutHeight: true , height: 1.0 ),
263
261
),
264
262
),
265
263
),
@@ -313,7 +311,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
313
311
return loadingIndicatorBuilder !(c, isAssetsEmpty);
314
312
}
315
313
if (isAssetsEmpty) {
316
- return const Text ('Nothing here.' );
314
+ return const ScaleText ('Nothing here.' , maxScaleFactor : 1.5 );
317
315
}
318
316
return w! ;
319
317
},
@@ -329,7 +327,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
329
327
/// 资源缩略数据加载失败时使用的部件
330
328
Widget failedItemBuilder (BuildContext context) {
331
329
return Center (
332
- child: Text (
330
+ child: ScaleText (
333
331
Constants .textDelegate.loadFailed,
334
332
textAlign: TextAlign .center,
335
333
style: const TextStyle (fontSize: 18.0 ),
@@ -420,7 +418,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
420
418
),
421
419
const SizedBox (width: 15 ),
422
420
Expanded (
423
- child: Text (
421
+ child: ScaleText (
424
422
Constants .textDelegate.accessAllTip,
425
423
style: context.themeData.textTheme.caption? .copyWith (
426
424
fontSize: 14 ,
@@ -513,13 +511,13 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
513
511
child: Column (
514
512
mainAxisAlignment: MainAxisAlignment .center,
515
513
children: < Widget > [
516
- Text (
514
+ ScaleText (
517
515
Constants .textDelegate.unableToAccessAll,
518
516
style: const TextStyle (fontSize: 22 ),
519
517
textAlign: TextAlign .center,
520
518
),
521
519
SizedBox (height: size.height / 30 ),
522
- Text (
520
+ ScaleText (
523
521
Constants .textDelegate.accessAllTip,
524
522
style: const TextStyle (fontSize: 18 ),
525
523
textAlign: TextAlign .center,
@@ -537,7 +535,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
537
535
shape: RoundedRectangleBorder (
538
536
borderRadius: BorderRadius .circular (5 ),
539
537
),
540
- child: Text (
538
+ child: ScaleText (
541
539
Constants .textDelegate.goToSystemSettings,
542
540
style: const TextStyle (fontSize: 17.0 ),
543
541
),
@@ -547,7 +545,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
547
545
548
546
final Widget _accessLimitedButton = GestureDetector (
549
547
onTap: () => permissionOverlayHidden.value = true ,
550
- child: Text (
548
+ child: ScaleText (
551
549
Constants .textDelegate.accessLimitedAssets,
552
550
style: TextStyle (color: interactiveTextColor (context)),
553
551
),
@@ -1084,7 +1082,7 @@ class DefaultAssetPickerBuilderDelegate
1084
1082
),
1085
1083
child: Padding (
1086
1084
padding: const EdgeInsetsDirectional .only (start: 4.0 ),
1087
- child: Text (
1085
+ child: ScaleText (
1088
1086
Constants .textDelegate.durationIndicatorBuilder (
1089
1087
Duration (seconds: asset.duration),
1090
1088
),
@@ -1111,7 +1109,7 @@ class DefaultAssetPickerBuilderDelegate
1111
1109
),
1112
1110
child: Padding (
1113
1111
padding: const EdgeInsetsDirectional .only (start: 4.0 , end: 30.0 ),
1114
- child: Text (
1112
+ child: ScaleText (
1115
1113
asset.title ?? '' ,
1116
1114
style: const TextStyle (fontSize: 16.0 ),
1117
1115
maxLines: 1 ,
@@ -1141,7 +1139,7 @@ class DefaultAssetPickerBuilderDelegate
1141
1139
shape: RoundedRectangleBorder (
1142
1140
borderRadius: BorderRadius .circular (3.0 ),
1143
1141
),
1144
- child: Text (
1142
+ child: ScaleText (
1145
1143
provider.isSelectedNotEmpty && ! isSingleAssetMode
1146
1144
? '${Constants .textDelegate .confirm }'
1147
1145
' (${provider .selectedAssets .length }/${provider .maxAssets })'
@@ -1208,7 +1206,7 @@ class DefaultAssetPickerBuilderDelegate
1208
1206
selector: (_, DefaultAssetPickerProvider p) => p.isAssetsEmpty,
1209
1207
builder: (_, bool isAssetsEmpty, __) {
1210
1208
if (isAssetsEmpty) {
1211
- return const Text ('Nothing here.' );
1209
+ return const ScaleText ('Nothing here.' , maxScaleFactor : 1.5 );
1212
1210
}
1213
1211
return PlatformProgressIndicator (
1214
1212
color: theme.iconTheme.color,
@@ -1373,7 +1371,7 @@ class DefaultAssetPickerBuilderDelegate
1373
1371
children: < Widget > [
1374
1372
if (p != null )
1375
1373
Flexible (
1376
- child: Text (
1374
+ child: ScaleText (
1377
1375
isPermissionLimited && p.isAll
1378
1376
? Constants .textDelegate.accessiblePathName
1379
1377
: p.name,
@@ -1383,6 +1381,7 @@ class DefaultAssetPickerBuilderDelegate
1383
1381
),
1384
1382
maxLines: 1 ,
1385
1383
overflow: TextOverflow .ellipsis,
1384
+ maxScaleFactor: 1.2 ,
1386
1385
),
1387
1386
),
1388
1387
w! ,
@@ -1474,7 +1473,7 @@ class DefaultAssetPickerBuilderDelegate
1474
1473
Flexible (
1475
1474
child: Padding (
1476
1475
padding: const EdgeInsetsDirectional .only (end: 10.0 ),
1477
- child: Text (
1476
+ child: ScaleText (
1478
1477
isPermissionLimited && pathEntity.isAll
1479
1478
? Constants .textDelegate.accessiblePathName
1480
1479
: pathEntity.name,
@@ -1484,7 +1483,7 @@ class DefaultAssetPickerBuilderDelegate
1484
1483
),
1485
1484
),
1486
1485
),
1487
- Text (
1486
+ ScaleText (
1488
1487
'(${pathEntity .assetCount })' ,
1489
1488
style: TextStyle (
1490
1489
color: theme.textTheme.caption? .color,
@@ -1555,7 +1554,7 @@ class DefaultAssetPickerBuilderDelegate
1555
1554
p.selectedDescriptions,
1556
1555
builder: (_, __, ___) => Padding (
1557
1556
padding: const EdgeInsets .symmetric (vertical: 12.0 ),
1558
- child: Text (
1557
+ child: ScaleText (
1559
1558
isSelectedNotEmpty
1560
1559
? '${Constants .textDelegate .preview }'
1561
1560
' (${provider .selectedAssets .length })'
@@ -1566,6 +1565,7 @@ class DefaultAssetPickerBuilderDelegate
1566
1565
: theme.textTheme.caption? .color,
1567
1566
fontSize: 18.0 ,
1568
1567
),
1568
+ maxScaleFactor: 1.2 ,
1569
1569
),
1570
1570
),
1571
1571
),
@@ -1732,14 +1732,15 @@ class DefaultAssetPickerBuilderDelegate
1732
1732
? Container (
1733
1733
alignment: AlignmentDirectional .topStart,
1734
1734
padding: const EdgeInsets .all (14 ),
1735
- child: Text (
1735
+ child: ScaleText (
1736
1736
'${index + 1 }' ,
1737
1737
style: TextStyle (
1738
1738
color: theme.textTheme.bodyText1? .color
1739
1739
? .withOpacity (.75 ),
1740
1740
fontWeight: FontWeight .w600,
1741
1741
height: 1 ,
1742
1742
),
1743
+ maxScaleFactor: 1.4 ,
1743
1744
),
1744
1745
)
1745
1746
: const SizedBox .shrink (),
@@ -1780,7 +1781,7 @@ class DefaultAssetPickerBuilderDelegate
1780
1781
Expanded (
1781
1782
child: Padding (
1782
1783
padding: const EdgeInsetsDirectional .only (start: 4.0 ),
1783
- child: Text (
1784
+ child: ScaleText (
1784
1785
Constants .textDelegate.durationIndicatorBuilder (
1785
1786
Duration (seconds: asset.duration),
1786
1787
),
@@ -1790,6 +1791,7 @@ class DefaultAssetPickerBuilderDelegate
1790
1791
height: 1.4 ,
1791
1792
),
1792
1793
maxLines: 1 ,
1794
+ maxScaleFactor: 1.2 ,
1793
1795
),
1794
1796
),
1795
1797
),
0 commit comments