Commit 2e3fcdbe by tanghuan

开发版和正式版显示区别

1 parent b3e0e504
......@@ -55,19 +55,19 @@ class WebPage extends StatelessWidget {
children: [
state.loaded
? SizedBox(
height: MediaQuery.of(ctx).size.height - 60, // 减去100像素留空
child: WebViewWidget(controller: ctx.read<WebCubit>().controller),
)
height: MediaQuery.of(ctx).size.height - 60, // 减去100像素留空
child: WebViewWidget(controller: ctx.read<WebCubit>().controller),
)
: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(color: Color(0xFF7691fa)),
SizedBox(height: 16),
Text('加载中...'),
],
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(color: Color(0xFF7691fa)),
SizedBox(height: 16),
Text('加载中...'),
],
),
),
// 添加升级遮罩层
if (state.isUpgrading)
Container(
......@@ -87,34 +87,34 @@ class WebPage extends StatelessWidget {
),
bottomNavigationBar: state.showBottomNavBar
? BottomNavigationBar(
type: BottomNavigationBarType.fixed,
currentIndex: state.selectedIndex,
selectedItemColor: Color(0xFF7691fa),
unselectedItemColor: Color(0xFF969799),
onTap: (index) {
// 更新选中索引
ctx.read<WebCubit>().updateSelectedIndex(index);
// 根据 index 执行相应的操作
},
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home, size: 32),
label: '我的班级',
),
BottomNavigationBarItem(
icon: Icon(Icons.contact_page, size: 32),
label: '通讯录',
),
BottomNavigationBarItem(
icon: Icon(Icons.find_in_page, size: 32),
label: '发现',
),
BottomNavigationBarItem(
icon: Icon(Icons.person, size: 32),
label: '我的',
),
],
)
type: BottomNavigationBarType.fixed,
currentIndex: state.selectedIndex,
selectedItemColor: Color(0xFF7691fa),
unselectedItemColor: Color(0xFF969799),
onTap: (index) {
// 更新选中索引
ctx.read<WebCubit>().updateSelectedIndex(index);
// 根据 index 执行相应的操作
},
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home, size: 32),
label: '我的班级',
),
BottomNavigationBarItem(
icon: Icon(Icons.contact_page, size: 32),
label: '通讯录',
),
BottomNavigationBarItem(
icon: Icon(Icons.find_in_page, size: 32),
label: '发现',
),
BottomNavigationBarItem(
icon: Icon(Icons.person, size: 32),
label: '我的',
),
],
)
: null,
),
);
......@@ -138,26 +138,28 @@ class WebPage extends StatelessWidget {
AppBar _buildAppBar(BuildContext ctx, WebState state) {
return AppBar(
title: Text(state.title + state.testMsg, style: TextStyle(color: Color(state.titleColor), fontSize: 18)),
title: EnvConfig.isDev()
? Text(state.title + state.testMsg, style: TextStyle(color: Color(state.titleColor), fontSize: 18))
: Text(state.title, style: TextStyle(color: Color(state.titleColor), fontSize: 18)),
centerTitle: true,
automaticallyImplyLeading: false,
backgroundColor: Color(state.bgColor),
actionsIconTheme: IconThemeData(color: Colors.white),
leading: state.opIcon == 'back'
? IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.white),
onPressed: () {
ctx.read<WebCubit>().handleBack();
},
)
icon: const Icon(Icons.arrow_back, color: Colors.white),
onPressed: () {
ctx.read<WebCubit>().handleBack();
},
)
: (state.opIcon == 'home'
? IconButton(
icon: const Icon(Icons.home, color: Colors.white),
onPressed: () {
ctx.read<WebCubit>().handleHome();
},
)
: null),
? IconButton(
icon: const Icon(Icons.home, color: Colors.white),
onPressed: () {
ctx.read<WebCubit>().handleHome();
},
)
: null),
);
}
......@@ -350,16 +352,18 @@ class WebPage extends StatelessWidget {
child: Center(
child: Column(
children: [
Text(
EnvConfig.isDev() ? '开发版' : '正式版',
style: TextStyle(
color: Colors.grey,
fontSize: 14,
if (EnvConfig.isDev()) ...[
Text(
'开发版',
style: TextStyle(
color: Colors.grey,
fontSize: 14,
),
),
),
SizedBox(height: 4),
SizedBox(height: 4),
],
Text(
'Version ${Constant.appVersion}-${state.h5Version}',
'Version 1.0.0',
style: TextStyle(
color: Colors.grey,
fontSize: 12,
......@@ -373,7 +377,15 @@ class WebPage extends StatelessWidget {
Text(
'Copyright © 中山班小二科技有限公司',
),
SizedBox(height: 18),
SizedBox(height: 8),
Text(
'${Constant.appVersion}-${state.h5Version}',
style: TextStyle(
color: Colors.grey,
fontSize: 12,
),
),
SizedBox(height: 10),
],
),
),
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!