Skip to content

[web] Radial Gradient not working #34332

@NicTanghe

Description

@NicTanghe

Pretty sure Radial Gradient doesn't work in flutter for web.

Code

import 'package:flutter_web/material.dart';

import 'dart:async';
import 'dart:math' as math;

import 'package:flutter_web/rendering.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage()
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: <Widget>[
          SliverAppBar(
            expandedHeight: 400,
            centerTitle: true,
            pinned: true,
            title: Text("lasagna"),
            flexibleSpace: FlexibleSpaceBar(
              background: Container(
                decoration: BoxDecoration(
                  gradient: RadialGradient(
                    colors: [const Color (0xFF8E78FF) , const Color (0xFFBA7AC9)],
                    center:const Alignment(0,0),
                    radius: 0.2,
                  )
                ),
              )
            ) 
          ),
        ],
      )
    );
  }
}

I don't get error's page renders like this.

https://i.imgur.com/wESQ8iu.png

Metadata

Metadata

Assignees

Labels

c: performanceRelates to speed or footprint issues (see "perf:" labels)platform-webWeb applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions