Skip to content

Commit 22644c7

Browse files
committed
🎨 Make widgets constant.
1 parent 3defb88 commit 22644c7

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

example/lib/pages/home_page.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class _HomePageState extends State<HomePage> {
6868
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
6969
crossAxisAlignment: CrossAxisAlignment.start,
7070
children: <Widget>[
71-
Text(
71+
const Text(
7272
'WeChat Asset Picker',
7373
style: TextStyle(
7474
fontSize: 18.0,
@@ -112,14 +112,14 @@ class _HomePageState extends State<HomePage> {
112112
bottomNavigationBar: BottomNavigationBar(
113113
currentIndex: currentIndex,
114114
onTap: selectIndex,
115-
items: <BottomNavigationBarItem>[
115+
items: const <BottomNavigationBarItem>[
116116
BottomNavigationBarItem(
117117
icon: Icon(Icons.photo_library),
118-
title: const Text('Multi'),
118+
title: Text('Multi'),
119119
),
120120
BottomNavigationBarItem(
121121
icon: Icon(Icons.photo),
122-
title: const Text('Single'),
122+
title: Text('Single'),
123123
),
124124
],
125125
),

example/lib/pages/multi_assets_page.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class _MultiAssetsPageState extends State<MultiAssetsPage> {
261261
children: <Widget>[
262262
Text(
263263
model.name,
264-
style: TextStyle(
264+
style: const TextStyle(
265265
fontSize: 18.0,
266266
fontWeight: FontWeight.bold,
267267
),
@@ -275,7 +275,7 @@ class _MultiAssetsPageState extends State<MultiAssetsPage> {
275275
],
276276
),
277277
),
278-
Icon(
278+
const Icon(
279279
Icons.chevron_right,
280280
color: Colors.grey,
281281
),
@@ -453,13 +453,13 @@ class _MultiAssetsPageState extends State<MultiAssetsPage> {
453453
horizontal: 10.0,
454454
),
455455
padding: const EdgeInsets.all(4.0),
456-
decoration: BoxDecoration(
456+
decoration: const BoxDecoration(
457457
shape: BoxShape.circle,
458458
color: Colors.grey,
459459
),
460460
child: Text(
461461
'${assets.length}',
462-
style: TextStyle(
462+
style: const TextStyle(
463463
color: Colors.white,
464464
height: 1.0,
465465
),

example/lib/pages/single_assets_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class _SingleAssetPageState extends State<SingleAssetPage> {
256256
children: <Widget>[
257257
Text(
258258
model.name,
259-
style: TextStyle(
259+
style: const TextStyle(
260260
fontSize: 18.0,
261261
fontWeight: FontWeight.bold,
262262
),
@@ -268,7 +268,7 @@ class _SingleAssetPageState extends State<SingleAssetPage> {
268268
],
269269
),
270270
),
271-
Icon(
271+
const Icon(
272272
Icons.chevron_right,
273273
color: Colors.grey,
274274
),

lib/src/widget/asset_picker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ class AssetPicker extends StatelessWidget {
834834
reverseDuration: switchingPathDuration,
835835
child: selected
836836
? isSingleAssetMode
837-
? Icon(Icons.check, size: 18.0)
837+
? const Icon(Icons.check, size: 18.0)
838838
: Text(
839839
'${selectedAssets.indexOf(asset) + 1}',
840840
style: TextStyle(

lib/src/widget/asset_picker_viewer.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ class AssetPickerViewerState extends State<AssetPickerViewer>
315315
builder: (BuildContext _, AsyncSnapshot<int> snapshot) {
316316
return Text(
317317
'${snapshot.data + 1}/${widget.assets.length}',
318-
style: TextStyle(
318+
style: const TextStyle(
319319
fontSize: 18.0,
320320
fontWeight: FontWeight.bold,
321321
),
@@ -498,7 +498,7 @@ class AssetPickerViewerState extends State<AssetPickerViewer>
498498
Widget _audioPreviewItem(AssetEntity asset) {
499499
return ColoredBox(
500500
color: context.themeData.dividerColor,
501-
child: Center(child: Icon(Icons.audiotrack)),
501+
child: const Center(child: Icon(Icons.audiotrack)),
502502
);
503503
}
504504

@@ -616,12 +616,12 @@ class AssetPickerViewerState extends State<AssetPickerViewer>
616616
child: isSelected
617617
? Text(
618618
(currentIndex + 1).toString(),
619-
style: TextStyle(
619+
style: const TextStyle(
620620
fontSize: 16.0,
621621
fontWeight: FontWeight.bold,
622622
),
623623
)
624-
: Icon(Icons.check, size: 20.0),
624+
: const Icon(Icons.check, size: 20.0),
625625
),
626626
),
627627
),

lib/src/widget/builder/audio_page_builder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class _AudioPageBuilderState extends State<AudioPageBuilder> {
129129
},
130130
child: Container(
131131
margin: const EdgeInsets.all(20.0),
132-
decoration: BoxDecoration(
132+
decoration: const BoxDecoration(
133133
boxShadow: <BoxShadow>[BoxShadow(color: Colors.black12)],
134134
shape: BoxShape.circle,
135135
),

lib/src/widget/builder/video_page_builder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class _VideoPageBuilderState extends State<VideoPageBuilder> {
140140
child: GestureDetector(
141141
onTap: playButtonCallback,
142142
child: DecoratedBox(
143-
decoration: BoxDecoration(
143+
decoration: const BoxDecoration(
144144
boxShadow: <BoxShadow>[
145145
BoxShadow(color: Colors.black12)
146146
],

0 commit comments

Comments
 (0)