androidiosflutterappbarflutter-appbar

How To Remove Black Line Below AppBar Header When We Scroll Page in Flutter APP (iOS & Android)?


How To Remove Black Line Below AppBar Header When We Scroll Page in Flutter APP?


Solution

  • Used below simple solution below to remove the black line when we scroll the page;

    AppBar(
      elevation: 0.0,
      scrolledUnderElevation: 0,
    );
    

    This code should be located inside your "MyApp" class (main.dart file)

    return MaterialApp(
      theme: ThemeData(
        appBarTheme: AppBarTheme(
          scrolledUnderElevation: 0, // This removes the black line below app bar header
        )
      ),
    );