chore: fix and format using melos
This commit is contained in:
@@ -92,7 +92,6 @@ class MyHomePage extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
@@ -121,9 +120,7 @@ class MyHomePage extends StatelessWidget {
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<UserCubit>()
|
||||
.query([LimitQuery(2)]);
|
||||
context.read<UserCubit>().query([LimitQuery(2)]);
|
||||
},
|
||||
child: const Text("Query"),
|
||||
),
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
-1
@@ -24,7 +24,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/query.dart';
|
||||
|
||||
class CrudInMemoryDataSourceImpl<Model extends ObjectModel>
|
||||
extends CrudDataSource<Model> {
|
||||
|
||||
CrudInMemoryDataSourceImpl({required this.toMap, Map<String, Model>? data})
|
||||
: _data = data ?? {};
|
||||
final Map<String, Model> _data;
|
||||
|
||||
-1
@@ -22,7 +22,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/query.dart';
|
||||
|
||||
class CrudFirestoreDataSourceImpl<Model extends ObjectModel, Entity>
|
||||
extends CrudDataSource<Model> {
|
||||
|
||||
CrudFirestoreDataSourceImpl(
|
||||
String collection, {
|
||||
required Model Function(
|
||||
|
||||
@@ -23,7 +23,6 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||
|
||||
class CrudRepositoryImpl<Model extends ObjectModel>
|
||||
extends CrudRepository<Model> {
|
||||
|
||||
CrudRepositoryImpl({
|
||||
required CrudDataSource<Model> crudDataSource,
|
||||
}) : _crudDataSource = crudDataSource;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ abstract class QueryParser<Q> {
|
||||
abstract class QueryInterface extends Entity {}
|
||||
|
||||
class WhereQuery<Value> extends QueryInterface {
|
||||
|
||||
WhereQuery(this.type, this.field, this.value);
|
||||
final WhereQueryType type;
|
||||
final String field;
|
||||
@@ -33,13 +32,11 @@ class WhereQuery<Value> extends QueryInterface {
|
||||
}
|
||||
|
||||
class LimitQuery extends QueryInterface {
|
||||
|
||||
LimitQuery(this.limit);
|
||||
final int limit;
|
||||
}
|
||||
|
||||
class OrderByQuery extends QueryInterface {
|
||||
|
||||
OrderByQuery(this.field, {this.ascending = true});
|
||||
final String field;
|
||||
final bool ascending;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/object_model.dart';
|
||||
import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart';
|
||||
|
||||
class Delete<Model extends ObjectModel> extends AsyncUseCase<String, void> {
|
||||
|
||||
Delete(this._crudRepository);
|
||||
final CrudRepository<Model> _crudRepository;
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/object_model.dart';
|
||||
import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart';
|
||||
|
||||
class DeleteAll<Model extends ObjectModel> extends AsyncUseCase<void, void> {
|
||||
|
||||
DeleteAll(this._crudRepository);
|
||||
final CrudRepository<Model> _crudRepository;
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import 'package:wyatt_crud_bloc/src/domain/entities/object_model.dart';
|
||||
import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart';
|
||||
|
||||
class Get<Model extends ObjectModel> extends AsyncUseCase<String, Model?> {
|
||||
|
||||
Get(this._crudRepository);
|
||||
final CrudRepository<Model> _crudRepository;
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart';
|
||||
|
||||
class GetAll<Model extends ObjectModel>
|
||||
extends AsyncUseCase<void, List<Model?>> {
|
||||
|
||||
GetAll(this._crudRepository);
|
||||
final CrudRepository<Model> _crudRepository;
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import 'package:wyatt_crud_bloc/src/domain/entities/query.dart';
|
||||
class StreamParameters {
|
||||
final String? id;
|
||||
final List<QueryInterface>? conditions;
|
||||
|
||||
|
||||
StreamParameters({
|
||||
this.id,
|
||||
this.conditions,
|
||||
|
||||
@@ -19,7 +19,7 @@ class UpdateParameters<Model> {
|
||||
final String id;
|
||||
final Model? object;
|
||||
final Map<String, dynamic>? raw;
|
||||
|
||||
|
||||
UpdateParameters({
|
||||
required this.id,
|
||||
this.object,
|
||||
|
||||
@@ -23,7 +23,6 @@ import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart';
|
||||
|
||||
class Query<Model extends ObjectModel>
|
||||
extends AsyncUseCase<List<QueryInterface>, List<Model?>> {
|
||||
|
||||
Query(this._crudRepository);
|
||||
final CrudRepository<Model> _crudRepository;
|
||||
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
// class Stream<Model extends ObjectModel> extends UseCase<StreamParameters, List<Model?>> {
|
||||
// class Stream<Model extends ObjectModel> extends UseCase<StreamParameters,
|
||||
//List<Model?>> {
|
||||
// final CrudRepository<Model> _crudRepository;
|
||||
|
||||
// Stream(this._crudRepository);
|
||||
@@ -38,7 +37,8 @@
|
||||
// throw ClientException('Stream parameters cannot be null.');
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// @override
|
||||
// FutureOrResult<Stream<List<Model?>>> call(StreamParameters? params) => _crudRepository.stream();
|
||||
// FutureOrResult<Stream<List<Model?>>> call(StreamParameters? params) =>
|
||||
// _crudRepository.stream();
|
||||
// }
|
||||
|
||||
@@ -23,7 +23,6 @@ import 'package:wyatt_crud_bloc/src/domain/usecases/params/update_parameters.dar
|
||||
|
||||
class Update<Model extends ObjectModel>
|
||||
extends AsyncUseCase<UpdateParameters<Model>, void> {
|
||||
|
||||
Update(this._crudRepository);
|
||||
final CrudRepository<Model> _crudRepository;
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import 'package:wyatt_crud_bloc/src/domain/repositories/crud_repository.dart';
|
||||
|
||||
class UpdateAll<Model extends ObjectModel>
|
||||
extends AsyncUseCase<Map<String, Object?>, void> {
|
||||
|
||||
UpdateAll(this._crudRepository);
|
||||
final CrudRepository<Model> _crudRepository;
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ import 'package:wyatt_crud_bloc/src/domain/usecases/update_all.dart';
|
||||
part 'crud_state.dart';
|
||||
|
||||
abstract class CrudCubit<Model extends ObjectModel> extends Cubit<CrudState> {
|
||||
|
||||
CrudCubit() : super(CrudInitial());
|
||||
Create<Model>? get crudCreate;
|
||||
DeleteAll<Model>? get crudDeleteAll;
|
||||
|
||||
@@ -36,7 +36,6 @@ class CrudOkReturn extends CrudState {
|
||||
}
|
||||
|
||||
class CrudError extends CrudState {
|
||||
|
||||
const CrudError(this.message);
|
||||
final String? message;
|
||||
|
||||
@@ -45,7 +44,6 @@ class CrudError extends CrudState {
|
||||
}
|
||||
|
||||
class CrudLoaded<T> extends CrudSuccess {
|
||||
|
||||
const CrudLoaded(this.data);
|
||||
final T? data;
|
||||
|
||||
@@ -54,7 +52,6 @@ class CrudLoaded<T> extends CrudSuccess {
|
||||
}
|
||||
|
||||
class CrudListLoaded<T> extends CrudSuccess {
|
||||
|
||||
const CrudListLoaded(this.data);
|
||||
final List<T?> data;
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user