refractor: migrate components in right package

This commit is contained in:
AN12345
2022-12-07 14:56:05 -05:00
parent cf9f1ddb65
commit a20e4a1715
17 changed files with 21 additions and 39 deletions
@@ -1,17 +0,0 @@
// Copyright (C) 2022 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/>.
export 'extensions/build_context_extensions.dart';
@@ -1,23 +0,0 @@
// Copyright (C) 2022 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/material.dart';
import 'package:wyatt_wyatt_ui_layout/src/features/component_theme.dart';
import 'package:wyatt_wyatt_ui_layout/src/features/component_theme_data.dart';
extension ThemeComponentBuildContext on BuildContext {
ComponentThemeData get components => ComponentTheme.of(this);
}
@@ -1,17 +0,0 @@
// Copyright (C) 2022 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/>.
export 'entities/components.dart';
@@ -1,43 +0,0 @@
// Copyright (C) 2022 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/material.dart';
abstract class AppBarComponent extends PreferredSize {
final String? title;
const AppBarComponent({this.title, super.key})
: super(
preferredSize: const Size.fromHeight(60),
child: const SizedBox.shrink(),
);
AppBarComponent configure({String? title});
}
abstract class BottomNavigationBarComponent extends StatelessWidget {
final int currentIndex;
final void Function(BuildContext, int)? onTap;
const BottomNavigationBarComponent({
this.onTap,
this.currentIndex = 0,
super.key,
});
BottomNavigationBarComponent configure({
void Function(BuildContext, int)? onTap,
int currentIndex = 0,
});
}
@@ -1,58 +0,0 @@
// Copyright (C) 2022 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/material.dart';
import 'package:wyatt_wyatt_ui_layout/src/features/component_theme_data.dart';
class ComponentTheme extends StatelessWidget {
final Widget child;
final ComponentThemeData componentThemeWidget;
const ComponentTheme({
required this.child,
required this.componentThemeWidget,
super.key,
});
static ComponentThemeData of(BuildContext context) {
final _InheritedComponentTheme? inheritedThemeComponent =
context.dependOnInheritedWidgetOfExactType<_InheritedComponentTheme>();
assert(
inheritedThemeComponent != null,
'Theme component not find in tree',
);
return inheritedThemeComponent!.themeWidget.componentThemeWidget;
}
@override
Widget build(BuildContext context) => _InheritedComponentTheme(
this,
child: child,
);
}
class _InheritedComponentTheme extends InheritedWidget {
final ComponentTheme themeWidget;
const _InheritedComponentTheme(
this.themeWidget, {
required super.child,
});
@override
bool updateShouldNotify(covariant InheritedWidget oldWidget) =>
oldWidget != this;
}
@@ -1,27 +0,0 @@
// Copyright (C) 2022 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:wyatt_wyatt_ui_layout/src/domain/entities/components.dart';
class ComponentThemeData {
final AppBarComponent appBar;
final BottomNavigationBarComponent bottomNavigationBar;
const ComponentThemeData.raw({
required this.appBar,
required this.bottomNavigationBar,
});
}
@@ -1,18 +0,0 @@
// Copyright (C) 2022 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/>.
export 'component_theme_data.dart';
export 'component_theme.dart';
@@ -15,7 +15,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:wyatt_wyatt_ui_layout/src/core/extensions/build_context_extensions.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
import 'package:wyatt_wyatt_ui_layout/src/presentation/layouts/layout.dart';
class AppBarLayout extends Layout {
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:wyatt_wyatt_ui_layout/src/core/core.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
import 'package:wyatt_wyatt_ui_layout/src/presentation/layouts/layout.dart';
class BottomNavigationBarLayout extends Layout {
@@ -14,7 +14,4 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
export 'core/core.dart';
export 'domain/domain.dart';
export 'features/features.dart';
export 'presentation/presentation.dart';
+7
View File
@@ -10,11 +10,18 @@ dependencies:
flutter:
sdk: flutter
wyatt_ui_components:
git:
url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages
path: packages/wyatt_ui_components
dev_dependencies:
flutter_test:
sdk: flutter
wyatt_analysis: