我想让我的 SliverAppBar 中的标题以默认方式淡出,但是一旦我将样式应用于文本,它就会停止工作。您可以看到它在使用和不使用 TextStyle 时的行为。没有其他变化。
这是应用样式的代码:
class FeedScreen extends StatelessWidget {
static const routeName = "/feed_screen";
@override
Widget build(BuildContext context) {
return ViewModelBuilder<WhosHereScreenViewModel>.reactive(
disposeViewModel: false,
initialiseSpecialViewModelsOnce: true,
viewModelBuilder: () => locator<WhosHereScreenViewModel>(),
builder: (context, model, child) {
return Scaffold(
backgroundColor: Colors.white,
body: model.isBusy == true
? Center(child: CircularProgressIndicator())
: CustomScrollView(slivers: [
SliverAppBar(
brightness: Brightness.light,
backgroundColor: Colors.white,
title: Text(
'miit',
style: TextStyle(
fontFamily: 'Changa',
fontWeight: FontWeight.w600,
fontSize: 36.0,
color: Colors.black87),
),
titleSpacing: -4.0,
leading: IconButton(
icon: Image.asset('assets/images/new_logo.png'),
onPressed: () {},
),
floating: true,
actions: [
Padding(
padding: const EdgeInsets.only(right: 12.0),
//TODO build filter functionality
child: IconButton(
icon: Icon(Mdi.accountDetailsOutline,
color: Colors.black87, size: 30.0),
onPressed: null),
)
],
),