Вы можете скопировать и вставить полный код ниже
Вы можете использовать bottom
атрибут SliverAppBar
фрагмент кода
SliverAppBar(
pinned: true,
expandedHeight: 200,
centerTitle: true,
bottom: AppBar(
title: Container(
рабочая демонстрация
полный код
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> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
pinned: true,
expandedHeight: 200,
centerTitle: true,
bottom: AppBar(
title: Container(
height: 45,
child: TextField(
decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 5, left: 15),
suffixIcon: IconButton(
icon: Icon(Icons.search),
onPressed: () {
print('sesarch');
},
),
filled: true,
fillColor: Colors.white,
hintText: "What are you looking for ?",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
),
),
),
),
elevation: 20,
),
),
SliverGrid(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
),
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return Container(
height: 100,
child: Center(
child: Text('eee'),
),
);
},
),
),
],
),
);
}
}