master #81

Closed
malo wants to merge 322 commits from master into feat/bloc_layout/new-package
3 changed files with 37 additions and 12 deletions
Showing only changes of commit efa7ca09dd - Show all commits

View File

@ -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(

View File

@ -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';

View File

@ -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;
}