upgrade: new version syntax
This commit is contained in:
@ -305,7 +305,7 @@ class VideoContent extends StatelessWidget {
|
|||||||
if (source == 'later') ...[
|
if (source == 'later') ...[
|
||||||
IconButton(
|
IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () => onPressedFn?.call(),
|
onPressed: () => onPressedFn?.call(),
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
|
|||||||
@ -232,11 +232,11 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(
|
padding:
|
||||||
EdgeInsets.zero),
|
WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
MaterialStateProperty.resolveWith(
|
WidgetStateProperty.resolveWith(
|
||||||
(Set<MaterialState> states) {
|
(Set<WidgetState> states) {
|
||||||
return t.colorScheme.primaryContainer
|
return t.colorScheme.primaryContainer
|
||||||
.withOpacity(0.7);
|
.withOpacity(0.7);
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
widget.bangumiIntroController?.bottomSheetController =
|
widget.bangumiIntroController?.bottomSheetController =
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
height: 32,
|
height: 32,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
|
|||||||
@ -217,7 +217,7 @@ class VideoContent extends StatelessWidget {
|
|||||||
bottom: -4,
|
bottom: -4,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
|
|||||||
@ -217,11 +217,10 @@ class HistoryItem extends StatelessWidget {
|
|||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(
|
padding: WidgetStateProperty.all(
|
||||||
EdgeInsets.zero),
|
EdgeInsets.zero),
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
MaterialStateProperty
|
WidgetStateProperty.resolveWith(
|
||||||
.resolveWith(
|
|
||||||
(states) {
|
(states) {
|
||||||
return Colors.white
|
return Colors.white
|
||||||
.withOpacity(0.8);
|
.withOpacity(0.8);
|
||||||
|
|||||||
@ -124,7 +124,7 @@ class _BottomControlState extends State<BottomControl> {
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
bool canUsePiP = false;
|
bool canUsePiP = false;
|
||||||
|
|||||||
@ -249,8 +249,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
MaterialStateProperty.resolveWith(
|
WidgetStateProperty.resolveWith((states) {
|
||||||
(states) {
|
|
||||||
return Theme.of(context)
|
return Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.primary
|
.primary
|
||||||
@ -340,8 +339,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
MaterialStateProperty.resolveWith(
|
WidgetStateProperty.resolveWith((states) {
|
||||||
(states) {
|
|
||||||
return Theme.of(context)
|
return Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.primary
|
.primary
|
||||||
|
|||||||
@ -178,10 +178,10 @@ class _MediaPageState extends State<MediaPage>
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(
|
padding: WidgetStateProperty.all(
|
||||||
EdgeInsets.zero),
|
EdgeInsets.zero),
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
MaterialStateProperty.resolveWith(
|
WidgetStateProperty.resolveWith(
|
||||||
(states) {
|
(states) {
|
||||||
return Theme.of(context)
|
return Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
|
|||||||
@ -104,7 +104,7 @@ class SearchVideoPanel extends StatelessWidget {
|
|||||||
height: 32,
|
height: 32,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () => controller.onShowFilterSheet(ctr),
|
onPressed: () => controller.onShowFilterSheet(ctr),
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
|
|||||||
@ -240,10 +240,10 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
child: Switch(
|
||||||
thumbIcon: MaterialStateProperty.resolveWith<Icon?>(
|
thumbIcon: WidgetStateProperty.resolveWith<Icon?>(
|
||||||
(Set<MaterialState> states) {
|
(Set<WidgetState> states) {
|
||||||
if (states.isNotEmpty &&
|
if (states.isNotEmpty &&
|
||||||
states.first == MaterialState.selected) {
|
states.first == WidgetState.selected) {
|
||||||
return const Icon(Icons.done);
|
return const Icon(Icons.done);
|
||||||
}
|
}
|
||||||
return null; // All other states will use the default thumbIcon.
|
return null; // All other states will use the default thumbIcon.
|
||||||
|
|||||||
@ -69,10 +69,10 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
child: Switch(
|
||||||
thumbIcon: MaterialStateProperty.resolveWith<Icon?>(
|
thumbIcon: WidgetStateProperty.resolveWith<Icon?>(
|
||||||
(Set<MaterialState> states) {
|
(Set<WidgetState> states) {
|
||||||
if (states.isNotEmpty &&
|
if (states.isNotEmpty &&
|
||||||
states.first == MaterialState.selected) {
|
states.first == WidgetState.selected) {
|
||||||
return const Icon(Icons.done);
|
return const Icon(Icons.done);
|
||||||
}
|
}
|
||||||
return null; // All other states will use the default thumbIcon.
|
return null; // All other states will use the default thumbIcon.
|
||||||
|
|||||||
@ -70,9 +70,9 @@ class _SetSwitchItemState extends State<SetSwitchItem> {
|
|||||||
alignment: Alignment.centerRight, // 缩放Switch的大小后保持右侧对齐, 避免右侧空隙过大
|
alignment: Alignment.centerRight, // 缩放Switch的大小后保持右侧对齐, 避免右侧空隙过大
|
||||||
scale: 0.8,
|
scale: 0.8,
|
||||||
child: Switch(
|
child: Switch(
|
||||||
thumbIcon: MaterialStateProperty.resolveWith<Icon?>(
|
thumbIcon:
|
||||||
(Set<MaterialState> states) {
|
WidgetStateProperty.resolveWith<Icon?>((Set<WidgetState> states) {
|
||||||
if (states.isNotEmpty && states.first == MaterialState.selected) {
|
if (states.isNotEmpty && states.first == WidgetState.selected) {
|
||||||
return const Icon(Icons.done);
|
return const Icon(Icons.done);
|
||||||
}
|
}
|
||||||
return null; // All other states will use the default thumbIcon.
|
return null; // All other states will use the default thumbIcon.
|
||||||
|
|||||||
@ -106,7 +106,7 @@ class _PagesPanelState extends State<PagesPanel> {
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
widget.videoIntroCtr.bottomSheetController =
|
widget.videoIntroCtr.bottomSheetController =
|
||||||
|
|||||||
@ -27,8 +27,8 @@ class ToolbarIconButton extends StatelessWidget {
|
|||||||
? Theme.of(context).colorScheme.onSecondaryContainer
|
? Theme.of(context).colorScheme.onSecondaryContainer
|
||||||
: Theme.of(context).colorScheme.outline,
|
: Theme.of(context).colorScheme.outline,
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
backgroundColor: MaterialStateProperty.resolveWith((states) {
|
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
||||||
return selected
|
return selected
|
||||||
? Theme.of(context).colorScheme.secondaryContainer
|
? Theme.of(context).colorScheme.secondaryContainer
|
||||||
: null;
|
: null;
|
||||||
|
|||||||
@ -268,7 +268,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
size: 22),
|
size: 22),
|
||||||
label: const Text('转发到动态'),
|
label: const Text('转发到动态'),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
foregroundColor: MaterialStateProperty.all(
|
foregroundColor: WidgetStateProperty.all(
|
||||||
isForward.value
|
isForward.value
|
||||||
? Theme.of(context).colorScheme.primary
|
? Theme.of(context).colorScheme.primary
|
||||||
: Theme.of(context).colorScheme.outline,
|
: Theme.of(context).colorScheme.outline,
|
||||||
|
|||||||
@ -413,7 +413,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
height: 32,
|
height: 32,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () => vdCtr.showShootDanmakuSheet(),
|
onPressed: () => vdCtr.showShootDanmakuSheet(),
|
||||||
child:
|
child:
|
||||||
|
|||||||
@ -1255,7 +1255,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () => showShootDanmakuSheet(),
|
onPressed: () => showShootDanmakuSheet(),
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -1270,7 +1270,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
child: Obx(
|
child: Obx(
|
||||||
() => IconButton(
|
() => IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_.isOpenDanmu.value = !_.isOpenDanmu.value;
|
_.isOpenDanmu.value = !_.isOpenDanmu.value;
|
||||||
@ -1293,7 +1293,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
bool canUsePiP = false;
|
bool canUsePiP = false;
|
||||||
@ -1337,7 +1337,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () => showSetSpeedSheet(),
|
onPressed: () => showSetSpeedSheet(),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@ -281,7 +281,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
widget.showEposideCb?.call();
|
widget.showEposideCb?.call();
|
||||||
},
|
},
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'选集',
|
'选集',
|
||||||
@ -296,7 +296,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () => _.toggleVideoFit(),
|
onPressed: () => _.toggleVideoFit(),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => Text(
|
() => Text(
|
||||||
@ -313,7 +313,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
child: Obx(
|
child: Obx(
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class ComBtn extends StatelessWidget {
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
fuc!();
|
fuc!();
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class PlayOrPauseButtonState extends State<PlayOrPauseButton>
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: player.playOrPause,
|
onPressed: player.playOrPause,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
|
|||||||
@ -39,7 +39,7 @@ Future imageSaveDialog(context, videoItem, closeFn) {
|
|||||||
const BorderRadius.all(Radius.circular(20))),
|
const BorderRadius.all(Radius.circular(20))),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () => closeFn!(),
|
onPressed: () => closeFn!(),
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
|
|||||||
Reference in New Issue
Block a user