Skip to content

Flutter showing odd borders that don't actually exist. #80330

@usern3

Description

@usern3

Steps to Reproduce

I'm not sure how to reproduce since my app is pretty large. But, this is a pretty simple page. I've attached the bit of code that has anything to do with the affected part.

Expected results:
The menu to display normally

Actual results:
The menu items are surrounded by borders when at the top of the screen. But, if I scroll down they disappear. I originally though it was just an emulator problem. But I built an APK and see this on my actual phone as well.

I am getting these odd borders around my containers. I have a Column made up of ProfileMenuItem's. There is nothing about any borders in this code. I have a divider I've made to split sections of the menu, but that's showing up correctly. Below is a bit of code and the screenshot. Then my user_profile screen calls this ProfileMenu class to render it.

code sample
        return Container(
          color: Colors.white,
          child: Center(
            child: Column(
              children: [
                profileMenuItem(
                    context: context,
                    svgAsset: 'assets/svg/user_profile/saved_tips_icon.svg',
                    title: 'Saved tips',
                    onTap: () {
                      // something
                    }),
                profileMenuItem(
                    context: context,
                    svgAsset: 'assets/svg/user_profile/skin_concerns_icon.svg',
                    title: 'Skin concerns',
                    onTap: () {
                      // something
                    }),
                profileDivider(),
                profileMenuItem(
                    context: context,
                    svgAsset: 'assets/svg/user_profile/about_icon.svg',
                    title: 'About skica',
                    onTap: () {
                      _launchWebsiteAbout();
                    }),
                profileMenuItem(
                    context: context,
                    svgAsset: 'assets/svg/user_profile/feedback_icon.svg',
                    title: 'Feedback',
                    onTap: () {
                      _launchWebsiteContact();
                    }),
                profileMenuItem(
                    context: context,
                    svgAsset: 'assets/svg/user_profile/rate_us_icon.svg',
                    title: 'Rate us',
                    onTap: () {
                      // something
                    }),
                profileMenuItem(
                    context: context,
                    svgAsset: 'assets/svg/user_profile/facebook_follow_icon.svg',
                    title: 'Follow us on Facebook',
                    onTap: () {
                      _launchFacebook();
                    }),
                profileMenuItem(
                    context: context,
                    svgAsset: 'assets/svg/user_profile/rate_us_icon.svg',
                    title: 'Invite a friend',
                    onTap: () {
                      // something
                    }),
                profileDivider(),
                profileMenuItem(
                    context: context,
                    svgAsset: 'assets/svg/user_profile/logout_icon.svg',
                    title: 'Logout',
                    onTap: () {
                      _confirmLogout();
                    }),
              ],
            ),
          ),
        );
      }
    
      Widget profileDivider({double verticalPadding = 10}) {
        return Container(
          padding: EdgeInsets.only(top: verticalPadding, bottom: verticalPadding),
          child: SvgPicture.asset('assets/svg/user_profile/divider.svg'),
        );
      }
    
      Widget profileMenuItem(
          {@required BuildContext context,
          @required String svgAsset,
          @required String title,
          @required Function onTap}) {
        return Material(
          child: InkWell(
            // When the user taps the button, show a snackbar.
            onTap: onTap,
            splashColor: Colors.orange,
            child: Ink(
              width: MediaQuery.of(context).size.width * 1,
              color: Colors.white,
              child: Row(
                children: [
                  Container(
                    child: SvgPicture.asset(svgAsset, height: 60),
                  
                  ),
                  Container(
                    color: Colors.transparent,
                    margin: EdgeInsets.only(left: 20),
                    child:
                        Text(title, style: Theme.of(context).textTheme.bodyText1),
                  ),
                  Expanded(
                    child: Container(
                      alignment: Alignment.centerRight,
                      child:
                          SvgPicture.asset('assets/svg/next_icon.svg', height: 34),
                    ),
                  ),
                ],
              ),
            ),
          ),
        );
      }

And here it is if I scroll to the bottom. They magically disappear.

Logs
   info • Unused import: '../../theme/skica_icons.dart' • lib/app/pages/advanced_routine.dart:5:8 •
          unused_import
   info • Unused import: '../../theme/skica_icons.dart' • lib/app/pages/basic_routine.dart:5:8 •
          unused_import
   info • Unused import: 'package:flutter_svg/flutter_svg.dart' •
          lib/app/widgets/routine_chip_widget.dart:2:8 • unused_import
   info • This class (or a class that this class inherits from) is marked as '@immutable', but one or
          more of its instance fields aren't final: RoutineChipWidget.selected •
          lib/app/widgets/routine_chip_widget.dart:7:7 • must_be_immutable
   info • The declaration '_addRemoveButton' isn't referenced •
          lib/app/widgets/routine_chip_widget.dart:34:10 • unused_element
   info • The value of the field '_themeType' isn't used • lib/models/theme_model.dart:10:13 •
          unused_field
   info • 'await' applied to 'void', which is not a 'Future' • lib/providers/auth_provider.dart:30:7 •
          await_only_futures
   info • 'await' applied to 'void', which is not a 'Future' • lib/providers/auth_provider.dart:51:7 •
          await_only_futures
[✓] Flutter (Channel stable, 2.0.4, on macOS 11.2.3 20D91 darwin-arm, locale en-US)
    • Flutter version 2.0.4 at /Users/nolan/.flutter/flutter
    • Framework revision b1395592de (11 days ago), 2021-04-01 14:25:01 -0700
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/nolan/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.55.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (2 available)
    • iPhone 12 Pro Max (mobile) • 89BF1B69-DABD-4CB2-964A-DB3A4EFEEE02 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • Chrome (web)               • chrome                               • web-javascript • Google
      Chrome 89.0.4389.114

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions