简体   繁体   中英

How to remove appbar grey line flutter

I was working with Flutter and saw this:
a grey line appeared on my screen.
maybe it is because the appbar is moved down by, for example, 5px and the background color is set to grey?

BTW on iPhones, it works perfect, no lineshttps://imgur.com/jPyr01e

Container(
if I delete width but uncomment height it works but it sets a width of background around 200px I need double.infiniti
If I run the code it sets width to device.width but make the grey line visible
          // height: device.height * 390 / 812,
          width: double.infinity,
          child: BuildSvg('assets/svg/backgroundGradient.svg'),
        ),

buildsvg

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class BuildSvg extends StatelessWidget {
  final url;
  BuildSvg(this.url);

  @override
  Widget build(BuildContext context) {
    final String assetName = url;
    final Widget svg = new SvgPicture.asset(assetName, semanticsLabel: '');
    return svg
  }
}

I change bgckcolor to red
https://imgur.com/7C4yJ9E

This might help you :

you can change the color of the status bar from scaffold so it can be transparent

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,
      ),
    )
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM