@@ -1965,38 +1965,41 @@ class DefaultAssetPickerBuilderDelegate
1965
1965
1966
1966
@override
1967
1967
Widget selectIndicator (BuildContext context, int index, AssetEntity asset) {
1968
+ final double indicatorSize = context.mediaQuery.size.width / gridCount / 3 ;
1968
1969
final Duration duration = switchingPathDuration * 0.75 ;
1969
1970
return Selector <DefaultAssetPickerProvider , String >(
1970
1971
selector: (_, DefaultAssetPickerProvider p) => p.selectedDescriptions,
1971
1972
builder: (BuildContext context, String descriptions, __) {
1972
1973
final bool selected = descriptions.contains (asset.toString ());
1973
- final double indicatorSize =
1974
- context.mediaQuery.size.width / gridCount / 3 ;
1975
1974
final Widget innerSelector = AnimatedContainer (
1976
1975
duration: duration,
1977
1976
width: indicatorSize / (isAppleOS ? 1.25 : 1.5 ),
1978
1977
height: indicatorSize / (isAppleOS ? 1.25 : 1.5 ),
1978
+ padding: EdgeInsets .all (indicatorSize / 10 ),
1979
1979
decoration: BoxDecoration (
1980
- border:
1981
- ! selected ? Border .all (color: Colors .white, width: 2 ) : null ,
1980
+ border: ! selected
1981
+ ? Border .all (
1982
+ color: context.themeData.selectedRowColor,
1983
+ width: indicatorSize / 25 ,
1984
+ )
1985
+ : null ,
1982
1986
color: selected ? themeColor : null ,
1983
1987
shape: BoxShape .circle,
1984
1988
),
1985
- child: AnimatedSwitcher (
1986
- duration: duration,
1987
- reverseDuration: duration,
1988
- child: selected
1989
- ? const Icon (Icons .check, size: 18 )
1990
- : const SizedBox .shrink (),
1989
+ child: FittedBox (
1990
+ child: AnimatedSwitcher (
1991
+ duration: duration,
1992
+ reverseDuration: duration,
1993
+ child:
1994
+ selected ? const Icon (Icons .check) : const SizedBox .shrink (),
1995
+ ),
1991
1996
),
1992
1997
);
1993
1998
final Widget selectorWidget = GestureDetector (
1994
1999
behavior: HitTestBehavior .opaque,
1995
2000
onTap: () => selectAsset (context, asset, selected),
1996
2001
child: Container (
1997
- margin: EdgeInsets .all (
1998
- context.mediaQuery.size.width / gridCount / 12 ,
1999
- ),
2002
+ margin: EdgeInsets .all (indicatorSize / 4 ),
2000
2003
width: isPreviewEnabled ? indicatorSize : null ,
2001
2004
height: isPreviewEnabled ? indicatorSize : null ,
2002
2005
alignment: AlignmentDirectional .topEnd,
@@ -2019,6 +2022,7 @@ class DefaultAssetPickerBuilderDelegate
2019
2022
2020
2023
@override
2021
2024
Widget selectedBackdrop (BuildContext context, int index, AssetEntity asset) {
2025
+ final double indicatorSize = context.mediaQuery.size.width / gridCount / 3 ;
2022
2026
return Positioned .fill (
2023
2027
child: GestureDetector (
2024
2028
onTap: isPreviewEnabled
@@ -2030,22 +2034,28 @@ class DefaultAssetPickerBuilderDelegate
2030
2034
final bool selected = index != - 1 ;
2031
2035
return AnimatedContainer (
2032
2036
duration: switchingPathDuration,
2037
+ padding: EdgeInsets .all (indicatorSize * .35 ),
2033
2038
color: selected
2034
2039
? theme.colorScheme.primary.withOpacity (.45 )
2035
- : Colors .black .withOpacity (.1 ),
2040
+ : theme.backgroundColor .withOpacity (.1 ),
2036
2041
child: selected && ! isSingleAssetMode
2037
- ? Container (
2042
+ ? Align (
2038
2043
alignment: AlignmentDirectional .topStart,
2039
- padding: const EdgeInsets .all (14 ),
2040
- child: ScaleText (
2041
- '${index + 1 }' ,
2042
- style: TextStyle (
2043
- color: theme.textTheme.bodyText1? .color
2044
- ? .withOpacity (.75 ),
2045
- fontWeight: FontWeight .w600,
2046
- height: 1 ,
2044
+ child: SizedBox (
2045
+ height: indicatorSize / 2.5 ,
2046
+ child: FittedBox (
2047
+ alignment: AlignmentDirectional .topStart,
2048
+ fit: BoxFit .cover,
2049
+ child: Text (
2050
+ '${index + 1 }' ,
2051
+ style: TextStyle (
2052
+ color: theme.textTheme.bodyText1? .color
2053
+ ? .withOpacity (.75 ),
2054
+ fontWeight: FontWeight .w600,
2055
+ height: 1 ,
2056
+ ),
2057
+ ),
2047
2058
),
2048
- maxScaleFactor: 1.4 ,
2049
2059
),
2050
2060
)
2051
2061
: const SizedBox .shrink (),
0 commit comments