Compare commits
No commits in common. "f8f367baf6a7e8015ee72023e45ef439237c0d5e" and "f6ef5828bb3f68f213fccad04c1cde95efb70e31" have entirely different histories.
f8f367baf6
...
f6ef5828bb
@ -105,7 +105,7 @@ class ExampleListCrudStateManagement
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ExampleFrameLayoutCrudConsumer
|
class ExampleFrameLayoutCrudConsumer
|
||||||
extends FrameLayoutCrudCubitConsumerScreen<ExampleCubit, String> {
|
extends FrameLayoutCrudConsumerScreen<ExampleCubit, String> {
|
||||||
const ExampleFrameLayoutCrudConsumer()
|
const ExampleFrameLayoutCrudConsumer()
|
||||||
: super(
|
: super(
|
||||||
title: 'Example Title',
|
title: 'Example Title',
|
||||||
@ -118,7 +118,7 @@ class ExampleFrameLayoutCrudConsumer
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ExampleFrameLayoutCrudListConsumer
|
class ExampleFrameLayoutCrudListConsumer
|
||||||
extends FrameLayoutCrudListCubitConsumerScreen<ExampleCubit, String> {
|
extends FrameLayoutCrudListConsumerScreen<ExampleCubit, String> {
|
||||||
const ExampleFrameLayoutCrudListConsumer()
|
const ExampleFrameLayoutCrudListConsumer()
|
||||||
: super(
|
: super(
|
||||||
title: 'Example Title',
|
title: 'Example Title',
|
||||||
|
@ -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 './crud_cubit_consumer_screen_mixin.dart';
|
|
@ -16,26 +16,38 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class AppBarLayoutCubitConsumerScreen<
|
abstract class AppBarLayoutCrudConsumerScreen<
|
||||||
Cubit extends bloc_base.Cubit<State>,
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
State extends Object> extends CubitConsumerScreen<Cubit, State> {
|
T> extends CrudCubitConsumerScreen<Cubit, T> {
|
||||||
const AppBarLayoutCubitConsumerScreen({
|
|
||||||
this.title,
|
|
||||||
this.leading,
|
|
||||||
this.actions,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
final String? title;
|
final String? title;
|
||||||
final Widget? leading;
|
|
||||||
final List<Widget>? actions;
|
const AppBarLayoutCrudConsumerScreen({
|
||||||
|
this.title,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
||||||
title: title,
|
title: title ?? 'Title',
|
||||||
|
body: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class AppBarLayoutCrudListConsumerScreen<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T> extends CrudListCubitConsumerScreen<Cubit, T> {
|
||||||
|
final String? title;
|
||||||
|
final int? currentIndex;
|
||||||
|
|
||||||
|
const AppBarLayoutCrudListConsumerScreen({
|
||||||
|
this.title,
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
||||||
|
title: title ?? 'Title',
|
||||||
body: child,
|
body: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -1,19 +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 './app_bar_layout_cubit_consumer_screen.dart';
|
|
||||||
export './bottom_bar_layout_cubit_consumer_screen.dart';
|
|
||||||
export './frame_layout_cubit_consumer_screen.dart';
|
|
@ -16,22 +16,40 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class BottomBarLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
|
abstract class BottomNavigationBarLayoutCrudConsumerScreen<
|
||||||
State extends Object> extends CubitScreen<Cubit, State> {
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
const BottomBarLayoutCubitScreen({
|
T> extends CrudCubitConsumerScreen<Cubit, T> {
|
||||||
this.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
final int? currentIndex;
|
final int? currentIndex;
|
||||||
|
|
||||||
|
const BottomNavigationBarLayoutCrudConsumerScreen({
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) =>
|
Widget parent(BuildContext context, Widget child) =>
|
||||||
BottomNavigationBarLayout(
|
BottomNavigationBarLayout(
|
||||||
currentIndex: currentIndex,
|
|
||||||
body: child,
|
body: child,
|
||||||
|
currentIndex: currentIndex ?? 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class BottomNavigationBarLayoutCrudListConsumerScreen<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T> extends CrudListCubitConsumerScreen<Cubit, T> {
|
||||||
|
final String? title;
|
||||||
|
final int? currentIndex;
|
||||||
|
|
||||||
|
const BottomNavigationBarLayoutCrudListConsumerScreen({
|
||||||
|
this.title,
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget parent(BuildContext context, Widget child) =>
|
||||||
|
BottomNavigationBarLayout(
|
||||||
|
body: child,
|
||||||
|
currentIndex: currentIndex ?? 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -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 'bases/bases.dart';
|
|
||||||
export 'crud/crud.dart';
|
|
@ -1,51 +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/src/widgets/framework.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
|
||||||
|
|
||||||
abstract class AppBarLayoutCrudCubitConsumerScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>, T extends Object>
|
|
||||||
extends AppBarLayoutCubitConsumerScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudLoaded<T>> {
|
|
||||||
const AppBarLayoutCrudCubitConsumerScreen({
|
|
||||||
super.title,
|
|
||||||
super.leading,
|
|
||||||
super.actions,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class AppBarLayoutCrudListCubitConsumerScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>, T extends Object>
|
|
||||||
extends AppBarLayoutCubitConsumerScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudListLoaded<T>> {
|
|
||||||
const AppBarLayoutCrudListCubitConsumerScreen({
|
|
||||||
super.title,
|
|
||||||
super.leading,
|
|
||||||
super.actions,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
@ -1,47 +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:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
|
||||||
|
|
||||||
abstract class BottomBarLayoutCrudCubitConsumerScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>, T extends Object>
|
|
||||||
extends BottomBarLayoutCubitConsumerScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudLoaded<T>> {
|
|
||||||
const BottomBarLayoutCrudCubitConsumerScreen({
|
|
||||||
super.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class BottomBarLayoutCrudListCubitConsumerScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>, T extends Object>
|
|
||||||
extends BottomBarLayoutCubitConsumerScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudListLoaded<T>> {
|
|
||||||
const BottomBarLayoutCrudListCubitConsumerScreen({
|
|
||||||
super.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
@ -1,20 +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 './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';
|
|
@ -1,40 +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_bloc_layout/wyatt_bloc_layout.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
|
||||||
|
|
||||||
abstract class CrudCubitConsumerScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends CubitConsumerScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudLoaded<T>> {
|
|
||||||
const CrudCubitConsumerScreen({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class CrudListCubitConsumerScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends CubitConsumerScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudListLoaded<T>> {
|
|
||||||
const CrudListCubitConsumerScreen({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
@ -1,53 +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:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
|
||||||
|
|
||||||
abstract class FrameLayoutCrudCubitConsumerScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>, T extends Object>
|
|
||||||
extends FrameLayoutCubitConsumerScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudLoaded<T>> {
|
|
||||||
const FrameLayoutCrudCubitConsumerScreen({
|
|
||||||
super.title,
|
|
||||||
super.leading,
|
|
||||||
super.actions,
|
|
||||||
super.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class FrameLayoutCrudListCubitConsumerScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>, T extends Object>
|
|
||||||
extends FrameLayoutCubitConsumerScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudListLoaded<T>> {
|
|
||||||
const FrameLayoutCrudListCubitConsumerScreen({
|
|
||||||
super.title,
|
|
||||||
super.leading,
|
|
||||||
super.actions,
|
|
||||||
super.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
@ -0,0 +1,61 @@
|
|||||||
|
// 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:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart';
|
||||||
|
import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
abstract class CrudCubitConsumerScreenBase<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
SuccessState extends CrudSuccess>
|
||||||
|
extends CubitConsumerScreen<Cubit, CrudState> {
|
||||||
|
const CrudCubitConsumerScreenBase({super.key});
|
||||||
|
|
||||||
|
Widget errorBuilder(BuildContext context, CrudError state) =>
|
||||||
|
context.components.errorWidget?.configure(error: state.message) ??
|
||||||
|
const SizedBox.shrink();
|
||||||
|
|
||||||
|
Widget loadingBuilder(BuildContext context, CrudLoading state) =>
|
||||||
|
context.components.loadingWidget ?? const SizedBox.shrink();
|
||||||
|
|
||||||
|
Widget initialBuilder(BuildContext context, CrudInitial state) =>
|
||||||
|
const SizedBox.shrink();
|
||||||
|
|
||||||
|
Widget successBuilder(BuildContext context, SuccessState state);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget onBuild(BuildContext context, CrudState state) =>
|
||||||
|
CrudBuilder<CrudInitial, CrudLoading, SuccessState, CrudError>(
|
||||||
|
errorBuilder: errorBuilder,
|
||||||
|
loadingBuilder: loadingBuilder,
|
||||||
|
initialBuilder: initialBuilder,
|
||||||
|
state: state,
|
||||||
|
builder: successBuilder,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class CrudCubitConsumerScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T> extends CrudCubitConsumerScreenBase<Cubit, CrudLoaded<T>> {
|
||||||
|
const CrudCubitConsumerScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class CrudListCubitConsumerScreen<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T> extends CrudCubitConsumerScreenBase<Cubit, CrudListLoaded<T>> {
|
||||||
|
const CrudListCubitConsumerScreen();
|
||||||
|
}
|
@ -14,31 +14,44 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// 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/>.
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class FrameLayoutCubitConsumerScreen<
|
abstract class FrameLayoutCrudConsumerScreen<
|
||||||
Cubit extends bloc_base.Cubit<State>,
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
State extends Object> extends CubitConsumerScreen<Cubit, State> {
|
T> extends CrudCubitConsumerScreen<Cubit, T> {
|
||||||
const FrameLayoutCubitConsumerScreen({
|
|
||||||
this.title,
|
|
||||||
this.leading,
|
|
||||||
this.actions,
|
|
||||||
this.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
final int? currentIndex;
|
|
||||||
final String? title;
|
final String? title;
|
||||||
final Widget? leading;
|
final int? currentIndex;
|
||||||
final List<Widget>? actions;
|
|
||||||
|
const FrameLayoutCrudConsumerScreen({
|
||||||
|
this.title,
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
||||||
title: title,
|
title: title ?? 'Title',
|
||||||
currentIndex: currentIndex,
|
|
||||||
body: child,
|
body: child,
|
||||||
|
currentIndex: currentIndex ?? 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class FrameLayoutCrudListConsumerScreen<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T> extends CrudListCubitConsumerScreen<Cubit, T> {
|
||||||
|
final String? title;
|
||||||
|
final int? currentIndex;
|
||||||
|
|
||||||
|
const FrameLayoutCrudListConsumerScreen({
|
||||||
|
this.title,
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
||||||
|
title: title ?? 'Title',
|
||||||
|
body: child,
|
||||||
|
currentIndex: currentIndex ?? 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -14,5 +14,11 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// 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/>.
|
||||||
|
|
||||||
export 'consumers/consumers.dart';
|
export 'consumers/crud_cubit_consumer_screen_bases.dart';
|
||||||
export 'screens/screens.dart';
|
export 'consumers/bottom_navigation_bar_layout_crud_consumer_screen.dart';
|
||||||
|
export 'consumers/app_bar_cubit_consumer_screen.dart';
|
||||||
|
export 'consumers/frame_layout_crud_consumer_screen.dart';
|
||||||
|
export 'screens/crud_cubit_screen_base.dart';
|
||||||
|
export 'screens/app_bar_cubit_screen.dart';
|
||||||
|
export 'screens/bottom_navigation_bar_layout_crud_screen.dart';
|
||||||
|
export 'screens/frame_layout_crud_screen.dart';
|
||||||
|
@ -16,25 +16,37 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class AppBarLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
|
abstract class AppBarLayoutCrudScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
State extends Object> extends CubitScreen<Cubit, State> {
|
T> extends CrudCubitScreen<Cubit, T> {
|
||||||
const AppBarLayoutCubitScreen({
|
|
||||||
this.title,
|
|
||||||
this.leading,
|
|
||||||
this.actions,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
final String? title;
|
final String? title;
|
||||||
final Widget? leading;
|
|
||||||
final List<Widget>? actions;
|
const AppBarLayoutCrudScreen({
|
||||||
|
this.title,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
||||||
title: title,
|
title: title ?? 'Title',
|
||||||
|
body: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class AppBarLayoutCrudListScreen<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T> extends CrudListCubitScreen<Cubit, T> {
|
||||||
|
final String? title;
|
||||||
|
final int? currentIndex;
|
||||||
|
|
||||||
|
const AppBarLayoutCrudListScreen({
|
||||||
|
this.title,
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
||||||
|
title: title ?? 'Title',
|
||||||
body: child,
|
body: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -1,19 +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 'app_bar_layout_cubit_screen.dart';
|
|
||||||
export 'bottom_bar_layout_cubit_screen.dart';
|
|
||||||
export 'frame_layout_cubit_screen.dart';
|
|
@ -16,23 +16,40 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class BottomBarLayoutCubitConsumerScreen<
|
abstract class BottomNavigationBarLayoutCrudScreen<
|
||||||
Cubit extends bloc_base.Cubit<State>,
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
State extends Object> extends CubitConsumerScreen<Cubit, State> {
|
T> extends CrudCubitScreen<Cubit, T> {
|
||||||
const BottomBarLayoutCubitConsumerScreen({
|
|
||||||
this.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
final int? currentIndex;
|
final int? currentIndex;
|
||||||
|
|
||||||
|
const BottomNavigationBarLayoutCrudScreen({
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) =>
|
Widget parent(BuildContext context, Widget child) =>
|
||||||
BottomNavigationBarLayout(
|
BottomNavigationBarLayout(
|
||||||
currentIndex: currentIndex,
|
|
||||||
body: child,
|
body: child,
|
||||||
|
currentIndex: currentIndex ?? 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class BottomNavigationBarLayoutCrudListScreen<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T> extends CrudListCubitScreen<Cubit, T> {
|
||||||
|
final String? title;
|
||||||
|
final int? currentIndex;
|
||||||
|
|
||||||
|
const BottomNavigationBarLayoutCrudListScreen({
|
||||||
|
this.title,
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget parent(BuildContext context, Widget child) =>
|
||||||
|
BottomNavigationBarLayout(
|
||||||
|
body: child,
|
||||||
|
currentIndex: currentIndex ?? 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -1,51 +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:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
|
||||||
|
|
||||||
abstract class AppBarLayoutCrudCubitScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends AppBarLayoutCubitScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudLoaded<T>> {
|
|
||||||
const AppBarLayoutCrudCubitScreen({
|
|
||||||
super.title,
|
|
||||||
super.leading,
|
|
||||||
super.actions,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class AppBarLayoutCrudListCubitScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends AppBarLayoutCubitScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudListLoaded<T>> {
|
|
||||||
const AppBarLayoutCrudListCubitScreen({
|
|
||||||
super.title,
|
|
||||||
super.leading,
|
|
||||||
super.actions,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
@ -1,47 +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:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
|
||||||
|
|
||||||
abstract class BottomBarLayoutCrudCubitScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends BottomBarLayoutCubitScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudLoaded<T>> {
|
|
||||||
const BottomBarLayoutCrudCubitScreen({
|
|
||||||
super.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class BottomBarLayoutCrudListCubitScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends BottomBarLayoutCubitScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudListLoaded<T>> {
|
|
||||||
const BottomBarLayoutCrudListCubitScreen({
|
|
||||||
super.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
@ -1,20 +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 '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';
|
|
@ -1,39 +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_bloc_layout/wyatt_bloc_layout.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
|
||||||
|
|
||||||
abstract class CrudCubitScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends CubitScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudLoaded<T>> {
|
|
||||||
const CrudCubitScreen({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class CrudListCubitScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends CubitScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudListLoaded<T>> {
|
|
||||||
const CrudListCubitScreen({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
@ -1,53 +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:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
|
||||||
|
|
||||||
abstract class FrameLayoutCrudCubitScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends FrameLayoutCubitScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudLoaded<T>> {
|
|
||||||
const FrameLayoutCrudCubitScreen({
|
|
||||||
super.title,
|
|
||||||
super.leading,
|
|
||||||
super.actions,
|
|
||||||
super.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class FrameLayoutCrudListCubitScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T extends Object> extends FrameLayoutCubitScreen<Cubit, CrudState>
|
|
||||||
with CrudMixin<Cubit, CrudListLoaded<T>> {
|
|
||||||
const FrameLayoutCrudListCubitScreen({
|
|
||||||
super.title,
|
|
||||||
super.leading,
|
|
||||||
super.actions,
|
|
||||||
super.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
crudBuilder(context, state);
|
|
||||||
}
|
|
@ -16,12 +16,11 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
|
abstract class CrudCubitScreenBase<Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
SuccessState extends CrudSuccess> extends CubitScreen<Cubit, CrudState> {
|
||||||
|
const CrudCubitScreenBase();
|
||||||
mixin CrudMixin<Cubit extends bloc_base.Cubit,
|
|
||||||
SuccessState extends CrudSuccess> {
|
|
||||||
Widget errorBuilder(BuildContext context, CrudError state) =>
|
Widget errorBuilder(BuildContext context, CrudError state) =>
|
||||||
context.components.errorWidget?.configure(error: state.message) ??
|
context.components.errorWidget?.configure(error: state.message) ??
|
||||||
const SizedBox.shrink();
|
const SizedBox.shrink();
|
||||||
@ -34,7 +33,8 @@ mixin CrudMixin<Cubit extends bloc_base.Cubit,
|
|||||||
|
|
||||||
Widget successBuilder(BuildContext context, SuccessState state);
|
Widget successBuilder(BuildContext context, SuccessState state);
|
||||||
|
|
||||||
Widget crudBuilder(BuildContext context, CrudState state) =>
|
@override
|
||||||
|
Widget onBuild(BuildContext context, CrudState state) =>
|
||||||
CrudBuilder<CrudInitial, CrudLoading, SuccessState, CrudError>(
|
CrudBuilder<CrudInitial, CrudLoading, SuccessState, CrudError>(
|
||||||
errorBuilder: errorBuilder,
|
errorBuilder: errorBuilder,
|
||||||
loadingBuilder: loadingBuilder,
|
loadingBuilder: loadingBuilder,
|
||||||
@ -43,3 +43,13 @@ mixin CrudMixin<Cubit extends bloc_base.Cubit,
|
|||||||
builder: successBuilder,
|
builder: successBuilder,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class CrudCubitScreen<Cubit extends bloc_base.Cubit<CrudState>, T>
|
||||||
|
extends CrudCubitScreenBase<Cubit, CrudLoaded<T>> {
|
||||||
|
const CrudCubitScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class CrudListCubitScreen<Cubit extends bloc_base.Cubit<CrudState>, T>
|
||||||
|
extends CrudCubitScreenBase<Cubit, CrudListLoaded<T>> {
|
||||||
|
const CrudListCubitScreen();
|
||||||
|
}
|
@ -14,30 +14,43 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// 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/>.
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class FrameLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
|
abstract class FrameLayoutCrudScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
State extends Object> extends CubitScreen<Cubit, State> {
|
T> extends CrudCubitScreen<Cubit, T> {
|
||||||
const FrameLayoutCubitScreen({
|
|
||||||
this.title,
|
|
||||||
this.leading,
|
|
||||||
this.actions,
|
|
||||||
this.currentIndex,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
final int? currentIndex;
|
|
||||||
final String? title;
|
final String? title;
|
||||||
final Widget? leading;
|
final int? currentIndex;
|
||||||
final List<Widget>? actions;
|
|
||||||
|
const FrameLayoutCrudScreen({
|
||||||
|
this.title,
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
||||||
title: title,
|
title: title ?? 'Title',
|
||||||
currentIndex: currentIndex,
|
|
||||||
body: child,
|
body: child,
|
||||||
|
currentIndex: currentIndex ?? 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class FrameLayoutCrudListScreen<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T> extends CrudListCubitScreen<Cubit, T> {
|
||||||
|
final String? title;
|
||||||
|
final int? currentIndex;
|
||||||
|
|
||||||
|
const FrameLayoutCrudListScreen({
|
||||||
|
this.title,
|
||||||
|
this.currentIndex,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
||||||
|
title: title ?? 'Title',
|
||||||
|
body: child,
|
||||||
|
currentIndex: currentIndex ?? 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -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 './bases/bases.dart';
|
|
||||||
export './crud/crud.dart';
|
|
@ -15,7 +15,6 @@
|
|||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
export 'presentation/presentation.dart';
|
export 'presentation/presentation.dart';
|
||||||
export 'core/core.dart';
|
|
||||||
|
|
||||||
export 'package:flutter_bloc/flutter_bloc.dart';
|
export 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
export 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
export 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
@ -1,181 +0,0 @@
|
|||||||
@startuml
|
|
||||||
set namespaceSeparator ::
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" {
|
|
||||||
+Widget errorBuilder()
|
|
||||||
+Widget loadingBuilder()
|
|
||||||
+Widget initialBuilder()
|
|
||||||
+Widget successBuilder()
|
|
||||||
+Widget crudBuilder()
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" {
|
|
||||||
+int? currentIndex
|
|
||||||
+Widget parent()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" {
|
|
||||||
+String? title
|
|
||||||
+Widget? leading
|
|
||||||
+List<Widget>? actions
|
|
||||||
+Widget parent()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" o-- "flutter::src::widgets::framework.dart::Widget"
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" {
|
|
||||||
+int? currentIndex
|
|
||||||
+String? title
|
|
||||||
+Widget? leading
|
|
||||||
+List<Widget>? actions
|
|
||||||
+Widget parent()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" o-- "flutter::src::widgets::framework.dart::Widget"
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudCubitScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudCubitScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudListCubitScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudListCubitScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudListCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudCubitScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudCubitScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudListCubitScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudListCubitScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudListCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudCubitScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudCubitScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudListCubitScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudListCubitScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudListCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudCubitScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudCubitScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudListCubitScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudListCubitScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudListCubitScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" {
|
|
||||||
+int? currentIndex
|
|
||||||
+Widget parent()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" {
|
|
||||||
+String? title
|
|
||||||
+Widget? leading
|
|
||||||
+List<Widget>? actions
|
|
||||||
+Widget parent()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" o-- "flutter::src::widgets::framework.dart::Widget"
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" {
|
|
||||||
+int? currentIndex
|
|
||||||
+String? title
|
|
||||||
+Widget? leading
|
|
||||||
+List<Widget>? actions
|
|
||||||
+Widget parent()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" o-- "flutter::src::widgets::framework.dart::Widget"
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudCubitConsumerScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudCubitConsumerScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudListCubitConsumerScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudListCubitConsumerScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudListCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudCubitConsumerScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudCubitConsumerScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudListCubitConsumerScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudListCubitConsumerScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudListCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudCubitConsumerScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudCubitConsumerScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudListCubitConsumerScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudListCubitConsumerScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudListCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudCubitConsumerScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudCubitConsumerScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudCubitConsumerScreen"
|
|
||||||
|
|
||||||
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudListCubitConsumerScreen" {
|
|
||||||
+Widget onBuild()
|
|
||||||
}
|
|
||||||
|
|
||||||
"wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudListCubitConsumerScreen"
|
|
||||||
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudListCubitConsumerScreen"
|
|
||||||
|
|
||||||
|
|
||||||
@enduml
|
|
@ -20,26 +20,18 @@ import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
|
|||||||
|
|
||||||
class AppBarLayout extends Layout {
|
class AppBarLayout extends Layout {
|
||||||
const AppBarLayout({
|
const AppBarLayout({
|
||||||
|
required this.title,
|
||||||
required this.body,
|
required this.body,
|
||||||
this.title,
|
|
||||||
this.leading,
|
|
||||||
this.actions,
|
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
final String? title;
|
final String title;
|
||||||
final Widget? leading;
|
|
||||||
final List<Widget>? actions;
|
|
||||||
final Widget body;
|
final Widget body;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => Scaffold(
|
Widget build(BuildContext context) => Scaffold(
|
||||||
appBar: PreferredSize(
|
appBar: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(60),
|
preferredSize: const Size.fromHeight(60),
|
||||||
child: context.components.appBar?.configure(
|
child: context.components.appBar?.configure(title: title) ??
|
||||||
title: title,
|
|
||||||
leading: leading,
|
|
||||||
actions: actions,
|
|
||||||
) ??
|
|
||||||
const SizedBox.shrink(),
|
const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
body: body,
|
body: body,
|
||||||
|
@ -3,18 +3,19 @@ import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
|||||||
import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
|
import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
|
||||||
|
|
||||||
class BottomNavigationBarLayout extends Layout {
|
class BottomNavigationBarLayout extends Layout {
|
||||||
|
|
||||||
const BottomNavigationBarLayout({
|
const BottomNavigationBarLayout({
|
||||||
this.currentIndex,
|
required this.currentIndex,
|
||||||
this.body,
|
required this.body,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
final Widget? body;
|
final Widget body;
|
||||||
final int? currentIndex;
|
final int currentIndex;
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => Scaffold(
|
Widget build(BuildContext context) => Scaffold(
|
||||||
body: body,
|
body: body,
|
||||||
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
|
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
|
||||||
currentIndex: currentIndex ?? 0,
|
currentIndex: currentIndex,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -19,34 +19,27 @@ import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
|||||||
import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
|
import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
|
||||||
|
|
||||||
class FrameLayout extends Layout {
|
class FrameLayout extends Layout {
|
||||||
|
|
||||||
const FrameLayout({
|
const FrameLayout({
|
||||||
|
required this.title,
|
||||||
required this.body,
|
required this.body,
|
||||||
this.title,
|
required this.currentIndex,
|
||||||
this.leading,
|
|
||||||
this.actions,
|
|
||||||
this.currentIndex,
|
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
final String? title;
|
final String title;
|
||||||
final Widget? leading;
|
|
||||||
final List<Widget>? actions;
|
|
||||||
final Widget body;
|
final Widget body;
|
||||||
final int? currentIndex;
|
final int currentIndex;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => Scaffold(
|
Widget build(BuildContext context) => Scaffold(
|
||||||
appBar: PreferredSize(
|
appBar: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(60),
|
preferredSize: const Size.fromHeight(60),
|
||||||
child: context.components.appBar?.configure(
|
child: context.components.appBar?.configure(title: title) ??
|
||||||
title: title,
|
|
||||||
leading: leading,
|
|
||||||
actions: actions,
|
|
||||||
) ??
|
|
||||||
const SizedBox.shrink(),
|
const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
body: body,
|
body: body,
|
||||||
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
|
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
|
||||||
currentIndex: currentIndex ?? 0,
|
currentIndex: currentIndex,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user