flutter_adaptive_text 1.0.0 copy "flutter_adaptive_text: ^1.0.0" to clipboard
flutter_adaptive_text: ^1.0.0 copied to clipboard

Automatically picks a legible text color (black, white, or any palette color) based on the background color. WCAG 2.1 AA/AAA + APCA support. Drop-in AdaptiveText widget, Color extension, and standalon [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'screens/home_screen.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'flutter_adaptive_text Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: true,
        colorSchemeSeed: Colors.deepPurple,
        scaffoldBackgroundColor: const Color(0xFF0A0A0F),
      ),
      home: const HomeScreen(),
    );
  }
}
7
likes
150
points
11
downloads

Documentation

API reference

Publisher

verified publisheruzairaslam.com

Weekly Downloads

Automatically picks a legible text color (black, white, or any palette color) based on the background color. WCAG 2.1 AA/AAA + APCA support. Drop-in AdaptiveText widget, Color extension, and standalone utility functions.

Repository (GitHub)
View/report issues

Topics

#text #color #accessibility #wcag #contrast

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_adaptive_text