Commit f5e5ece6 by tanghuan

标题栏样式和控制方式调整

1 parent 7918cd84
......@@ -57,10 +57,7 @@ class WebPage extends StatelessWidget {
body: Stack(
children: [
state.loaded
? SizedBox(
height: MediaQuery.of(ctx).size.height - 60, // 减去100像素留空
child: WebViewWidget(controller: ctx.read<WebCubit>().controller),
)
? WebViewWidget(controller: ctx.read<WebCubit>().controller)
: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
......@@ -157,22 +154,22 @@ class WebPage extends StatelessWidget {
AppBar _buildAppBar(BuildContext ctx, WebState state) {
return AppBar(
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)),
? Text(state.title + state.testMsg, style: TextStyle(color: Color(state.titleColor), fontSize: 16))
: Text(state.title, style: TextStyle(color: Color(state.titleColor), fontSize: 16)),
centerTitle: true,
automaticallyImplyLeading: false,
backgroundColor: Color(state.bgColor),
actionsIconTheme: IconThemeData(color: Colors.white),
actionsIconTheme: IconThemeData(color: Color(state.titleColor)),
leading: state.opIcon == 'back'
? IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.white),
icon: Icon(Icons.arrow_back, color: Color(state.titleColor)),
onPressed: () {
ctx.read<WebCubit>().handleBack();
},
)
: (state.opIcon == 'home'
? IconButton(
icon: const Icon(Icons.home, color: Colors.white),
icon: Icon(Icons.home, color: Color(state.titleColor)),
onPressed: () {
ctx.read<WebCubit>().handleHome();
},
......@@ -186,6 +183,7 @@ class WebPage extends StatelessWidget {
},
),
],
toolbarHeight: 40.0,
);
}
}
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!