Commit f5e5ece6 by tanghuan

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

1 parent 7918cd84
...@@ -57,10 +57,7 @@ class WebPage extends StatelessWidget { ...@@ -57,10 +57,7 @@ class WebPage extends StatelessWidget {
body: Stack( body: Stack(
children: [ children: [
state.loaded state.loaded
? SizedBox( ? WebViewWidget(controller: ctx.read<WebCubit>().controller)
height: MediaQuery.of(ctx).size.height - 60, // 减去100像素留空
child: WebViewWidget(controller: ctx.read<WebCubit>().controller),
)
: const Center( : const Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
...@@ -157,22 +154,22 @@ class WebPage extends StatelessWidget { ...@@ -157,22 +154,22 @@ class WebPage extends StatelessWidget {
AppBar _buildAppBar(BuildContext ctx, WebState state) { AppBar _buildAppBar(BuildContext ctx, WebState state) {
return AppBar( return AppBar(
title: EnvConfig.isDev() title: EnvConfig.isDev()
? Text(state.title + state.testMsg, 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: 18)), : Text(state.title, style: TextStyle(color: Color(state.titleColor), fontSize: 16)),
centerTitle: true, centerTitle: true,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor: Color(state.bgColor), backgroundColor: Color(state.bgColor),
actionsIconTheme: IconThemeData(color: Colors.white), actionsIconTheme: IconThemeData(color: Color(state.titleColor)),
leading: state.opIcon == 'back' leading: state.opIcon == 'back'
? IconButton( ? IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.white), icon: Icon(Icons.arrow_back, color: Color(state.titleColor)),
onPressed: () { onPressed: () {
ctx.read<WebCubit>().handleBack(); ctx.read<WebCubit>().handleBack();
}, },
) )
: (state.opIcon == 'home' : (state.opIcon == 'home'
? IconButton( ? IconButton(
icon: const Icon(Icons.home, color: Colors.white), icon: Icon(Icons.home, color: Color(state.titleColor)),
onPressed: () { onPressed: () {
ctx.read<WebCubit>().handleHome(); ctx.read<WebCubit>().handleHome();
}, },
...@@ -186,6 +183,7 @@ class WebPage extends StatelessWidget { ...@@ -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!