override_text_scale_factor 0.0.2 copy "override_text_scale_factor: ^0.0.2" to clipboard
override_text_scale_factor: ^0.0.2 copied to clipboard

outdated

This package provides a widget for override text scale factor.

override_text_scale_factor #

When you're too lazy to make parts of your UI respond to a non-default textScaleFactor then OverrideTextScaleFactor is the widget for you.

Usage #

Take a look at this Example Project

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Override Text Scale Factor',
      home: Scaffold(
        body: Container(
          width: double.infinity,
          height: double.infinity,
          padding: const EdgeInsets.all(32),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              OverrideTextScaleFactor(
                child: Container(
                  width: double.infinity,
                  color: Colors.black12,
                  padding: EdgeInsets.all(16),
                  child: Text(
                    'This text wont scale to device font scale',
                    textAlign: TextAlign.center,
                  ),
                ),
              ),
              const SizedBox(
                height: 24,
              ),
              OverrideTextScaleFactor(
                textScaleFactor: 1.5,
                child: Container(
                  width: double.infinity,
                  color: Colors.black26,
                  padding: EdgeInsets.all(16),
                  child: Text(
                    'This text has a fixed font scale of 1.5',
                    textAlign: TextAlign.center,
                  ),
                ),
              ),
              const SizedBox(
                height: 24,
              ),
              Container(
                width: double.infinity,
                color: Colors.black38,
                padding: EdgeInsets.all(16),
                child: Text(
                  'This text will scale to device font scale',
                  textAlign: TextAlign.center,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
4
likes
0
pub points
52%
popularity

Publisher

unverified uploader

This package provides a widget for override text scale factor.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on override_text_scale_factor