mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 08:38:18 +08:00
opt: common ctr
opt: state Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -58,10 +58,10 @@ class _LiveAreaDetailPageState extends State<LiveAreaDetailPage> {
|
||||
ThemeData theme, LoadingState<List<AreaItem>?> loadingState) {
|
||||
return switch (loadingState) {
|
||||
Loading() => const SizedBox.shrink(),
|
||||
Success() => loadingState.response?.isNotEmpty == true
|
||||
Success(:var response) => response?.isNotEmpty == true
|
||||
? DefaultTabController(
|
||||
initialIndex: _controller.initialIndex,
|
||||
length: loadingState.response!.length,
|
||||
length: response!.length,
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
return Column(
|
||||
@@ -75,7 +75,7 @@ class _LiveAreaDetailPageState extends State<LiveAreaDetailPage> {
|
||||
dividerColor: Colors.transparent,
|
||||
isScrollable: true,
|
||||
tabAlignment: TabAlignment.start,
|
||||
tabs: loadingState.response!
|
||||
tabs: response
|
||||
.map((e) => Tab(text: e.name ?? ''))
|
||||
.toList(),
|
||||
),
|
||||
@@ -85,7 +85,7 @@ class _LiveAreaDetailPageState extends State<LiveAreaDetailPage> {
|
||||
icon: Icons.menu,
|
||||
bgColor: Colors.transparent,
|
||||
onPressed: () {
|
||||
_showTags(context, theme, loadingState.response!);
|
||||
_showTags(context, theme, response);
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -93,7 +93,7 @@ class _LiveAreaDetailPageState extends State<LiveAreaDetailPage> {
|
||||
const Divider(height: 1),
|
||||
Expanded(
|
||||
child: tabBarView(
|
||||
children: loadingState.response!
|
||||
children: response
|
||||
.map((e) => LiveAreaChildPage(
|
||||
areaId: e.id,
|
||||
parentAreaId: e.parentId,
|
||||
|
||||
Reference in New Issue
Block a user