0
On the home screen of this application I use a Sliverappbar and when I perform a Scroll on screen this area/ blue shadow appears. What is the name of this area?
I want to allow the user to choose a default color for the shadow within the app. Also, when he navigates to another screen, he can save a default color for the shadow of that screen he is on. So the app can apply different colors to the shade.
How do I do it the right way?
import 'package:flutter/material.dart';
class NoteScreen extends StatefulWidget {
@override
_NoteScreenState createState() => _NoteScreenState();
}
class _NoteScreenState extends State<NoteScreen> {
var _sliverAppBar = SliverAppBar(
backgroundColor: Colors.black87,
shadowColor: Colors.black,
pinned: true,
title: Text('Title'),
expandedHeight: 200,
stretch: true,
flexibleSpace: FlexibleSpaceBar(
background: Image.asset(
'assets/images/warrior.jpg',
fit: BoxFit.cover,
),
),
);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.black,
child: CustomScrollView(
slivers: [
_sliverAppBar,
],
),
),
);
}
}
Just pass the desired color to the property
accentColor
ofThemeData
.– Andre
@user140828 Puts as answer for me to put as right.
– Reiko Dev