Skip to content

Commit 5f99cf9

Browse files
committed
🎨 Split fixed appbar.
1 parent bf2af43 commit 5f99cf9

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

lib/src/widget/asset_picker.dart

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import '../constants/constants.dart';
1919
import 'builder/fade_image_builder.dart';
2020
import 'builder/slide_page_transition_builder.dart';
2121
import 'fixed_appbar.dart';
22-
import 'platform_progress_indicator.dart';
2322

2423
class AssetPicker extends StatelessWidget {
2524
AssetPicker({
@@ -997,6 +996,18 @@ class AssetPicker extends StatelessWidget {
997996
),
998997
);
999998

999+
/// Custom app bar for the picker.
1000+
/// 选择器自定义的顶栏
1001+
FixedAppBar appBar(BuildContext context) => FixedAppBar(
1002+
backgroundColor: theme.appBarTheme.color,
1003+
centerTitle: isAppleOS,
1004+
title: pathEntitySelector,
1005+
leading: backButton(context),
1006+
actions: !isAppleOS ? <Widget>[confirmButton(context)] : null,
1007+
actionsPadding: const EdgeInsets.only(right: 14.0),
1008+
blurRadius: isAppleOS ? appleOSBlurRadius : 0.0,
1009+
);
1010+
10001011
/// Layout for Apple OS devices.
10011012
/// 苹果系列设备的选择器布局
10021013
Widget appleOSLayout(BuildContext context) {
@@ -1036,14 +1047,7 @@ class AssetPicker extends StatelessWidget {
10361047
},
10371048
),
10381049
),
1039-
FixedAppBar(
1040-
backgroundColor: theme.canvasColor,
1041-
centerTitle: true,
1042-
title: pathEntitySelector,
1043-
leading: backButton(context),
1044-
actionsPadding: const EdgeInsets.only(right: 14.0),
1045-
blurRadius: appleOSBlurRadius,
1046-
),
1050+
appBar(context),
10471051
],
10481052
);
10491053
}
@@ -1052,14 +1056,7 @@ class AssetPicker extends StatelessWidget {
10521056
/// Android设备的选择器布局
10531057
Widget androidLayout(BuildContext context) {
10541058
return FixedAppBarWrapper(
1055-
appBar: FixedAppBar(
1056-
backgroundColor: theme.canvasColor,
1057-
centerTitle: false,
1058-
title: pathEntitySelector,
1059-
leading: backButton(context),
1060-
actionsPadding: const EdgeInsets.only(right: 14.0),
1061-
actions: <Widget>[confirmButton(context)],
1062-
),
1059+
appBar: appBar(context),
10631060
body: Selector<AssetPickerProvider, bool>(
10641061
selector: (BuildContext _, AssetPickerProvider provider) =>
10651062
provider.hasAssetsToDisplay,

0 commit comments

Comments
 (0)