Skip to content

DecoratedSliver Docs Sample #145935

@felangel

Description

@felangel

Steps to reproduce

Visit https://api.flutter.dev/flutter/widgets/DecoratedSliver-class.html and run the sample.

The docs describe the sample as:

This sample shows a radial gradient that draws a moon on a night sky:

Expected results

I expect the sample to reflect the description (which appears to also include text which is never rendered).

Actual results

Screenshot 2024-03-28 at 5 01 23 PM

Code sample

Taken from: https://api.flutter.dev/flutter/widgets/DecoratedSliver-class.html

import 'package:flutter/material.dart';

void main() => runApp(const SliverDecorationExampleApp());

class SliverDecorationExampleApp extends StatelessWidget {
  const SliverDecorationExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('SliverDecoration Sample')),
        body: const SliverDecorationExample(),
      ),
    );
  }
}

class SliverDecorationExample extends StatelessWidget {
  const SliverDecorationExample({super.key});

  @override
  Widget build(BuildContext context) {
    return CustomScrollView(
      slivers: <Widget>[
        DecoratedSliver(
          decoration: const BoxDecoration(
            gradient: RadialGradient(
              center: Alignment(-0.5, -0.6),
              radius: 0.15,
              colors: <Color>[
                Color(0xFFEEEEEE),
                Color(0xFF111133),
              ],
              stops: <double>[0.9, 1.0],
            ),
          ),
          sliver: SliverList(
            delegate: SliverChildListDelegate(<Widget>[
              const Text('Goodnight Moon'),
            ]),
          ),
        ),
        const DecoratedSliver(
          decoration: BoxDecoration(
              color: Colors.amber,
              borderRadius: BorderRadius.all(Radius.circular(50))),
          sliver: SliverToBoxAdapter(child: SizedBox(height: 300)),
        ),
      ],
    );
  }
}

Screenshots or Video

No response

Logs

N/A

Flutter Doctor output

N/A

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/d: examplesSample code and demosfound in release: 3.19Found to occur in 3.19found in release: 3.21Found to occur in 3.21frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions