master #81
| @ -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( | ||||
|  | ||||
| @ -15,5 +15,6 @@ | ||||
| // along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||
| 
 | ||||
| export 'extensions/build_context_extensions.dart'; | ||||
| export 'extensions/string_extension.dart'; | ||||
| export 'mixins/copy_with_mixin.dart'; | ||||
| export 'utils/text_wrapper.dart'; | ||||
|  | ||||
| @ -0,0 +1,23 @@ | ||||
| // Copyright (C) 2023 WYATT GROUP | ||||
| // Please see the AUTHORS file for details. | ||||
| // | ||||
| // This program is free software: you can redistribute it and/or modify | ||||
| // it under the terms of the GNU General Public License as published by | ||||
| // the Free Software Foundation, either version 3 of the License, or | ||||
| // any later version. | ||||
| // | ||||
| // This program is distributed in the hope that it will be useful, | ||||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
| // GNU General Public License for more details. | ||||
| // | ||||
| // You should have received a copy of the GNU General Public License | ||||
| // along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||
| 
 | ||||
| import 'package:flutter/widgets.dart'; | ||||
| import 'package:wyatt_ui_components/src/core/utils/text_wrapper.dart'; | ||||
| 
 | ||||
| extension StringExtension on String? { | ||||
|   TextWrapper? wrap({TextStyle? style}) => | ||||
|       this != null ? TextWrapper(this!, style: style) : null; | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user