1

I have a problem with flutter scaffold when I make a StatefulWidget and return scaffold a weird grey appbar appears I tried disabling it from appbar like that

return Scaffold(
      extendBodyBehindAppBar: true,
      appBar: AppBar(
        backgroundColor: Colors.transparent,
        elevation: 0,
      ),

but no avail here is an image showing the problem enter image description here

S.alhaider
  • 124
  • 2
  • 11

1 Answers1

1

Hey guys I found out the solution you just need to edit the status bar color like that

import 'package:flutter/services.dart';

class WelcomeScreen extends StatefulWidget {
  @override
  _WelcomeScreenState createState() => _WelcomeScreenState();
}

class _WelcomeScreenState extends State<WelcomeScreen> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      extendBodyBehindAppBar: true,
      appBar: AppBar(
        systemOverlayStyle: SystemUiOverlayStyle(statusBarColor: Colors.transparent),
        elevation: 0,
        backgroundColor: Colors.transparent,
      ),
    )
}
S.alhaider
  • 124
  • 2
  • 11