flutter_html icon indicating copy to clipboard operation
flutter_html copied to clipboard

[BUG] Accessibility and scaling

Open theSharpestTool opened this issue 3 years ago • 10 comments

Issue #308 occurs again in 3.0.0-alpha.6. While in 3.0.0-alpha.5 text scaling works fine.

To reproduce set the text size to large in the device settings and check the following code:

import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    const heading2Style = TextStyle(
      fontSize: 24,
      fontWeight: FontWeight.bold,
    );

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(),
        body: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              const Padding(
                padding: EdgeInsets.only(left: 8),
                child: Text(
                  'Heading2',
                  style: heading2Style,
                ),
              ),
              Html(
                data: '<h2>Heading2</h2>',
                style: {
                  'h2': Style.fromTextStyle(heading2Style),
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}

3.0.0-alpha.5

Simulator Screen Shot - iPhone 14 Pro Max - 2022-12-28 at 19 18 36

3.0.0-alpha.6

Simulator Screen Shot - iPhone 14 Pro Max - 2022-12-28 at 19 23 58

theSharpestTool avatar Dec 28 '22 17:12 theSharpestTool

+1

esconts avatar Dec 28 '22 19:12 esconts

+1

martijnvanderlaan avatar Dec 29 '22 14:12 martijnvanderlaan

+1 I confirm this issue with 3.0.0 alpha 6.

lflorent avatar Jan 05 '23 12:01 lflorent

I discover that there is a fix on master branch not available on last alpha.8 release.

This fix works for me.

@Sub6Resources maybe you can merge your fix in next alpha release ? Thanks

lflorent avatar Jan 05 '23 14:01 lflorent

For anyone struggling with this as of today (02/02/2023) - I added this repo to my dependency_overrides in pubspec.yaml:

dependency_overrides:
  flutter_html:
    git:
      url: https://github.com/Sub6Resources/flutter_html  

I would note that it's not a 100% fix, because now the html text doesn't respect (grow or shrink) the system accessibility scaling at all.

daveshirman avatar Feb 02 '23 18:02 daveshirman

+1

TNelen avatar Feb 27 '23 19:02 TNelen

+1

iamriajul avatar Mar 01 '23 08:03 iamriajul

+1

ara-mentz avatar Mar 13 '23 12:03 ara-mentz

Able to reproduce on current master branch. Looking into it!

Sub6Resources avatar May 16 '23 15:05 Sub6Resources

Fixed in #1259. Changes should be published in 3.0.0-beta.2 by the end of the week.

Sub6Resources avatar May 16 '23 16:05 Sub6Resources