Skip to content

Commit 7d330f6

Browse files
authored
Merge #318: 2.4.0-dev.0
❄️ All models with Freezed
2 parents 0326d3b + 056c6fd commit 7d330f6

File tree

637 files changed

+82416
-13840
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

637 files changed

+82416
-13840
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ pubspec.lock
1111

1212
# IntelliJ IDEA files.
1313
/.idea/*
14+
15+
# macOS system files
16+
.DS_Store

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 2.4.0-dev.0
2+
3+
- All Telegram Models are now built with Freezed.
4+
- Breaking: `Keyboard` & `InlineKeyboard` usage. [Check this PR comment for details](https://github.com/xooniverse/televerse/pull/318#issuecomment-2662189756).
5+
16
# 2.3.0
27

38
- 🤖 Bot API 8.3

analysis_options.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ linter:
88
- public_member_api_docs
99
- slash_for_doc_comments
1010
- unnecessary_library_directive
11-
- require_trailing_commas
11+
# - require_trailing_commas
1212

1313
analyzer:
1414
errors:

build.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
targets:
2+
$default:
3+
builders:
4+
freezed:
5+
options:
6+
format: true
7+
equal: false
8+
when: false
9+
json_serializable:
10+
options:
11+
include_if_null: false

example/example.dart

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import 'package:televerse/televerse.dart';
2+
3+
final api = RawAPI("token");
4+
final chatId = ChatID(12345);
5+
void main(List<String> args) async {}
+2-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
part of 'models.dart';
1+
import 'package:televerse/src/telegram/models/chat.dart';
2+
import 'package:televerse/src/telegram/models/user.dart';
23

34
/// The base class for all the models that have a chat.
45
abstract class WithChat {
@@ -17,24 +18,3 @@ abstract class WithID {
1718
/// The user who triggered the event.
1819
int get id;
1920
}
20-
21-
/// Null filter function.
22-
bool _nullFilter(String _, dynamic value) => value == null;
23-
24-
/// A helper method to parse a nested object from JSON.
25-
T? _parseJson<T>(
26-
Map<String, dynamic>? json,
27-
T Function(Map<String, dynamic>) fromJson,
28-
) {
29-
if (json == null) return null;
30-
return fromJson(json);
31-
}
32-
33-
/// A helper method to parse a list of nested objects from JSON.
34-
List<T>? _parseList<T>(
35-
List<dynamic>? json,
36-
T Function(Map<String, dynamic>) fromJson,
37-
) {
38-
if (json == null) return null;
39-
return (json).map((e) => fromJson(e as Map<String, dynamic>)).toList();
40-
}

lib/src/telegram/models/abstracts/background_fill.dart

-24
This file was deleted.

lib/src/telegram/models/abstracts/background_type_fill.dart

-24
This file was deleted.

lib/src/telegram/models/abstracts/bot_command_scope.dart

-17
This file was deleted.

lib/src/telegram/models/abstracts/chat_boost_source.dart

-25
This file was deleted.

lib/src/telegram/models/abstracts/chat_member.dart

-45
This file was deleted.

lib/src/telegram/models/abstracts/input_media.dart

-27
This file was deleted.

lib/src/telegram/models/abstracts/input_message_content.dart

-46
This file was deleted.

lib/src/telegram/models/abstracts/input_paid_media.dart

-23
This file was deleted.

lib/src/telegram/models/abstracts/maybe_inaccessible_message.dart

-48
This file was deleted.

lib/src/telegram/models/abstracts/menu_button.dart

-25
This file was deleted.

0 commit comments

Comments
 (0)