curved_text 0.2.0
curved_text: ^0.2.0 copied to clipboard
Text that is curved in place with a certain curvature value.
import 'package:curved_text/curved_text.dart';
import 'package:flutter/material.dart';
import 'package:storybook_flutter/storybook_flutter.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) => Storybook(
initialRoute: '/stories/curved-text',
children: [
Story(
background: Colors.white,
name: 'Curved text',
builder: (_, k) {
final curvature = k.slider(
label: 'Curvature',
initial: double.minPositive,
min: -0.05,
max: 0.05);
final text = k.text(
label: 'Text',
initial: 'Hello, Flutter!',
);
const textStyle = TextStyle(fontSize: 20, color: Colors.black);
return DefaultTextStyle(
style: textStyle,
child: CurvedText(
curvature: curvature,
text: text,
// textStyle: textStyle,
targetRadius: 50,
),
);
},
)
],
);
}