upgrade: new version syntax
This commit is contained in:
@ -34,7 +34,7 @@ class HttpError extends StatelessWidget {
|
||||
fn!();
|
||||
},
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith((states) {
|
||||
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
||||
return Theme.of(context).colorScheme.primary.withAlpha(20);
|
||||
}),
|
||||
),
|
||||
|
@ -305,7 +305,7 @@ class VideoContent extends StatelessWidget {
|
||||
if (source == 'later') ...[
|
||||
IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => onPressedFn?.call(),
|
||||
icon: Icon(
|
||||
|
@ -232,11 +232,11 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(
|
||||
EdgeInsets.zero),
|
||||
padding:
|
||||
WidgetStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor:
|
||||
MaterialStateProperty.resolveWith(
|
||||
(Set<MaterialState> states) {
|
||||
WidgetStateProperty.resolveWith(
|
||||
(Set<WidgetState> states) {
|
||||
return t.colorScheme.primaryContainer
|
||||
.withOpacity(0.7);
|
||||
}),
|
||||
|
@ -139,7 +139,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
||||
height: 34,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
widget.bangumiIntroController?.bottomSheetController =
|
||||
|
@ -82,7 +82,7 @@ class AuthorPanel extends StatelessWidget {
|
||||
height: 32,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
showModalBottomSheet(
|
||||
|
@ -217,7 +217,7 @@ class VideoContent extends StatelessWidget {
|
||||
bottom: -4,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
|
@ -217,11 +217,10 @@ class HistoryItem extends StatelessWidget {
|
||||
curve: Curves.easeInOut,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(
|
||||
padding: WidgetStateProperty.all(
|
||||
EdgeInsets.zero),
|
||||
backgroundColor:
|
||||
MaterialStateProperty
|
||||
.resolveWith(
|
||||
WidgetStateProperty.resolveWith(
|
||||
(states) {
|
||||
return Colors.white
|
||||
.withOpacity(0.8);
|
||||
|
@ -278,8 +278,8 @@ class DefaultUser extends StatelessWidget {
|
||||
height: 38,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: MaterialStateProperty.resolveWith((states) {
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
||||
return Theme.of(context).colorScheme.onInverseSurface;
|
||||
}),
|
||||
),
|
||||
@ -371,8 +371,8 @@ class CustomChip extends StatelessWidget {
|
||||
),
|
||||
backgroundColor: secondaryContainer,
|
||||
selectedColor: secondaryContainer,
|
||||
color: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) => secondaryContainer.withAlpha(200)),
|
||||
color: WidgetStateProperty.resolveWith<Color>(
|
||||
(Set<WidgetState> states) => secondaryContainer.withAlpha(200)),
|
||||
padding: const EdgeInsets.fromLTRB(7, 1, 7, 1),
|
||||
label: Text(label, style: chipTextStyle),
|
||||
onPressed: () => onTap(),
|
||||
|
@ -124,7 +124,7 @@ class _BottomControlState extends State<BottomControl> {
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () async {
|
||||
bool canUsePiP = false;
|
||||
|
@ -253,8 +253,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
IconButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateProperty.resolveWith(
|
||||
(states) {
|
||||
WidgetStateProperty.resolveWith((states) {
|
||||
return Theme.of(context)
|
||||
.colorScheme
|
||||
.primary
|
||||
@ -344,8 +343,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
IconButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateProperty.resolveWith(
|
||||
(states) {
|
||||
WidgetStateProperty.resolveWith((states) {
|
||||
return Theme.of(context)
|
||||
.colorScheme
|
||||
.primary
|
||||
|
@ -178,10 +178,10 @@ class _MediaPageState extends State<MediaPage>
|
||||
child: Center(
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(
|
||||
padding: WidgetStateProperty.all(
|
||||
EdgeInsets.zero),
|
||||
backgroundColor:
|
||||
MaterialStateProperty.resolveWith(
|
||||
WidgetStateProperty.resolveWith(
|
||||
(states) {
|
||||
return Theme.of(context)
|
||||
.colorScheme
|
||||
|
@ -90,9 +90,8 @@ class _MemberPageState extends State<MemberPage>
|
||||
() => Text(
|
||||
_memberController.memberInfo.value.name ?? '',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onBackground,
|
||||
color:
|
||||
Theme.of(context).colorScheme.onSurface,
|
||||
fontSize: 14),
|
||||
),
|
||||
),
|
||||
|
@ -92,7 +92,7 @@ class SearchVideoPanel extends StatelessWidget {
|
||||
height: 32,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => controller.onShowFilterDialog(ctr),
|
||||
icon: Icon(
|
||||
|
@ -240,10 +240,10 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: MaterialStateProperty.resolveWith<Icon?>(
|
||||
(Set<MaterialState> states) {
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>(
|
||||
(Set<WidgetState> states) {
|
||||
if (states.isNotEmpty &&
|
||||
states.first == MaterialState.selected) {
|
||||
states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null; // All other states will use the default thumbIcon.
|
||||
|
@ -69,10 +69,10 @@ class _StyleSettingState extends State<StyleSetting> {
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: MaterialStateProperty.resolveWith<Icon?>(
|
||||
(Set<MaterialState> states) {
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>(
|
||||
(Set<WidgetState> states) {
|
||||
if (states.isNotEmpty &&
|
||||
states.first == MaterialState.selected) {
|
||||
states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null; // All other states will use the default thumbIcon.
|
||||
|
@ -70,9 +70,9 @@ class _SetSwitchItemState extends State<SetSwitchItem> {
|
||||
alignment: Alignment.centerRight, // 缩放Switch的大小后保持右侧对齐, 避免右侧空隙过大
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: MaterialStateProperty.resolveWith<Icon?>(
|
||||
(Set<MaterialState> states) {
|
||||
if (states.isNotEmpty && states.first == MaterialState.selected) {
|
||||
thumbIcon:
|
||||
WidgetStateProperty.resolveWith<Icon?>((Set<WidgetState> states) {
|
||||
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
||||
return const Icon(Icons.done);
|
||||
}
|
||||
return null; // All other states will use the default thumbIcon.
|
||||
|
@ -106,7 +106,7 @@ class _PagesPanelState extends State<PagesPanel> {
|
||||
height: 34,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
widget.videoIntroCtr.bottomSheetController =
|
||||
|
@ -97,7 +97,7 @@ class ReplyItem extends StatelessWidget {
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
color: colorScheme.background,
|
||||
color: colorScheme.surface,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.offline_bolt,
|
||||
|
@ -27,8 +27,8 @@ class ToolbarIconButton extends StatelessWidget {
|
||||
? Theme.of(context).colorScheme.onSecondaryContainer
|
||||
: Theme.of(context).colorScheme.outline,
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: MaterialStateProperty.resolveWith((states) {
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
||||
return selected
|
||||
? Theme.of(context).colorScheme.secondaryContainer
|
||||
: null;
|
||||
|
@ -259,7 +259,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
||||
size: 22),
|
||||
label: const Text('转发到动态'),
|
||||
style: ButtonStyle(
|
||||
foregroundColor: MaterialStateProperty.all(
|
||||
foregroundColor: WidgetStateProperty.all(
|
||||
isForward.value
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.outline,
|
||||
|
@ -412,7 +412,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
height: 32,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => vdCtr.showShootDanmakuSheet(),
|
||||
child:
|
||||
|
@ -108,7 +108,7 @@ class AiDetail extends StatelessWidget {
|
||||
fontSize: 13,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onBackground,
|
||||
.onSurface,
|
||||
height: 1.5,
|
||||
),
|
||||
children: [
|
||||
|
@ -1248,7 +1248,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
height: 34,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => showShootDanmakuSheet(),
|
||||
child: const Text(
|
||||
@ -1263,7 +1263,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
child: Obx(
|
||||
() => IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
_.isOpenDanmu.value = !_.isOpenDanmu.value;
|
||||
@ -1286,7 +1286,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () async {
|
||||
bool canUsePiP = false;
|
||||
@ -1330,7 +1330,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
height: 34,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => showSetSpeedSheet(),
|
||||
child: Text(
|
||||
|
@ -95,9 +95,9 @@ class _WhisperDetailPageState extends State<WhisperDetailPage>
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: MaterialStateProperty.resolveWith(
|
||||
(Set<MaterialState> states) {
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: WidgetStateProperty.resolveWith(
|
||||
(Set<WidgetState> states) {
|
||||
return Theme.of(context)
|
||||
.colorScheme
|
||||
.primaryContainer
|
||||
|
@ -279,7 +279,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
widget.showEposideCb?.call();
|
||||
},
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
child: const Text(
|
||||
'选集',
|
||||
@ -294,7 +294,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
child: TextButton(
|
||||
onPressed: () => _.toggleVideoFit(),
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
child: Obx(
|
||||
() => Text(
|
||||
@ -311,7 +311,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
height: 34,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {},
|
||||
child: Obx(
|
||||
|
@ -17,7 +17,7 @@ class ComBtn extends StatelessWidget {
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
fuc!();
|
||||
|
@ -68,7 +68,7 @@ class PlayOrPauseButtonState extends State<PlayOrPauseButton>
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: player.playOrPause,
|
||||
color: Colors.white,
|
||||
|
@ -39,7 +39,7 @@ Future imageSaveDialog(context, videoItem, closeFn) {
|
||||
const BorderRadius.all(Radius.circular(20))),
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => closeFn!(),
|
||||
icon: const Icon(
|
||||
|
Reference in New Issue
Block a user