Skip to content

Encoding error in Image.errorBuilder docs example #174805

@treeplate

Description

@treeplate

Steps to reproduce

  1. Go to https://main-api.flutter.dev/flutter/widgets/Image/errorBuilder.html
  2. Look at the example flutter app

Expected results

See a 😢 in the rrect

Actual results

The rrect says �

Code sample

Code sample
import 'package:flutter/material.dart';

/// Flutter code sample for [Image.errorBuilder].

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(body: Center(child: ErrorBuilderExample())),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return DecoratedBox(
      decoration: BoxDecoration(
        color: Colors.white,
        border: Border.all(),
        borderRadius: BorderRadius.circular(20),
      ),
      child: Image.network(
        'https://example.does.not.exist/image.jpg',
        errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
          // Appropriate logging or analytics, e.g.
          // myAnalytics.recordError(
          //   'An error occurred loading "https://example.does.not.exist/image.jpg"',
          //   exception,
          //   stackTrace,
          // );
          return const Text('�');
        },
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Image

Logs

Logs

no logs, which is also a bug according to the description of the sample

Flutter Doctor output

flutter doctor output is irrelevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: imagesLoading, displaying, rendering imagesa: typographyText rendering, possibly libtxtd: api docsIssues with https://api.flutter.dev/d: examplesSample code and demosf: material designflutter/packages/flutter/material repository.found in release: 3.35Found to occur in 3.35found in release: 3.36Found to occur in 3.36frameworkflutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions