v2版本的首页界面开发
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:maibu_satabot_v2/features/home/presentation/pages/home_page.dart
|
||||
import 'package:maibu_satabot_v2/features/my/presentation/pages/my_page.dart';
|
||||
import 'package:maibu_satabot_v2/features/main_container/presentation/bloc/tab_config_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/features/main_container/presentation/widgets/custom_bottom_nav_bar.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/home/presentation/pages/home_v2_page.dart';
|
||||
|
||||
import '../../../waring_center/presentation/pages/warning_center_page.dart';
|
||||
|
||||
@@ -53,6 +54,8 @@ class _CustomMainContainerState extends State<CustomMainContainer> with Automati
|
||||
List<Widget> _buildPages(List<dynamic> enabledTabs) {
|
||||
return enabledTabs.map((tab) {
|
||||
switch (tab.id) {
|
||||
case 'home_v2':
|
||||
return const HomeV2Page();
|
||||
case 'home':
|
||||
return const HomePage();
|
||||
case 'ai':
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:maibu_satabot_v2/features/main_container/presentation/bloc/tab_config_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/features/main_container/presentation/cubit/tab_config_cubit.dart';
|
||||
import 'package:cc_ui_kit/cc_ui_kit.dart';
|
||||
|
||||
class TabSettingsPage extends StatelessWidget {
|
||||
@@ -17,6 +17,10 @@ class TabSettingsPage extends StatelessWidget {
|
||||
),
|
||||
body: BlocBuilder<TabConfigCubit, TabConfigState>(
|
||||
builder: (context, state) {
|
||||
if (state is! TabConfigLoaded) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
final tabs = state.config.items;
|
||||
|
||||
return ListView.builder(
|
||||
@@ -60,6 +64,8 @@ class TabSettingsPage extends StatelessWidget {
|
||||
|
||||
IconData _getIconData(String iconName) {
|
||||
switch (iconName) {
|
||||
case 'home_rounded':
|
||||
return Icons.home_rounded;
|
||||
case 'grid_view_rounded':
|
||||
return Icons.grid_view_rounded;
|
||||
case 'auto_awesome_rounded':
|
||||
|
||||
Reference in New Issue
Block a user