Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LinearGradients pixel calculation issues #182673

Open
@esDotDev

Description

@esDotDev

Steps to reproduce

Run the provided code in dartpad below in the web build, and you'll see an inexplicable line along the bottom of the image.

Seems to be a regression of:#44304 (comment)

Expected results

The gradient should fill 300px

Actual results

The gradient fills 299px

Code sample

Code sample
import'package:flutter/material.dart';voidmain() {runApp(constMyApp());}classMyAppextendsStatelessWidget {constMyApp({super.key});@overrideWidgetbuild(BuildContext context) {returnMaterialApp(      title:'Flutter Stack Layers',      theme:ThemeData(        primarySwatch:Colors.blue,        visualDensity:VisualDensity.adaptivePlatformDensity,      ),      home:constMyHomePage(),      debugShowCheckedModeBanner:false,// Optional: Hide the debug banner    );  }}classMyHomePageextendsStatelessWidget {constMyHomePage({super.key});@overrideWidgetbuild(BuildContext context) {returnScaffold(      appBar:AppBar(title:constText('600x600 Stack with 3 Layers')),      body:Center(        child:SizedBox(          width:600,          height:600,          child:Stack(            children:<Widget>[Container(color:Colors.black),Align(                alignment:Alignment.topCenter,                child:Container(                  width:600,                  height:299,                  child:Image.network('https://picsum.photos/600/300?random=1',                    fit:BoxFit.cover,                  ),                ),              ),Align(                alignment:Alignment.topCenter,                child:Container(                  width:600,                  height:300,                  decoration:constBoxDecoration(                    gradient:LinearGradient(                      begin:Alignment.bottomCenter,                      end:Alignment.topCenter,                      colors: [Colors.black,Colors.transparent],                    ),                  ),                ),              ),            ],          ),        ),      ),    );  }}

Screenshots or Video

Screenshots / Video demonstrationImage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp