master #81
@ -62,13 +62,13 @@ class MyApp extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: BlocProvider(
|
child: BlocProvider(
|
||||||
create: (_) => ExampleCubit()..run(),
|
create: (_) => ExampleCubit()..run(),
|
||||||
child: const ExampleFrameLayoutCrudConsumer(),
|
child: ExampleFrameLayoutCrudConsumer(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: BlocProvider(
|
child: BlocProvider(
|
||||||
create: (_) => ExampleCubit()..runList(),
|
create: (_) => ExampleCubit()..runList(),
|
||||||
child: const ExampleFrameLayoutCrudListConsumer(),
|
child: ExampleFrameLayoutCrudListConsumer(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -82,7 +82,7 @@ class MyApp extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ExampleCrudStateManagement
|
class ExampleCrudStateManagement
|
||||||
extends CrudCubitConsumerScreen<ExampleCubit, String> {
|
extends CubitScreenCrudItemBase<ExampleCubit, String> {
|
||||||
const ExampleCrudStateManagement({super.key});
|
const ExampleCrudStateManagement({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -91,10 +91,13 @@ class ExampleCrudStateManagement
|
|||||||
@override
|
@override
|
||||||
Widget successBuilder(BuildContext context, CrudLoaded<String> state) =>
|
Widget successBuilder(BuildContext context, CrudLoaded<String> state) =>
|
||||||
Center(child: Text(state.data ?? 'errors'));
|
Center(child: Text(state.data ?? 'errors'));
|
||||||
|
|
||||||
|
@override
|
||||||
|
ExampleCubit create(BuildContext context) => ExampleCubit()..run();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExampleListCrudStateManagement
|
class ExampleListCrudStateManagement
|
||||||
extends CrudListCubitConsumerScreen<ExampleCubit, String> {
|
extends CubitScreenCrudListBase<ExampleCubit, String> {
|
||||||
const ExampleListCrudStateManagement({super.key});
|
const ExampleListCrudStateManagement({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -106,27 +109,35 @@ class ExampleListCrudStateManagement
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: state.data.map((e) => Text(e ?? 'error')).toList(),
|
children: state.data.map((e) => Text(e ?? 'error')).toList(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ExampleCubit create(BuildContext context) => ExampleCubit()..run();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExampleFrameLayoutCrudConsumer
|
class ExampleFrameLayoutCrudConsumer
|
||||||
extends FrameLayoutCrudCubitConsumerScreen<ExampleCubit, String> {
|
extends FrameLayoutCubitScreenCrudItem<ExampleCubit, String> {
|
||||||
const ExampleFrameLayoutCrudConsumer({super.key})
|
ExampleFrameLayoutCrudConsumer({super.key})
|
||||||
: super(
|
: super(
|
||||||
title: 'Example Title',
|
customAppBar: (bar) => bar?.copyWith.title(
|
||||||
currentIndex: 0,
|
'Example Title'.wrap(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget successBuilder(BuildContext context, CrudLoaded<String> state) =>
|
Widget successBuilder(BuildContext context, CrudLoaded<String> state) =>
|
||||||
Center(child: Text(state.data ?? 'errors'));
|
Center(child: Text(state.data ?? 'errors'));
|
||||||
|
|
||||||
|
@override
|
||||||
|
ExampleCubit create(BuildContext context) => ExampleCubit()..run();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExampleFrameLayoutCrudListConsumer
|
class ExampleFrameLayoutCrudListConsumer
|
||||||
extends FrameLayoutCrudListCubitConsumerScreen<ExampleCubit, String> {
|
extends FrameLayoutCubitScreenCrudList<ExampleCubit, String> {
|
||||||
const ExampleFrameLayoutCrudListConsumer({super.key})
|
ExampleFrameLayoutCrudListConsumer({super.key})
|
||||||
: super(
|
: super(
|
||||||
title: 'Example Title',
|
customAppBar: (bar) => bar?.copyWith.title(
|
||||||
currentIndex: 0,
|
'Example Title'.wrap(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -135,4 +146,7 @@ class ExampleFrameLayoutCrudListConsumer
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: state.data.map((e) => Text(e ?? 'error')).toList(),
|
children: state.data.map((e) => Text(e ?? 'error')).toList(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ExampleCubit create(BuildContext context) => ExampleCubit()..run();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
// 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 './bottom_navigation_bar_bloc_layout.dart';
|
||||||
|
export './bottom_navigation_bar_layout_cubit_screen.dart';
|
||||||
|
export './bottom_navigation_bar_layout_cubit_screen_crud.dart';
|
||||||
|
export './bottom_navigation_bar_layout_cubit_screen_crud_item.dart';
|
||||||
|
export './bottom_navigation_bar_layout_cubit_screen_crud_list.dart';
|
@ -16,23 +16,27 @@
|
|||||||
|
|
||||||
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/src/presentation/cubit_screen_base.dart';
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class BottomBarLayoutCubitConsumerScreen<
|
abstract class BottomNavigationBarLayoutCubitScreen<
|
||||||
Cubit extends bloc_base.Cubit<State>,
|
Cubit extends bloc_base.Cubit<State>,
|
||||||
State extends Object> extends CubitConsumerScreen<Cubit, State> {
|
State extends Object> extends CubitScreenBase<Cubit, State> {
|
||||||
const BottomBarLayoutCubitConsumerScreen({
|
const BottomNavigationBarLayoutCubitScreen({
|
||||||
this.currentIndex,
|
this.custom,
|
||||||
|
this.height = 60,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final int? currentIndex;
|
final double height;
|
||||||
|
final BottomNavigationBarComponent? Function(BottomNavigationBarComponent?)?
|
||||||
|
custom;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) =>
|
Widget parent(BuildContext context, Widget child) =>
|
||||||
BottomNavigationBarLayout(
|
BottomNavigationBarLayout(
|
||||||
currentIndex: currentIndex,
|
custom: custom,
|
||||||
body: child,
|
body: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -16,23 +16,19 @@
|
|||||||
|
|
||||||
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/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen.dart';
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class CrudCubitConsumerScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
abstract class BottomNavigationBarLayoutCubitScreenCrud<
|
||||||
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>,
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
T extends Object?> extends CubitConsumerScreen<Cubit, CrudState>
|
CrudSuccessType extends CrudSuccess>
|
||||||
with CrudMixin<Cubit, CrudListLoaded<T>> {
|
extends BottomNavigationBarLayoutCubitScreen<Cubit, CrudState>
|
||||||
const CrudListCubitConsumerScreen({super.key});
|
with CrudMixin<Cubit, CrudSuccessType> {
|
||||||
|
const BottomNavigationBarLayoutCubitScreenCrud({
|
||||||
|
super.custom,
|
||||||
|
super.height,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
Widget onBuild(BuildContext context, CrudState state) =>
|
@ -0,0 +1,30 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class BottomNavigationBarLayoutCubitScreenCrudItem<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>, SuccessItem extends Object?>
|
||||||
|
extends BottomNavigationBarLayoutCubitScreenCrud<Cubit,
|
||||||
|
CrudLoaded<SuccessItem>> {
|
||||||
|
const BottomNavigationBarLayoutCubitScreenCrudItem({
|
||||||
|
super.custom,
|
||||||
|
super.height = 60,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/src/presentation/bottom_navigation_bar_bloc_layout/bottom_navigation_bar_layout_cubit_screen_crud.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class BottomNavigationBarLayoutCubitScreenCrudList<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>, SuccessItem extends Object?>
|
||||||
|
extends BottomNavigationBarLayoutCubitScreenCrud<Cubit,
|
||||||
|
CrudLoaded<SuccessItem>> {
|
||||||
|
const BottomNavigationBarLayoutCubitScreenCrudList({
|
||||||
|
super.custom,
|
||||||
|
super.height = 60,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
}
|
@ -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/widgets.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,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);
|
|
||||||
}
|
|
@ -14,6 +14,10 @@
|
|||||||
// 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 'app_bar_layout_cubit_screen.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
export 'bottom_bar_layout_cubit_screen.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
export 'frame_layout_cubit_screen.dart';
|
|
||||||
|
abstract class CubitScreenBase<Cubit extends bloc_base.Cubit<State>,
|
||||||
|
State extends Object> extends CubitScreen<Cubit, State> {
|
||||||
|
const CubitScreenBase({super.key});
|
||||||
|
}
|
@ -16,22 +16,15 @@
|
|||||||
|
|
||||||
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 CubitScreenCrudBase<Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
State extends Object> extends CubitScreen<Cubit, State> {
|
CrudSuccessType extends CrudSuccess>
|
||||||
const BottomBarLayoutCubitScreen({
|
extends CubitScreenBase<Cubit, CrudState>
|
||||||
this.currentIndex,
|
with CrudMixin<Cubit, CrudSuccessType> {
|
||||||
super.key,
|
const CubitScreenCrudBase({super.key});
|
||||||
});
|
|
||||||
|
|
||||||
final int? currentIndex;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) =>
|
Widget onBuild(BuildContext context, CrudState state) =>
|
||||||
BottomNavigationBarLayout(
|
crudBuilder(context, state);
|
||||||
currentIndex: currentIndex,
|
|
||||||
body: child,
|
|
||||||
);
|
|
||||||
}
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class CubitScreenCrudItemBase<Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T extends Object?> extends CubitScreenCrudBase<Cubit, CrudLoaded<T>> {
|
||||||
|
const CubitScreenCrudItemBase({super.key});
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class CubitScreenCrudListBase<Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
T extends Object?> extends CubitScreenCrudBase<Cubit, CrudListLoaded<T>> {
|
||||||
|
const CubitScreenCrudListBase({super.key});
|
||||||
|
}
|
@ -14,7 +14,8 @@
|
|||||||
// 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 './app_bar_layout_crud_cubit_consumer_screen.dart';
|
export './frame_bloc_layout.dart';
|
||||||
export './bottom_bar_layout_crud_cubit_consumer_screen.dart';
|
export './frame_layout_cubit_screen.dart';
|
||||||
export './crud_cubit_consumer_screen.dart';
|
export './frame_layout_cubit_screen_crud.dart';
|
||||||
export './frame_layout_crud_cubit_consumer_screen.dart';
|
export './frame_layout_cubit_screen_crud_item.dart';
|
||||||
|
export './frame_layout_cubit_screen_crud_list.dart';
|
@ -16,28 +16,29 @@
|
|||||||
|
|
||||||
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/src/presentation/cubit_screen_base.dart';
|
||||||
|
|
||||||
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 FrameLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
|
||||||
State extends Object> extends CubitScreen<Cubit, State> {
|
State extends Object> extends CubitScreenBase<Cubit, State> {
|
||||||
const FrameLayoutCubitScreen({
|
const FrameLayoutCubitScreen({
|
||||||
this.title,
|
this.customAppBar,
|
||||||
this.leading,
|
this.customBottomNavBar,
|
||||||
this.actions,
|
this.height = 60,
|
||||||
this.currentIndex,
|
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final int? currentIndex;
|
final TopAppBarComponent? Function(TopAppBarComponent?)? customAppBar;
|
||||||
final String? title;
|
final BottomNavigationBarComponent? Function(BottomNavigationBarComponent?)?
|
||||||
final Widget? leading;
|
customBottomNavBar;
|
||||||
final List<Widget>? actions;
|
final double height;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
||||||
title: title,
|
customAppBar: customAppBar,
|
||||||
currentIndex: currentIndex,
|
customBottomNavBar: customBottomNavBar,
|
||||||
|
height: height,
|
||||||
body: child,
|
body: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -16,22 +16,20 @@
|
|||||||
|
|
||||||
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/src/presentation/frame_bloc_layout/frame_layout_cubit_screen.dart';
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class CrudCubitScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
abstract class FrameLayoutCubitScreenCrud<
|
||||||
T extends Object?> extends CubitScreen<Cubit, CrudState>
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
with CrudMixin<Cubit, CrudLoaded<T>> {
|
CrudSuccessType extends CrudSuccess>
|
||||||
const CrudCubitScreen({super.key});
|
extends FrameLayoutCubitScreen<Cubit, CrudState>
|
||||||
|
with CrudMixin<Cubit, CrudSuccessType> {
|
||||||
@override
|
const FrameLayoutCubitScreenCrud({
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
super.customAppBar,
|
||||||
crudBuilder(context, state);
|
super.customBottomNavBar,
|
||||||
}
|
super.height,
|
||||||
|
super.key,
|
||||||
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
|
@override
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
Widget onBuild(BuildContext context, CrudState state) =>
|
@ -0,0 +1,29 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class FrameLayoutCubitScreenCrudItem<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>, SuccessItem extends Object?>
|
||||||
|
extends FrameLayoutCubitScreenCrud<Cubit, CrudLoaded<SuccessItem>> {
|
||||||
|
const FrameLayoutCubitScreenCrudItem({
|
||||||
|
super.customAppBar,
|
||||||
|
super.customBottomNavBar,
|
||||||
|
super.height = 60,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class FrameLayoutCubitScreenCrudList<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>, SuccessItem extends Object?>
|
||||||
|
extends FrameLayoutCubitScreenCrud<Cubit, CrudListLoaded<SuccessItem>> {
|
||||||
|
const FrameLayoutCubitScreenCrudList({
|
||||||
|
super.customAppBar,
|
||||||
|
super.customBottomNavBar,
|
||||||
|
super.height = 60,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
}
|
@ -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 './bottom_navigation_bar_bloc_layout/bottom_navigation_bar_bloc_layout.dart';
|
||||||
export 'screens/screens.dart';
|
export './cubit_screen_base.dart';
|
||||||
|
export './cubit_screen_crud_base.dart';
|
||||||
|
export './cubit_screen_crud_item_base.dart';
|
||||||
|
export './cubit_screen_crud_list_base.dart';
|
||||||
|
export './frame_bloc_layout/frame_bloc_layout.dart';
|
||||||
|
export './top_app_bar_bloc_layout/top_app_bar_bloc_layout.dart';
|
||||||
|
export './top_navigation_bar_bloc_layout/top_navigation_bar_bloc_layout.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/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 './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';
|
|
@ -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);
|
|
||||||
}
|
|
@ -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';
|
|
@ -14,6 +14,8 @@
|
|||||||
// 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 './app_bar_layout_cubit_consumer_screen.dart';
|
export './top_app_bar_bloc_layout.dart';
|
||||||
export './bottom_bar_layout_cubit_consumer_screen.dart';
|
export './top_app_bar_layout_cubit_screen.dart';
|
||||||
export './frame_layout_cubit_consumer_screen.dart';
|
export './top_app_bar_layout_cubit_screen_crud.dart';
|
||||||
|
export './top_app_bar_layout_cubit_screen_crud_item.dart';
|
||||||
|
export './top_app_bar_layout_cubit_screen_crud_list.dart';
|
@ -16,29 +16,25 @@
|
|||||||
|
|
||||||
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/src/presentation/cubit_screen_base.dart';
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class FrameLayoutCubitConsumerScreen<
|
abstract class TopAppBarLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
|
||||||
Cubit extends bloc_base.Cubit<State>,
|
State extends Object> extends CubitScreenBase<Cubit, State> {
|
||||||
State extends Object> extends CubitConsumerScreen<Cubit, State> {
|
const TopAppBarLayoutCubitScreen({
|
||||||
const FrameLayoutCubitConsumerScreen({
|
this.custom,
|
||||||
this.title,
|
this.height = 60,
|
||||||
this.leading,
|
|
||||||
this.actions,
|
|
||||||
this.currentIndex,
|
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final int? currentIndex;
|
final double height;
|
||||||
final String? title;
|
final TopAppBarComponent? Function(TopAppBarComponent?)? custom;
|
||||||
final Widget? leading;
|
|
||||||
final List<Widget>? actions;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
Widget parent(BuildContext context, Widget child) => TopAppBarLayout(
|
||||||
title: title,
|
height: height,
|
||||||
currentIndex: currentIndex,
|
custom: custom,
|
||||||
body: child,
|
body: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
// 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/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class TopAppBarLayoutCubitScreenCrud<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
|
CrudSuccessType extends CrudSuccess>
|
||||||
|
extends TopAppBarLayoutCubitScreen<Cubit, CrudState>
|
||||||
|
with CrudMixin<Cubit, CrudSuccessType> {
|
||||||
|
const TopAppBarLayoutCubitScreenCrud({
|
||||||
|
super.custom,
|
||||||
|
super.height,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget onBuild(BuildContext context, CrudState state) =>
|
||||||
|
crudBuilder(context, state);
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class TopAppBarLayoutCubitScreenCrudItem<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>, SuccessItem extends Object?>
|
||||||
|
extends TopAppBarLayoutCubitScreenCrud<Cubit, CrudLoaded<SuccessItem>> {
|
||||||
|
const TopAppBarLayoutCubitScreenCrudItem({
|
||||||
|
super.custom,
|
||||||
|
super.height = 60,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/src/presentation/top_app_bar_bloc_layout/top_app_bar_layout_cubit_screen_crud.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class TopAppBarLayoutCubitScreenCrudList<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>, SuccessItem extends Object?>
|
||||||
|
extends TopAppBarLayoutCubitScreenCrud<Cubit, CrudLoaded<SuccessItem>> {
|
||||||
|
const TopAppBarLayoutCubitScreenCrudList({
|
||||||
|
super.custom,
|
||||||
|
super.height = 60,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
}
|
@ -14,5 +14,8 @@
|
|||||||
// 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 'bases/bases.dart';
|
export './top_navigation_bar_bloc_layout.dart';
|
||||||
export 'crud/crud.dart';
|
export './top_navigation_bar_layout_cubit_screen.dart';
|
||||||
|
export './top_navigation_bar_layout_cubit_screen_crud.dart';
|
||||||
|
export './top_navigation_bar_layout_cubit_screen_crud_item.dart';
|
||||||
|
export './top_navigation_bar_layout_cubit_screen_crud_list.dart';
|
@ -16,26 +16,26 @@
|
|||||||
|
|
||||||
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/src/presentation/cubit_screen_base.dart';
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class AppBarLayoutCubitConsumerScreen<
|
abstract class TopNavigationBarLayoutCubitScreen<
|
||||||
Cubit extends bloc_base.Cubit<State>,
|
Cubit extends bloc_base.Cubit<State>,
|
||||||
State extends Object> extends CubitConsumerScreen<Cubit, State> {
|
State extends Object> extends CubitScreenBase<Cubit, State> {
|
||||||
const AppBarLayoutCubitConsumerScreen({
|
const TopNavigationBarLayoutCubitScreen({
|
||||||
this.title,
|
this.custom,
|
||||||
this.leading,
|
this.height = 60,
|
||||||
this.actions,
|
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String? title;
|
final double height;
|
||||||
final Widget? leading;
|
final TopNavigationBarComponent? Function(TopNavigationBarComponent?)? custom;
|
||||||
final List<Widget>? actions;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
Widget parent(BuildContext context, Widget child) => TopNavigationBarLayout(
|
||||||
title: title,
|
height: height,
|
||||||
|
custom: custom,
|
||||||
body: child,
|
body: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -16,25 +16,20 @@
|
|||||||
|
|
||||||
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 TopNavigationBarLayoutCubitScreenCrud<
|
||||||
State extends Object> extends CubitScreen<Cubit, State> {
|
Cubit extends bloc_base.Cubit<CrudState>,
|
||||||
const AppBarLayoutCubitScreen({
|
CrudSuccessType extends CrudSuccess>
|
||||||
this.title,
|
extends TopNavigationBarLayoutCubitScreen<Cubit, CrudState>
|
||||||
this.leading,
|
with CrudMixin<Cubit, CrudSuccessType> {
|
||||||
this.actions,
|
const TopNavigationBarLayoutCubitScreenCrud({
|
||||||
|
super.custom,
|
||||||
|
super.height,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String? title;
|
|
||||||
final Widget? leading;
|
|
||||||
final List<Widget>? actions;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
Widget onBuild(BuildContext context, CrudState state) =>
|
||||||
title: title,
|
crudBuilder(context, state);
|
||||||
body: child,
|
|
||||||
);
|
|
||||||
}
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class TopNavigationBarLayoutCubitScreenCrudItem<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>, SuccessItem extends Object?>
|
||||||
|
extends TopNavigationBarLayoutCubitScreenCrud<Cubit,
|
||||||
|
CrudLoaded<SuccessItem>> {
|
||||||
|
const TopNavigationBarLayoutCubitScreenCrudItem({
|
||||||
|
super.custom,
|
||||||
|
super.height = 60,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
// 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_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
import 'package:wyatt_bloc_layout/src/presentation/top_navigation_bar_bloc_layout/top_navigation_bar_layout_cubit_screen_crud.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
|
abstract class TopNavigationBarLayoutCubitScreenCrudList<
|
||||||
|
Cubit extends bloc_base.Cubit<CrudState>, SuccessItem extends Object?>
|
||||||
|
extends TopNavigationBarLayoutCubitScreenCrud<Cubit,
|
||||||
|
CrudLoaded<SuccessItem>> {
|
||||||
|
const TopNavigationBarLayoutCubitScreenCrudList({
|
||||||
|
super.custom,
|
||||||
|
super.height = 60,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
}
|
@ -15,6 +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 './bottom_navigation_bar_component.dart';
|
export './bottom_navigation_bar_component.dart';
|
||||||
export './top_navigation_bar_component.dart';
|
|
||||||
export './top_app_bar_component.dart';
|
export './top_app_bar_component.dart';
|
||||||
export './top_bar_component.dart';
|
export './top_bar_component.dart';
|
||||||
|
export './top_navigation_bar_component.dart';
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
import 'package:wyatt_ui_components/src/domain/entities/bars/top_bar_component.dart';
|
|
||||||
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
part 'top_navigation_bar_component.g.dart';
|
part 'top_navigation_bar_component.g.dart';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user