chore(repo): add lints, update freezed, json_serializable

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2022-05-16 16:58:24 +05:30
committed by xsahil03x
parent 2499755a05
commit 069f380f41
170 changed files with 616 additions and 737 deletions
@@ -52,10 +52,10 @@ class StreamExample extends StatelessWidget {
/// To initialize this example, an instance of
/// [client] and [channel] is required.
const StreamExample({
Key? key,
super.key,
required this.client,
required this.channel,
}) : super(key: key);
});
/// Instance of [StreamChatClient] we created earlier.
/// This contains information about our application and connection state.
@@ -76,9 +76,9 @@ class StreamExample extends StatelessWidget {
class HomeScreen extends StatelessWidget {
/// [HomeScreen] is constructed using the [Channel] we defined earlier.
const HomeScreen({
Key? key,
super.key,
required this.channel,
}) : super(key: key);
});
/// Channel object containing the [Channel.id] we'd like to observe.
final Channel channel;
@@ -129,10 +129,10 @@ class HomeScreen extends StatelessWidget {
class MessageView extends StatefulWidget {
/// Message takes the latest list of messages and the current channel.
const MessageView({
Key? key,
super.key,
required this.messages,
required this.channel,
}) : super(key: key);
});
/// List of messages sent in the given channel.
final List<Message> messages;
@@ -12,7 +12,7 @@ part 'channel_dao.g.dart';
class ChannelDao extends DatabaseAccessor<DriftChatDatabase>
with _$ChannelDaoMixin {
/// Creates a new channel dao instance
ChannelDao(DriftChatDatabase db) : super(db);
ChannelDao(super.db);
/// Get channel by cid
Future<ChannelModel?> getChannelByCid(String cid) async =>
@@ -15,7 +15,7 @@ part 'channel_query_dao.g.dart';
class ChannelQueryDao extends DatabaseAccessor<DriftChatDatabase>
with _$ChannelQueryDaoMixin {
/// Creates a new channel query dao instance
ChannelQueryDao(DriftChatDatabase db) : super(db);
ChannelQueryDao(super.db);
String _computeHash(Filter? filter) {
if (filter == null) {
@@ -12,7 +12,7 @@ part 'connection_event_dao.g.dart';
class ConnectionEventDao extends DatabaseAccessor<DriftChatDatabase>
with _$ConnectionEventDaoMixin {
/// Creates a new connection event dao instance
ConnectionEventDao(DriftChatDatabase db) : super(db);
ConnectionEventDao(super.db);
/// Get the latest stored connection event
Future<Event?> get connectionEvent => select(connectionEvents)
@@ -14,7 +14,7 @@ part 'member_dao.g.dart';
class MemberDao extends DatabaseAccessor<DriftChatDatabase>
with _$MemberDaoMixin {
/// Creates a new member dao instance
MemberDao(DriftChatDatabase db) : super(db);
MemberDao(super.db);
/// Get all members where [Members.channelCid] matches [cid]
Future<List<Member>> getMembersByCid(String cid) async =>
@@ -12,7 +12,7 @@ part 'pinned_message_reaction_dao.g.dart';
class PinnedMessageReactionDao extends DatabaseAccessor<DriftChatDatabase>
with _$PinnedMessageReactionDaoMixin {
/// Creates a new reaction dao instance
PinnedMessageReactionDao(DriftChatDatabase db) : super(db);
PinnedMessageReactionDao(super.db);
/// Returns all the reactions of a particular message by matching
/// [Reactions.messageId] with [messageId]
@@ -12,7 +12,7 @@ part 'reaction_dao.g.dart';
class ReactionDao extends DatabaseAccessor<DriftChatDatabase>
with _$ReactionDaoMixin {
/// Creates a new reaction dao instance
ReactionDao(DriftChatDatabase db) : super(db);
ReactionDao(super.db);
/// Returns all the reactions of a particular message by matching
/// [Reactions.messageId] with [messageId]
@@ -11,7 +11,7 @@ part 'read_dao.g.dart';
@DriftAccessor(tables: [Reads, Users])
class ReadDao extends DatabaseAccessor<DriftChatDatabase> with _$ReadDaoMixin {
/// Creates a new read dao instance
ReadDao(DriftChatDatabase db) : super(db);
ReadDao(super.db);
/// Get all reads where [Reads.channelCid] matches [cid]
Future<List<Read>> getReadsByCid(String cid) async => (select(reads).join([
@@ -10,7 +10,7 @@ part 'user_dao.g.dart';
@DriftAccessor(tables: [Users])
class UserDao extends DatabaseAccessor<DriftChatDatabase> with _$UserDaoMixin {
/// Creates a new user dao instance
UserDao(DriftChatDatabase db) : super(db);
UserDao(super.db);
/// Updates the users data with the new [userList] data
Future<void> updateUsers(List<User> userList) => batch(