feat(ui_component): add string extension to easely wrap text
This commit is contained in:
@@ -28,17 +28,17 @@ class MyApp extends StatelessWidget {
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
Widget build(BuildContext context) => ComponentTheme(
|
||||
componentThemeWidget: AppThemeComponent.components,
|
||||
child: MaterialApp(
|
||||
title: 'Wyatt Ui Components Example',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
componentThemeWidget: AppThemeComponent.components,
|
||||
child: MaterialApp(
|
||||
title: 'Wyatt Ui Components Example',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
),
|
||||
home: const Scaffold(
|
||||
body: Home(),
|
||||
),
|
||||
),
|
||||
home: const Scaffold(
|
||||
body: Home(),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
class Home extends StatelessWidget {
|
||||
@@ -48,14 +48,15 @@ class Home extends StatelessWidget {
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(60),
|
||||
child: context.components.appBar?.copyWith.title('Example title') ??
|
||||
child: context.components.appBar?.copyWith
|
||||
.title('Example title'.wrap()) ??
|
||||
const SizedBox.shrink(),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: context.components.errorWidget
|
||||
?.copyWith(error: 'Example erreur') ??
|
||||
?.copyWith(error: 'Example erreur'.wrap()) ??
|
||||
const SizedBox.shrink(),
|
||||
),
|
||||
const SizedBox(
|
||||
|
||||
Reference in New Issue
Block a user