chore: fix and format using melos

This commit is contained in:
2023-02-23 19:19:48 +01:00
parent d098d9a6bf
commit 8d833d39d7
152 changed files with 441 additions and 468 deletions
@@ -1,4 +1,4 @@
# Copyright (C) 2022 WYATT GROUP
# Copyright (C) 2023 WYATT GROUP
# Please see the AUTHORS file for details.
#
# This program is free software: you can redistribute it and/or modify
@@ -14,6 +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/>.
include: package:wyatt_analysis/analysis_options.flutter.experimental.yaml
include: package:wyatt_analysis/analysis_options.flutter.yaml
@@ -10,9 +10,9 @@ class ExampleCubit extends Cubit<CrudState> {
await Future.delayed(const Duration(seconds: 1));
emit(CrudLoading());
await Future.delayed(const Duration(seconds: 1));
emit(CrudError('Cubit Error'));
emit(const CrudError('Cubit Error'));
await Future.delayed(const Duration(seconds: 1));
emit(CrudLoaded<String>('DATA LOADED'));
emit(const CrudLoaded<String>('DATA LOADED'));
await Future.delayed(const Duration(seconds: 1));
emit(CrudInitial());
}
@@ -23,14 +23,16 @@ class ExampleCubit extends Cubit<CrudState> {
await Future.delayed(const Duration(seconds: 1));
emit(CrudLoading());
await Future.delayed(const Duration(seconds: 1));
emit(CrudError('Cubit Error'));
emit(const CrudError('Cubit Error'));
await Future.delayed(const Duration(seconds: 1));
emit(CrudListLoaded<String>([
'DATA LOADED 1',
'DATA LOADED 2',
'DATA LOADED 3',
'DATA LOADED 4'
]));
emit(
const CrudListLoaded<String>([
'DATA LOADED 1',
'DATA LOADED 2',
'DATA LOADED 3',
'DATA LOADED 4'
]),
);
await Future.delayed(const Duration(seconds: 1));
emit(CrudInitial());
}
@@ -7,7 +7,7 @@ part 'custom_app_bar.g.dart';
@ComponentCopyWithExtension()
class CustomAppBar extends TopAppBarComponent with $CustomAppBarCWMixin {
const CustomAppBar({super.title});
const CustomAppBar({super.key, super.title});
@override
Widget build(BuildContext context) => AppBar(
title: Text(title?.data ?? 'Title'),
@@ -7,19 +7,23 @@ part 'custom_bottom_bar.g.dart';
@ComponentCopyWithExtension()
class CustomBottomBar extends BottomNavigationBarComponent
with $CustomBottomBarCWMixin {
const CustomBottomBar({super.key});
@override
Widget build(BuildContext context) => BottomNavigationBar(
items: [
items: const [
BottomNavigationBarItem(
icon: Icon(
Icons.e_mobiledata,
),
label: 'Icon 1'),
icon: Icon(
Icons.e_mobiledata,
),
label: 'Icon 1',
),
BottomNavigationBarItem(
icon: Icon(
Icons.do_not_disturb_off,
),
label: 'Icon 2'),
icon: Icon(
Icons.do_not_disturb_off,
),
label: 'Icon 2',
),
],
backgroundColor: Colors.blue,
);
@@ -7,7 +7,7 @@ part 'custom_error_widget.g.dart';
@ComponentCopyWithExtension()
class CustomErrorWidget extends ErrorWidgetComponent
with $CustomErrorWidgetCWMixin {
CustomErrorWidget({super.error});
CustomErrorWidget({super.key, super.error});
@override
Widget build(BuildContext context) => ColoredBox(
@@ -7,7 +7,7 @@ part 'custom_loading_widget.g.dart';
@ComponentCopyWithExtension()
class CustomLoadingWidget extends LoadingWidgetComponent
with $CustomLoadingWidgetCWMixin {
CustomLoadingWidget({super.color});
CustomLoadingWidget({super.key, super.color});
@override
Widget build(BuildContext context) =>
@@ -6,8 +6,8 @@ import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
class AppThemeComponent {
static ComponentThemeData get components => ComponentThemeData.raw(
appBar: CustomAppBar(),
bottomNavigationBar: CustomBottomBar(),
appBar: const CustomAppBar(),
bottomNavigationBar: const CustomBottomBar(),
loadingWidget: CustomLoadingWidget(),
errorWidget: CustomErrorWidget(),
);
@@ -28,61 +28,63 @@ class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return ComponentTheme(
componentThemeWidget: AppThemeComponent.components,
child: MaterialApp(
title: 'Bloc Layout Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
body: Column(
children: [
Expanded(
child: Row(
children: [
Expanded(
child: BlocProvider(
create: (_) => ExampleCubit()..run(),
child: ExampleCrudStateManagement(),
),
),
Expanded(
child: BlocProvider(
create: (_) => ExampleCubit()..runList(),
child: ExampleListCrudStateManagement(),
),
),
],
),
),
Expanded(
child: Row(
children: [
Expanded(
child: BlocProvider(
Widget build(BuildContext context) => ComponentTheme(
componentThemeWidget: AppThemeComponent.components,
child: MaterialApp(
title: 'Bloc Layout Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
body: Column(
children: [
Expanded(
child: Row(
children: [
Expanded(
child: BlocProvider(
create: (_) => ExampleCubit()..run(),
child: ExampleFrameLayoutCrudConsumer()),
),
Expanded(
child: BlocProvider(
child: const ExampleCrudStateManagement(),
),
),
Expanded(
child: BlocProvider(
create: (_) => ExampleCubit()..runList(),
child: ExampleFrameLayoutCrudListConsumer()),
),
],
child: const ExampleListCrudStateManagement(),
),
),
],
),
),
),
],
Expanded(
child: Row(
children: [
Expanded(
child: BlocProvider(
create: (_) => ExampleCubit()..run(),
child: const ExampleFrameLayoutCrudConsumer(),
),
),
Expanded(
child: BlocProvider(
create: (_) => ExampleCubit()..runList(),
child: const ExampleFrameLayoutCrudListConsumer(),
),
),
],
),
),
],
),
),
),
),
);
}
);
}
class ExampleCrudStateManagement
extends CrudCubitConsumerScreen<ExampleCubit, String> {
const ExampleCrudStateManagement({super.key});
@override
Widget initialBuilder(BuildContext context, CrudInitial state) =>
Container(color: Colors.yellow);
@@ -93,6 +95,8 @@ class ExampleCrudStateManagement
class ExampleListCrudStateManagement
extends CrudListCubitConsumerScreen<ExampleCubit, String> {
const ExampleListCrudStateManagement({super.key});
@override
Widget initialBuilder(BuildContext context, CrudInitial state) =>
Container(color: Colors.green);
@@ -106,7 +110,7 @@ class ExampleListCrudStateManagement
class ExampleFrameLayoutCrudConsumer
extends FrameLayoutCrudCubitConsumerScreen<ExampleCubit, String> {
const ExampleFrameLayoutCrudConsumer()
const ExampleFrameLayoutCrudConsumer({super.key})
: super(
title: 'Example Title',
currentIndex: 0,
@@ -119,7 +123,7 @@ class ExampleFrameLayoutCrudConsumer
class ExampleFrameLayoutCrudListConsumer
extends FrameLayoutCrudListCubitConsumerScreen<ExampleCubit, String> {
const ExampleFrameLayoutCrudListConsumer()
const ExampleFrameLayoutCrudListConsumer({super.key})
: super(
title: 'Example Title',
currentIndex: 0,
@@ -12,4 +12,4 @@
// 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/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
@@ -20,7 +20,7 @@ import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
mixin CrudMixin<Cubit extends bloc_base.Cubit,
mixin CrudMixin<Cubit extends bloc_base.Cubit<dynamic>,
SuccessState extends CrudSuccess> {
Widget errorBuilder(BuildContext context, CrudError state) =>
context.components.errorWidget?.copyWith(error: state.message.wrap()) ??
@@ -14,7 +14,7 @@
// 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/src/widgets/framework.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
@@ -16,5 +16,5 @@
export './app_bar_layout_crud_cubit_consumer_screen.dart';
export './bottom_bar_layout_crud_cubit_consumer_screen.dart';
export './frame_layout_crud_cubit_consumer_screen.dart';
export './crud_cubit_consumer_screen.dart';
export './frame_layout_crud_cubit_consumer_screen.dart';
@@ -15,8 +15,8 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
abstract class CrudCubitConsumerScreen<Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends CubitConsumerScreen<Cubit, CrudState>
@@ -14,7 +14,7 @@
// 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 './crud_cubit_screen.dart';
export 'app_bar_layout_crud_cubit_screen.dart';
export 'bottom_bar_layout_crud_cubit_screen.dart';
export 'frame_layout_crud_cubit_screen.dart';
export './crud_cubit_screen.dart';
@@ -15,8 +15,8 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
abstract class CrudCubitScreen<Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends CubitScreen<Cubit, CrudState>
+6 -6
View File
@@ -14,11 +14,11 @@
// 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 'presentation/presentation.dart';
export 'core/core.dart';
export 'package:flutter_bloc/flutter_bloc.dart';
export 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
export 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
export 'package:wyatt_ui_layout/wyatt_wyatt_ui_layout.dart';
export 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart';
export 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
export 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
export 'package:wyatt_ui_layout/wyatt_wyatt_ui_layout.dart';
export 'core/core.dart';
export 'presentation/presentation.dart';
+7 -6
View File
@@ -3,14 +3,17 @@ description: Layouts based on bloc helper library
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_bloc_layout
version: 0.0.1
publish_to: "none"
environment:
sdk: '>=2.17.0 <3.0.0'
sdk: ">=2.17.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_bloc: ^8.1.2
wyatt_bloc_helper:
git:
url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages
@@ -32,13 +35,11 @@ dependencies:
path: packages/wyatt_ui_components
dev_dependencies:
flutter_test:
sdk: flutter
wyatt_analysis:
git:
url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages
ref: wyatt_analysis-v2.4.0
path: packages/wyatt_analysis
path: packages/wyatt_analysis