mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: create dynamic btn
This commit is contained in:
@@ -102,7 +102,7 @@ class BangumiIntroController extends CommonController {
|
|||||||
var result = await UserHttp.videoTags(bvid: bvid);
|
var result = await UserHttp.videoTags(bvid: bvid);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
videoTags = result['data'];
|
videoTags = result['data'];
|
||||||
debugPrint('tags: ${result['data']}');
|
// debugPrint('tags: ${result['data']}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,39 @@ class _DynamicsPageState extends State<DynamicsPage>
|
|||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
|
Widget _createDynamicBtn([bool isRight = true]) => Center(
|
||||||
|
child: Container(
|
||||||
|
width: 34,
|
||||||
|
height: 34,
|
||||||
|
margin:
|
||||||
|
EdgeInsets.only(left: !isRight ? 16 : 0, right: isRight ? 16 : 0),
|
||||||
|
child: IconButton(
|
||||||
|
tooltip: '发布动态',
|
||||||
|
style: ButtonStyle(
|
||||||
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
|
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
||||||
|
return Theme.of(context).colorScheme.secondaryContainer;
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
if (GStorage.userInfo.get('userInfoCache') != null) {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
useSafeArea: true,
|
||||||
|
isScrollControlled: true,
|
||||||
|
builder: (_) => const CreatePanel(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon: Icon(
|
||||||
|
Icons.add,
|
||||||
|
size: 18,
|
||||||
|
color: Theme.of(context).colorScheme.onSecondaryContainer,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
@@ -123,6 +156,10 @@ class _DynamicsPageState extends State<DynamicsPage>
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
leading: upPanelPosition == UpPanelPosition.rightDrawer
|
||||||
|
? _createDynamicBtn(false)
|
||||||
|
: null,
|
||||||
|
leadingWidth: 50,
|
||||||
toolbarHeight: 50,
|
toolbarHeight: 50,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
@@ -157,37 +194,9 @@ class _DynamicsPageState extends State<DynamicsPage>
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: upPanelPosition == UpPanelPosition.rightDrawer
|
||||||
Container(
|
? null
|
||||||
width: 34,
|
: [_createDynamicBtn()],
|
||||||
height: 34,
|
|
||||||
margin: const EdgeInsets.only(right: 16),
|
|
||||||
child: IconButton(
|
|
||||||
tooltip: '发布动态',
|
|
||||||
style: ButtonStyle(
|
|
||||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
|
||||||
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
|
||||||
return Theme.of(context).colorScheme.secondaryContainer;
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
if (GStorage.userInfo.get('userInfoCache') != null) {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
useSafeArea: true,
|
|
||||||
isScrollControlled: true,
|
|
||||||
builder: (_) => const CreatePanel(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
Icons.add,
|
|
||||||
size: 18,
|
|
||||||
color: Theme.of(context).colorScheme.onSecondaryContainer,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
drawer: upPanelPosition == UpPanelPosition.leftDrawer
|
drawer: upPanelPosition == UpPanelPosition.leftDrawer
|
||||||
? SafeArea(child: upPanelPart())
|
? SafeArea(child: upPanelPart())
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class VideoIntroController extends GetxController {
|
|||||||
var result = await UserHttp.videoTags(bvid: bvid);
|
var result = await UserHttp.videoTags(bvid: bvid);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
videoTags = result['data'];
|
videoTags = result['data'];
|
||||||
debugPrint('tags: ${result['data']}');
|
// debugPrint('tags: ${result['data']}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user