I want to display some content below an AppBar
in a way that looks like it's part of the app bar itself. To achieve that I set the app bar's elevation
to 0 and create a container below it with the content. This container then has a shadow to make it look like it's part of the app bar.
What I can't figure out is a way to make it so that the app bar doesn't clip the ink splash resulting from taps on buttons in the app bar, since it looks kinda off.
Example of the behavior on DartPad, and a screenshot below:
Code pasted from DartPad below:
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: Colors.grey[100]!,
elevation: 0,
actions: [
IconButton(
icon: const Icon(Icons.settings_rounded, color: Colors.black),
onPressed: () {},
),
],
),
backgroundColor: Colors.grey[100]!,
body: Column(
children: [
Container(
height: 32,
margin: const EdgeInsets.only(bottom: 3),
decoration: BoxDecoration(
color: Colors.grey[100]!,
boxShadow: [BoxShadow(color: Colors.grey[600]!, blurRadius: 3)],
),
),
],
),
),
);
}
}