-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SliverAppBar 'bottom' widget not affixed to bottom when used with flexibleSpace #8297
Comments
@HansMuller or @Hixie would know. This may be a regression from the Sliverification of scrolling code. |
This appears to be a regression and an indication that we lack a test. |
We should fix this as part of our Material work in the coming months, if it's still an issue. |
https://medium.com/@diegoveloper/flutter-collapsing-toolbar-sliver-app-bar-14b858e87abe seems to cover exactly this use case |
With the code from the initial comment it looks now like import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
TabController _tabController;
@override
void initState() {
super.initState();
_tabController = TabController(vsync: this, length: 3);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: true,
expandedHeight: 256.0,
title: FlexibleSpaceBar(title: Text('My Title')),
flexibleSpace: FlexibleSpaceBar(
title: Text('flexibleSpace'),
),
bottom: TabBar(
controller: _tabController,
tabs: ['A', 'B', 'C'].map((t) => Tab(text: 'Tab $t')).toList(),
),
),
];
},
body: Center(
child: Text("Sample Text"),
),
),
);
}
}
|
Why do the examples have FlexibleSpaceBar both as the title and the flexibleSpace? What is the desired result? |
This has been working as intended since the issue was updated in January. The flexible space widget's title does (now) occupy the same place as the app bar's bottom widget. In an app that includes an app bar bottom widget, there's no need for a flexible space bar title. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
The
bottom
widget inSliverAppBar
isn't affixed along the bottom whenflexibleSpace
is included.Steps to Reproduce
The code:
renders as:
Flutter Doctor
The text was updated successfully, but these errors were encountered: