custom_sizable_text 1.1.5+6
custom_sizable_text: ^1.1.5+6 copied to clipboard
This package is simplifying the text widget and make it flexible and auto sized. By Using auto_size_text allowed text to be auto sized.
import 'package:custom_sizable_text/custom_sizable_text.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'CustomResizableText Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: CustomText(
"CustomResizableText example",
fontStyle: Theme.of(context).textTheme.displayLarge!.fontStyle,
color: Colors.white,
size: 20,
),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const CustomText(
'You have pushed the button this many times:',
),
CustomText(
'$_counter',
textStyle: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
}