5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import cloud_firestore
9 | import connectivity_plus
10 | import file_selector_macos
11 | import firebase_auth
12 | import firebase_core
13 | import firebase_messaging
14 | import firebase_storage
15 | import flutter_local_notifications
16 | import google_sign_in_ios
17 | import local_auth_darwin
18 | import network_info_plus
19 | import package_info_plus
20 | import path_provider_foundation
21 | import rive_common
22 | import shared_preferences_foundation
23 | import sqflite
24 | import url_launcher_macos
25 |
26 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
27 | FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
28 | ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
29 | FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
30 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
31 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
32 | FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
33 | FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
34 | FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
35 | FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
36 | FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin"))
37 | NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin"))
38 | FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
39 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
40 | RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin"))
41 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
42 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
43 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
44 | }
45 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = chatchat
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.chatchat
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved.
15 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import FlutterMacOS
2 | import Cocoa
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | .fvm/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | build/
33 |
34 |
35 |
36 | # Android related
37 | **/android/**/gradle-wrapper.jar
38 | **/android/.gradle
39 | **/android/captures/
40 | **/android/gradlew
41 | **/android/gradlew.bat
42 | **/android/local.properties
43 | **/android/**/GeneratedPluginRegistrant.java
44 |
45 | # iOS/XCode related
46 | **/ios/**/*.mode1v3
47 | **/ios/**/*.mode2v3
48 | **/ios/**/*.moved-aside
49 | **/ios/**/*.pbxuser
50 | **/ios/**/*.perspectivev3
51 | **/ios/**/*sync/
52 | **/ios/**/.sconsign.dblite
53 | **/ios/**/.tags*
54 | **/ios/**/.vagrant/
55 | **/ios/**/DerivedData/
56 | **/ios/**/Icon?
57 | **/ios/**/Pods/
58 | **/ios/**/.symlinks/
59 | **/ios/**/profile
60 | **/ios/**/xcuserdata
61 | **/ios/.generated/
62 | **/ios/Flutter/App.framework
63 | **/ios/Flutter/Flutter.framework
64 | **/ios/Flutter/Flutter.podspec
65 | **/ios/Flutter/Generated.xcconfig
66 | **/ios/Flutter/app.flx
67 | **/ios/Flutter/app.zip
68 | **/ios/Flutter/flutter_assets/
69 | **/ios/Flutter/flutter_export_environment.sh
70 | **/ios/ServiceDefinitions.json
71 | **/ios/Runner/GeneratedPluginRegistrant.*
72 |
73 | # Exceptions to above rules.
74 | !**/ios/**/default.mode1v3
75 | !**/ios/**/default.mode2v3
76 | !**/ios/**/default.pbxuser
77 | !**/ios/**/default.perspectivev3
78 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
79 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 0b8abb4724aa590dd0f429683339b1e045a1594d
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [1.6.0] - 20/01/2024
2 |
3 | ### For Message Bar
4 | * Customizable text style for message bar text
5 |
6 | ### For BubbleNormal Widget
7 |
8 | * Added optional [leading] widget for _non senders_
9 | * Added optional [trailing] widget for _sender_
10 | * Added [margin] and [padding] properties
11 | * Added tap callbacks such as [onTap], [onDoubleTap] and [onLongPress].
12 | * Changes the texts to selectable texts
13 |
14 | ### For BubbleNormalImage Widget
15 |
16 | BubbleNormalImage Widget-
17 | * Added optional [leading] widget for _non senders_
18 | * Added optional [trailing] widget for _sender_
19 | * Added [margin] and [padding] parameters
20 | * Added Tap Callbacks such as [onTap] and [onLongPress].
21 |
22 | ### For DateChip Widget
23 | * Fixes [DateChip] taking full width
24 |
25 | ### Other
26 | * Updated the environment to allow support for latest dart sdks
27 | * Updated the documentation within code to be easier to read
28 |
29 | ## [1.5.0] - 11/08/2023
30 |
31 | * Customizable constrains for bubbles
32 | * Customizable message bar hint text
33 | * Customizable message bar hint style
34 | * Update the example
35 |
36 | ## [1.4.1] - 26/01/2023
37 |
38 | * Support up-to-date dependencies
39 |
40 | ## [1.4.0] - 29/12/2022
41 |
42 | * Add `BubbleNormalImage` image chat bubble widget
43 |
44 | ## [1.3.1] - 16/08/2022
45 |
46 | * Support up-to-date dependencies
47 |
48 | ## [1.3.0] - 03/07/2022
49 |
50 | * Add `MessageBar` widget
51 |
52 | ## [1.2.0] - 04/02/2022
53 |
54 | * Add iMessage's chat bubble shape bubble widget (`BubbleSpecialThree`).
55 |
56 | ## [1.1.0] - 27/06/2021
57 |
58 | * Audio chat bubble widget(`BubbleNormalAudio`) for the bubble normal widget set.
59 |
60 | ## [1.0.0+3] - 16/05/2021
61 |
62 | * Update `README` main example code.
63 |
64 | ## [1.0.0+2] - 15/05/2021
65 |
66 | * dartfmt formatting.
67 |
68 | ## [1.0.0+1] - 15/05/2021
69 |
70 | * dartfmt formatting.
71 |
72 | ## [1.0.0] - 15/05/2021
73 |
74 | * Add `DateChip` widget
75 |
76 | ## [0.8.1] - 26/04/2021
77 |
78 | * set priority for message status tick (seen > delivered > sent)
79 |
80 | ## [0.8.0+1] - 22/03/2021
81 |
82 | * Update README.md example.
83 |
84 | ## [0.8.0] - 15/03/2021
85 |
86 | * Add the option to customize the chat bubble text styles by changing `textStyle` parameter
87 |
88 | ## [0.7.9+3] - 10/03/2021
89 |
90 | * null-safety.
91 |
92 | ## [0.7.8+2] - 21/10/2020
93 |
94 | * dartfmt formatting.
95 |
96 | ## [0.7.8+1] - 20/07/2020
97 |
98 | * Update README.md example.
99 |
100 | ## [0.7.8] - 20/07/2020
101 |
102 | * Add message states(sent, delivered, seen) flag for BubbleSpecialOne and BubbleSpecialTwo.
103 | * Update the example.
104 |
105 | ## [0.7.5+1] - 18/07/2020
106 |
107 | * Add some dartdoc comments.
108 |
109 | ## [0.7.5] - 21/06/2020
110 |
111 | * Add message states(sent, delivered, seen) flag for BubbleNormal.
112 | * Update the example.
113 |
114 | ## [0.7.1+6] - 17/05/2020
115 |
116 | * Update the example.
117 |
118 | ## [0.7.1+5] - 10/05/2020
119 |
120 | * Update README.md file.
121 |
122 | ## [0.7.1+4] - 10/05/2020
123 |
124 | * Update package description.
125 |
126 | ## [0.7.1+3] - 09/05/2020
127 |
128 | * Update package description.
129 |
130 | ## [0.7.1+2] - 09/05/2020
131 |
132 | * Update package description.
133 |
134 | ## [0.7.1+1] - 09/05/2020
135 |
136 | * Update package description.
137 |
138 | ## [0.7.1] - 09/05/2020
139 |
140 | * Update package description.
141 |
142 | ## [0.7.0] - 09/05/2020
143 |
144 | * First release with an example.
145 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributor Guidelines
2 |
3 | Thank you for your interest in contributing to our Flutter plugin! We welcome all contributions, whether it's filing an issue, creating a pull request, or helping other community members with their questions. To ensure a positive and productive experience for everyone, please review the following guidelines before contributing.
4 |
5 | ## Issues
6 |
7 | If you find a bug or have a feature request, please create an issue in the GitHub repository. Before creating an issue, please search for existing issues to avoid creating duplicates. When creating a new issue, please provide the following information:
8 |
9 | - A clear and descriptive title
10 | - A detailed description of the issue, including any error messages or stack traces
11 | - Steps to reproduce the issue
12 | - Expected behavior
13 | - Any additional information or screenshots that can help us understand the issue better
14 |
15 | ## Pull Requests
16 |
17 | We welcome pull requests from contributors of all skill levels. Before creating a pull request, please make sure that:
18 |
19 | - The code follows our [coding standards](#coding-standards).
20 | - All tests pass locally.
21 | - The pull request has a clear and descriptive title.
22 | - The pull request includes a detailed description of the changes made.
23 | - The pull request includes any necessary documentation changes.
24 |
25 | ## Coding Standards
26 |
27 | To maintain consistency and readability, we follow the [Flutter Style Guide](https://flutter.dev/docs/development/style-guide). Please make sure that your code follows these guidelines before submitting a pull request.
28 |
29 | ## License
30 |
31 | By contributing to this project, you agree that your contributions will be licensed under the [MIT License](LICENSE).
32 |
33 | ## Attribution
34 |
35 | This contributor guidelines document is adapted from the [Atom Contributor Guidelines](https://github.com/atom/atom/blob/master/CONTRIBUTING.md).
36 |
37 | ## Conclusion
38 |
39 | We value your contributions and look forward to working with you! If you have any questions, please do not hesitate to reach out to the project team or community members for help.
40 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Prabhanu Gunaweera
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/logo/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/logo/logo.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/messages/img1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/messages/img1.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/2022_12_29_main1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_12_29_main1.jpg
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/2022_12_29_main2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_12_29_main2.jpg
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/2022_2_4_main1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_2_4_main1.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/2022_2_4_main2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_2_4_main2.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/2022_7_3_main1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_7_3_main1.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/2022_7_3_main2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/2022_7_3_main2.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/audio_bubble.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/audio_bubble.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/datechip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/datechip.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/image_bubble.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/image_bubble.jpg
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/imsg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/imsg.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/imsg1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/imsg1.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/messagebar.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/messagebar.jpeg
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/screenshot_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_1.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/screenshot_1_old.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_1_old.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/screenshot_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_2.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/screenshot_2_old.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_2_old.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/screenshot_3_old.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_3_old.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/screenshot_4_old.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/screenshot_4_old.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/images/screenshots/single_bubble.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/packages/chat_bubbles/images/screenshots/single_bubble.png
--------------------------------------------------------------------------------
/packages/chat_bubbles/lib/algo/algo.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_bubbles/date_chips/date_chip.dart';
2 |
3 | import './date_chip_text.dart';
4 |
5 | ///all the algorithms of the plugin
6 | ///[dateChipText] to get the text which is need to show on the [DateChip]
7 | abstract class Algo {
8 | Algo._();
9 |
10 | static String dateChipText(final DateTime date) {
11 | final dateChipText = DateChipText(date);
12 | return dateChipText.getText();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/lib/algo/date_chip_text.dart:
--------------------------------------------------------------------------------
1 | import 'package:intl/intl.dart';
2 |
3 | ///initial formatter to find the date txt
4 | final DateFormat _formatter = DateFormat('yyyy-MM-dd');
5 |
6 | ///[DateChipText] class included with algorithms which are need to implement [DateChip]
7 | ///[date] parameter is required
8 | ///
9 | class DateChipText {
10 | final DateTime date;
11 |
12 | DateChipText(this.date);
13 |
14 | ///generate and return [DateChip] string
15 | ///
16 | ///
17 | String getText() {
18 | final now = DateTime.now();
19 | if (_formatter.format(now) == _formatter.format(date)) {
20 | return 'Today';
21 | } else if (_formatter.format(DateTime(now.year, now.month, now.day - 1)) ==
22 | _formatter.format(date)) {
23 | return 'Yesterday';
24 | } else {
25 | return '${DateFormat('d').format(date)} ${DateFormat('MMMM').format(date)} ${DateFormat('y').format(date)}';
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/lib/chat_bubbles.dart:
--------------------------------------------------------------------------------
1 | library chat_bubbles;
2 |
3 | ///
4 | /// all the widgets of the package export here
5 | /// CHAT BUBBLES
6 | /// [BubbleNormal]
7 | /// [BubbleSpecialOne]
8 | /// [BubbleSpecialTwo]
9 | /// [BubbleNormalAudio]
10 | /// [BubbleSpecialThree]
11 | /// [BubbleNormalImage]
12 | ///
13 | /// DATE CHIPS
14 | /// [DateChip]
15 | ///
16 | /// MESSAGE BARS
17 | /// [MessageBar]
18 | /// widgets UI components are currently available
19 | ///
20 | ///
21 | ///
22 | export 'bubbles/bubble_special_three.dart';
23 | export 'date_chips/date_chip.dart';
24 | export 'message_bars/message_bar.dart';
25 | export 'bubbles/bubble_normal_image.dart';
26 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/lib/date_chips/date_chip.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_bubbles/algo/algo.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | ///[DateChip] use to show the date breakers on the chat view
5 | ///[date] parameter is required
6 | ///[color] parameter is optional default color code `8AD3D5`
7 | ///
8 | ///
9 | class DateChip extends StatelessWidget {
10 | final DateTime date;
11 | final Color color;
12 | final Color dateColor;
13 |
14 | ///
15 | ///
16 | ///
17 | const DateChip({
18 | Key? key,
19 | required this.date,
20 | this.color = const Color(0x558AD3D5),
21 | this.dateColor = const Color(0x558AD3D5),
22 | }) : super(key: key);
23 | @override
24 | Widget build(BuildContext context) {
25 | return Center(
26 | child: Padding(
27 | padding: const EdgeInsets.only(
28 | top: 7,
29 | bottom: 7,
30 | ),
31 | child: Container(
32 | decoration: BoxDecoration(
33 | borderRadius: const BorderRadius.all(Radius.circular(6)),
34 | color: color,
35 | ),
36 | child: Padding(
37 | padding: const EdgeInsets.all(5.0),
38 | child: Text(
39 | Algo.dateChipText(date),
40 | style: TextStyle(
41 | color: dateColor,
42 | ),
43 | ),
44 | ),
45 | ),
46 | ),
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: chat_bubbles
2 | description: Flutter chat bubble widgets, similar to Whatsapp and more shapes. Easy to use and implement
3 | chat bubbles.
4 | version: 1.6.0
5 | homepage: https://github.com/prahack/chat_bubbles
6 |
7 | environment:
8 | sdk: ">=2.12.0 <4.0.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 | intl: ^0.19.0
14 |
15 | dev_dependencies:
16 | flutter_test:
17 | sdk: flutter
18 |
19 | screenshots:
20 | - description: The Flutter chat_bubbles package logo.
21 | path: images/logo/logo.png
22 |
23 | flutter:
24 |
25 |
--------------------------------------------------------------------------------
/packages/chat_bubbles/test/chatbubbles_test.dart:
--------------------------------------------------------------------------------
1 | void main() {}
2 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/.github/workflows/build.yaml:
--------------------------------------------------------------------------------
1 | name: build
2 |
3 | on:
4 | push:
5 | branches: [main]
6 | pull_request:
7 | branches: [main]
8 |
9 | jobs:
10 | build-and-test:
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - uses: actions/checkout@v2
15 |
16 | - name: Setup Flutter environment
17 | uses: subosito/flutter-action@v2
18 | with:
19 | channel: 'stable'
20 |
21 | - name: Install dependencies
22 | run: flutter pub get
23 |
24 | - run: dart format . --set-exit-if-changed
25 | - run: flutter analyze --no-pub
26 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.lock
4 | *.log
5 | *.pyc
6 | *.swp
7 | .DS_Store
8 | .atom/
9 | .buildlog/
10 | .history
11 | .svn/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # Visual Studio Code related
20 | .classpath
21 | .project
22 | .settings/
23 | .vscode/
24 |
25 | # Flutter repo-specific
26 | /bin/cache/
27 | /bin/internal/bootstrap.bat
28 | /bin/internal/bootstrap.sh
29 | /bin/mingit/
30 | /dev/benchmarks/mega_gallery/
31 | /dev/bots/.recipe_deps
32 | /dev/bots/android_tools/
33 | /dev/devicelab/ABresults*.json
34 | /dev/docs/doc/
35 | /dev/docs/flutter.docs.zip
36 | /dev/docs/lib/
37 | /dev/docs/pubspec.yaml
38 | /dev/integration_tests/**/xcuserdata
39 | /dev/integration_tests/**/Pods
40 | /packages/flutter/coverage/
41 | version
42 | analysis_benchmark.json
43 |
44 | # packages file containing multi-root paths
45 | .packages.generated
46 |
47 | # Flutter/Dart/Pub related
48 | **/doc/api/
49 | .dart_tool/
50 | .flutter-plugins
51 | .flutter-plugins-dependencies
52 | **/generated_plugin_registrant.dart
53 | .packages
54 | .pub-cache/
55 | .pub/
56 | build/
57 | flutter_*.png
58 | linked_*.ds
59 | unlinked.ds
60 | unlinked_spec.ds
61 |
62 | # Android related
63 | **/android/**/gradle-wrapper.jar
64 | **/android/.gradle
65 | **/android/captures/
66 | **/android/gradlew
67 | **/android/gradlew.bat
68 | **/android/local.properties
69 | **/android/**/GeneratedPluginRegistrant.java
70 | **/android/key.properties
71 | *.jks
72 |
73 | # iOS/XCode related
74 | **/ios/**/*.mode1v3
75 | **/ios/**/*.mode2v3
76 | **/ios/**/*.moved-aside
77 | **/ios/**/*.pbxuser
78 | **/ios/**/*.perspectivev3
79 | **/ios/**/*sync/
80 | **/ios/**/.sconsign.dblite
81 | **/ios/**/.tags*
82 | **/ios/**/.vagrant/
83 | **/ios/**/DerivedData/
84 | **/ios/**/Icon?
85 | **/ios/**/Pods/
86 | **/ios/**/.symlinks/
87 | **/ios/**/profile
88 | **/ios/**/xcuserdata
89 | **/ios/.generated/
90 | **/ios/Flutter/.last_build_id
91 | **/ios/Flutter/App.framework
92 | **/ios/Flutter/Flutter.framework
93 | **/ios/Flutter/Flutter.podspec
94 | **/ios/Flutter/Generated.xcconfig
95 | **/ios/Flutter/ephemeral
96 | **/ios/Flutter/app.flx
97 | **/ios/Flutter/app.zip
98 | **/ios/Flutter/flutter_assets/
99 | **/ios/Flutter/flutter_export_environment.sh
100 | **/ios/ServiceDefinitions.json
101 | **/ios/Runner/GeneratedPluginRegistrant.*
102 |
103 | # macOS
104 | **/macos/Flutter/GeneratedPluginRegistrant.swift
105 |
106 | # Coverage
107 | coverage/
108 |
109 | # Symbols
110 | app.*.symbols
111 |
112 | # Exceptions to above rules.
113 | !**/ios/**/default.mode1v3
114 | !**/ios/**/default.mode2v3
115 | !**/ios/**/default.pbxuser
116 | !**/ios/**/default.perspectivev3
117 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
118 | !/dev/ci/**/Gemfile.lock
119 | !**/ios/**/Podfile.lock
120 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Oleksandr Demchenko
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/README.md:
--------------------------------------------------------------------------------
1 | # Flutter Link Previewer
2 |
3 | [](https://pub.dartlang.org/packages/flutter_link_previewer)
4 | [](https://github.com/flyerhq/flutter_link_previewer/actions?query=workflow%3Abuild)
5 | [](https://www.codefactor.io/repository/github/flyerhq/flutter_link_previewer)
6 |
7 | Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications.
8 |
9 |
10 |
11 |
12 | 🇺🇦🇺🇦 We are Ukrainians. If you enjoy our work, please consider donating to help save our country. 🇺🇦🇺🇦
13 |
14 |
15 |
16 |
17 |
18 |
19 | ## Getting Started
20 |
21 | ```dart
22 | import 'package:flutter_link_previewer/flutter_link_previewer.dart';
23 |
24 | LinkPreview(
25 | enableAnimation: true,
26 | onPreviewDataFetched: (data) {
27 | setState(() {
28 | // Save preview data to the state
29 | });
30 | },
31 | previewData: _previewData, // Pass the preview data from the state
32 | text: 'https://flyer.chat',
33 | width: MediaQuery.of(context).size.width,
34 | )
35 | ```
36 |
37 | ## Customization
38 |
39 | ```dart
40 | final style = TextStyle(
41 | color: Colors.red,
42 | fontSize: 16,
43 | fontWeight: FontWeight.w500,
44 | height: 1.375,
45 | );
46 |
47 |
48 | LinkPreview(
49 | linkStyle: style,
50 | metadataTextStyle: style.copyWith(
51 | fontSize: 14,
52 | fontWeight: FontWeight.w400,
53 | ),
54 | metadataTitleStyle: style.copyWith(
55 | fontWeight: FontWeight.w800,
56 | ),
57 | padding: EdgeInsets.symmetric(
58 | horizontal: 24,
59 | vertical: 16,
60 | ),
61 | onPreviewDataFetched: _onPreviewDataFetched,
62 | previewData: _previewData,
63 | text: 'https://flyer.chat',
64 | textStyle: style,
65 | width: width,
66 | );
67 | ```
68 |
69 | ## License
70 |
71 | [MIT](LICENSE)
72 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | analyzer:
2 | plugins:
3 | - dart_code_metrics
4 |
5 | # This file configures the analyzer, which statically analyzes Dart code to
6 | # check for errors, warnings, and lints.
7 | #
8 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
9 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
10 | # invoked from the command line by running `flutter analyze`.
11 |
12 | # The following line activates a set of recommended lints for Flutter apps,
13 | # packages, and plugins designed to encourage good coding practices.
14 | include: package:flutter_lints/flutter.yaml
15 |
16 | linter:
17 | # The lint rules applied to this project can be customized in the
18 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
19 | # included above or to enable additional rules. A list of all available lints
20 | # and their documentation is published at
21 | # https://dart-lang.github.io/linter/lints/index.html.
22 | #
23 | # Instead of disabling a lint rule for the entire project in the
24 | # section below, it can also be suppressed for a single line of code
25 | # or a specific dart file by using the `// ignore: name_of_lint` and
26 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
27 | # producing the lint.
28 | rules:
29 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
30 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
31 | - always_declare_return_types
32 | - avoid_unused_constructor_parameters
33 | - directives_ordering
34 | - omit_local_variable_types
35 | - prefer_expression_function_bodies
36 | - prefer_final_fields
37 | - prefer_final_locals
38 | - prefer_relative_imports
39 | - prefer_single_quotes
40 | - sized_box_for_whitespace
41 | - sort_child_properties_last
42 | - sort_pub_dependencies
43 | - type_annotate_public_apis
44 | - unawaited_futures
45 | - use_named_constants
46 | - use_super_parameters
47 |
48 | # Additional information about this file can be found at
49 | # https://dart.dev/guides/language/analysis-options
50 |
51 | dart_code_metrics:
52 | rules:
53 | - always-remove-listener
54 | - avoid-unused-parameters
55 | - format-comment
56 | - member-ordering:
57 | alphabetize: false
58 | order:
59 | - constructors
60 | - public-fields
61 | - public-getters
62 | - public-setters
63 | - private-fields
64 | - private-getters
65 | - private-setters
66 | - public-methods
67 | - private-methods
68 | - no-boolean-literal-compare
69 | - prefer-trailing-comma
70 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/lib/flutter_link_previewer.dart:
--------------------------------------------------------------------------------
1 | library flutter_link_previewer;
2 |
3 | export 'src/types.dart';
4 | export 'src/utils.dart' show getPreviewData, regexEmail, regexLink;
5 | export 'src/widgets/link_preview.dart';
6 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/lib/src/types.dart:
--------------------------------------------------------------------------------
1 | import 'package:meta/meta.dart';
2 |
3 | /// Represents the size object.
4 | @immutable
5 | class Size {
6 | /// Creates [Size] from width and height.
7 | const Size({
8 | required this.height,
9 | required this.width,
10 | });
11 |
12 | /// Height.
13 | final double height;
14 |
15 | /// Width.
16 | final double width;
17 | }
18 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/lib/src/url_linkifier.dart:
--------------------------------------------------------------------------------
1 | import 'package:linkify/linkify.dart';
2 | import 'package:meta/meta.dart';
3 |
4 | final _urlRegex = RegExp(
5 | r'^(.*?)((?:https?:\/\/|www\.)[^\s/$.?#].[^\s]*)',
6 | caseSensitive: false,
7 | dotAll: true,
8 | );
9 |
10 | final _looseUrlRegex = RegExp(
11 | r'^(.*?)((https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*))',
12 | caseSensitive: false,
13 | dotAll: true,
14 | );
15 |
16 | final _protocolIdentifierRegex = RegExp(
17 | r'^(https?:\/\/)',
18 | caseSensitive: false,
19 | );
20 |
21 | /// Utility class that implements [Linkifier.parse] method.
22 | /// Used to find links in the text.
23 | class UrlLinkifier extends Linkifier {
24 | /// Default constructor.
25 | const UrlLinkifier();
26 |
27 | /// Parses text to find all links inside it.
28 | @override
29 | List parse(
30 | List elements,
31 | LinkifyOptions options,
32 | ) {
33 | final list = [];
34 |
35 | for (final element in elements) {
36 | if (element is TextElement) {
37 | var loose = false;
38 | var match = _urlRegex.firstMatch(element.text);
39 |
40 | if (match?.group(1)?.isNotEmpty == true) {
41 | final looseMatch = _looseUrlRegex.firstMatch(match!.group(1)!);
42 | if (looseMatch != null) {
43 | match = looseMatch;
44 | loose = true;
45 | }
46 | }
47 |
48 | if (match == null && options.looseUrl) {
49 | match = _looseUrlRegex.firstMatch(element.text);
50 | loose = true;
51 | }
52 |
53 | if (match == null) {
54 | list.add(element);
55 | } else {
56 | final text = element.text.replaceFirst(match.group(0)!, '');
57 |
58 | if (match.group(1)?.isNotEmpty == true) {
59 | list.add(TextElement(match.group(1)!));
60 | }
61 |
62 | if (match.group(2)?.isNotEmpty == true) {
63 | var originalUrl = match.group(2)!;
64 | String? end;
65 |
66 | if (options.excludeLastPeriod &&
67 | originalUrl[originalUrl.length - 1] == '.') {
68 | end = '.';
69 | originalUrl = originalUrl.substring(0, originalUrl.length - 1);
70 | }
71 |
72 | final url = originalUrl;
73 |
74 | if (loose || !originalUrl.startsWith(_protocolIdentifierRegex)) {
75 | originalUrl = (options.defaultToHttps ? 'https://' : 'http://') +
76 | originalUrl;
77 | }
78 |
79 | list.add(
80 | UrlElement(
81 | originalUrl,
82 | url,
83 | ),
84 | );
85 |
86 | if (end != null) {
87 | list.add(TextElement(end));
88 | }
89 | }
90 |
91 | if (text.isNotEmpty) {
92 | list.addAll(parse([TextElement(text)], options));
93 | }
94 | }
95 | } else {
96 | list.add(element);
97 | }
98 | }
99 |
100 | return list;
101 | }
102 | }
103 |
104 | /// Represents an element containing a link.
105 | @immutable
106 | class UrlElement extends LinkableElement {
107 | /// Creates [UrlElement].
108 | UrlElement(String url, [String? text]) : super(text, url);
109 |
110 | @override
111 | // ignore: unnecessary_overrides
112 | int get hashCode => super.hashCode;
113 |
114 | @override
115 | bool operator ==(Object other) => equals(other);
116 |
117 | @override
118 | // ignore: type_annotate_public_apis
119 | bool equals(other) => other is UrlElement && super.equals(other);
120 |
121 | @override
122 | String toString() => "LinkElement: '$url' ($text)";
123 | }
124 |
--------------------------------------------------------------------------------
/packages/flutter_link_previewer/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_link_previewer
2 | description: >
3 | Customizable link and URL preview extracted from the
4 | provided text with the ability to render from the cache. Ideal
5 | for chat applications.
6 | version: 3.2.2
7 | homepage: https://flyer.chat
8 | repository: https://github.com/flyerhq/flutter_link_previewer
9 |
10 | environment:
11 | sdk: '>=2.19.0 <4.0.0'
12 | flutter: '>=3.0.0'
13 |
14 | dependencies:
15 | flutter:
16 | sdk: flutter
17 | flutter_chat_types: ^3.6.2
18 | flutter_linkify: ^6.0.0
19 | html: ^0.15.4
20 | http: '>=0.13.6 <2.0.0'
21 | linkify: ^5.0.0
22 | meta: '>=1.8.0 <2.0.0'
23 | url_launcher: ^6.1.12
24 |
25 | dev_dependencies:
26 | dart_code_metrics: ^5.7.5
27 | flutter_lints: ^2.0.2
28 | flutter_test:
29 | sdk: flutter
30 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: chatchat
2 | description: "A new Flutter project."
3 | publish_to: "none" # Remove this line if you wish to publish to pub.dev
4 |
5 | version: 1.5.6+1
6 |
7 | environment:
8 | sdk: ^3.5.1
9 |
10 | dependencies:
11 | awesome_dialog: ^3.2.1
12 | cached_network_image: ^3.3.1
13 | chat_bubbles:
14 | path: packages/chat_bubbles/
15 | cloud_firestore: ^5.2.1
16 | cupertino_icons: ^1.0.8
17 | dio: ^5.6.0
18 | easy_localization: ^3.0.7
19 | firebase_auth: ^5.1.4
20 | firebase_core: ^3.3.0
21 | firebase_messaging: ^15.0.4
22 | firebase_storage: ^12.1.3
23 | flutter:
24 | sdk: flutter
25 | flutter_chat_types: ^3.6.2
26 | flutter_link_previewer:
27 | path: packages/flutter_link_previewer/
28 | flutter_local_notifications: ^17.2.2
29 | flutter_native_splash: ^2.4.1
30 | flutter_offline: ^4.0.0
31 | flutter_screenutil: ^5.9.3
32 | flutter_speed_dial: ^7.0.0
33 | flutter_svg: ^2.0.10+1
34 | gallery_saver: ^2.3.2
35 | gap: ^3.0.1
36 | google_sign_in: ^6.2.1
37 | googleapis_auth: ^1.6.0
38 | image_picker: ^1.1.2
39 | intl: ^0.19.0
40 | local_auth: ^2.3.0
41 | lottie: ^3.1.2
42 | modal_bottom_sheet: ^3.0.0
43 | package_info_plus: ^8.0.2
44 | path_provider: ^2.1.4
45 | pretty_dio_logger: ^1.4.0
46 | pub_semver: ^2.1.4
47 | restart_app: ^1.2.1
48 | shared_preferences: ^2.3.2
49 | url_launcher: ^6.3.0
50 |
51 | dev_dependencies:
52 | flutter_lints: ^3.0.2
53 | flutter_test:
54 | sdk: flutter
55 |
56 | dependency_overrides:
57 | http: ^0.13.3
58 |
59 | flutter:
60 | uses-material-design: true
61 |
62 | assets:
63 | - assets/images/
64 | - assets/lottie/
65 | - assets/translations/
66 | - assets/svgs/
67 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility in the flutter_test package. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:chatchat/chatchat.dart';
9 | import 'package:chatchat/router/app_routes.dart';
10 | import 'package:flutter/material.dart';
11 | import 'package:flutter_test/flutter_test.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(
17 | ChatChat(
18 | appRoute: AppRoute(),
19 | ),
20 | );
21 |
22 | // Verify that our counter starts at 0.
23 | expect(find.text('0'), findsOneWidget);
24 | expect(find.text('1'), findsNothing);
25 |
26 | // Tap the '+' icon and trigger a frame.
27 | await tester.tap(find.byIcon(Icons.add));
28 | await tester.pump();
29 |
30 | // Verify that our counter has incremented.
31 | expect(find.text('0'), findsNothing);
32 | expect(find.text('1'), findsOneWidget);
33 | });
34 | }
35 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "chatchat",
3 | "short_name": "chatchat",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/web/splash/img/dark-1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/dark-1x.png
--------------------------------------------------------------------------------
/web/splash/img/dark-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/dark-2x.png
--------------------------------------------------------------------------------
/web/splash/img/dark-3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/dark-3x.png
--------------------------------------------------------------------------------
/web/splash/img/dark-4x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/dark-4x.png
--------------------------------------------------------------------------------
/web/splash/img/light-1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/light-1x.png
--------------------------------------------------------------------------------
/web/splash/img/light-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/light-2x.png
--------------------------------------------------------------------------------
/web/splash/img/light-3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/light-3x.png
--------------------------------------------------------------------------------
/web/splash/img/light-4x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/web/splash/img/light-4x.png
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | void RegisterPlugins(flutter::PluginRegistry* registry) {
20 | CloudFirestorePluginCApiRegisterWithRegistrar(
21 | registry->GetRegistrarForPlugin("CloudFirestorePluginCApi"));
22 | ConnectivityPlusWindowsPluginRegisterWithRegistrar(
23 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
24 | FileSelectorWindowsRegisterWithRegistrar(
25 | registry->GetRegistrarForPlugin("FileSelectorWindows"));
26 | FirebaseAuthPluginCApiRegisterWithRegistrar(
27 | registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
28 | FirebaseCorePluginCApiRegisterWithRegistrar(
29 | registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
30 | FirebaseStoragePluginCApiRegisterWithRegistrar(
31 | registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi"));
32 | LocalAuthPluginRegisterWithRegistrar(
33 | registry->GetRegistrarForPlugin("LocalAuthPlugin"));
34 | RivePluginRegisterWithRegistrar(
35 | registry->GetRegistrarForPlugin("RivePlugin"));
36 | UrlLauncherWindowsRegisterWithRegistrar(
37 | registry->GetRegistrarForPlugin("UrlLauncherWindows"));
38 | }
39 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | cloud_firestore
7 | connectivity_plus
8 | file_selector_windows
9 | firebase_auth
10 | firebase_core
11 | firebase_storage
12 | local_auth_windows
13 | rive_common
14 | url_launcher_windows
15 | )
16 |
17 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
18 | )
19 |
20 | set(PLUGIN_BUNDLED_LIBRARIES)
21 |
22 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
24 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
26 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
27 | endforeach(plugin)
28 |
29 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
30 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
31 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
32 | endforeach(ffi_plugin)
33 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # Define the application target. To change its name, change BINARY_NAME in the
5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6 | # work.
7 | #
8 | # Any new source files that you add to the application should be added here.
9 | add_executable(${BINARY_NAME} WIN32
10 | "flutter_window.cpp"
11 | "main.cpp"
12 | "utils.cpp"
13 | "win32_window.cpp"
14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15 | "Runner.rc"
16 | "runner.exe.manifest"
17 | )
18 |
19 | # Apply the standard set of build settings. This can be removed for applications
20 | # that need different build settings.
21 | apply_standard_settings(${BINARY_NAME})
22 |
23 | # Add preprocessor definitions for the build version.
24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29 |
30 | # Disable Windows macros that collide with C++ standard library functions.
31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
32 |
33 | # Add dependency libraries and include directories. Add any application-specific
34 | # dependencies here.
35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
38 |
39 | # Run the Flutter tool portions of the build. This must not be removed.
40 | add_dependencies(${BINARY_NAME} flutter_assemble)
41 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0,0
67 | #endif
68 |
69 | #if defined(FLUTTER_VERSION)
70 | #define VERSION_AS_STRING FLUTTER_VERSION
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "com.example" "\0"
93 | VALUE "FileDescription", "chatchat" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "chatchat" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "chatchat.exe" "\0"
98 | VALUE "ProductName", "chatchat" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 |
30 | flutter_controller_->engine()->SetNextFrameCallback([&]() {
31 | this->Show();
32 | });
33 |
34 | // Flutter can complete the first frame before the "show window" callback is
35 | // registered. The following call ensures a frame is pending to ensure the
36 | // window is shown. It is a no-op if the first frame hasn't completed yet.
37 | flutter_controller_->ForceRedraw();
38 |
39 | return true;
40 | }
41 |
42 | void FlutterWindow::OnDestroy() {
43 | if (flutter_controller_) {
44 | flutter_controller_ = nullptr;
45 | }
46 |
47 | Win32Window::OnDestroy();
48 | }
49 |
50 | LRESULT
51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
52 | WPARAM const wparam,
53 | LPARAM const lparam) noexcept {
54 | // Give Flutter, including plugins, an opportunity to handle window messages.
55 | if (flutter_controller_) {
56 | std::optional result =
57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
58 | lparam);
59 | if (result) {
60 | return *result;
61 | }
62 | }
63 |
64 | switch (message) {
65 | case WM_FONTCHANGE:
66 | flutter_controller_->engine()->ReloadSystemFonts();
67 | break;
68 | }
69 |
70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
71 | }
72 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.Create(L"chatchat", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MoazSayed7/Flutter-Chat-App-Firebase-Authentication-Messaging-WhatsApp-Like/b3f81e89659aa355eed475e606bfa2be8f1043c8/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr)
51 | -1; // remove the trailing null character
52 | int input_length = (int)wcslen(utf16_string);
53 | std::string utf8_string;
54 | if (target_length <= 0 || target_length > utf8_string.max_size()) {
55 | return utf8_string;
56 | }
57 | utf8_string.resize(target_length);
58 | int converted_length = ::WideCharToMultiByte(
59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
60 | input_length, utf8_string.data(), target_length, nullptr, nullptr);
61 | if (converted_length == 0) {
62 | return std::string();
63 | }
64 | return utf8_string;
65 | }
66 |
--------------------------------------------------------------------------------
/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_WIN32_WINDOW_H_
2 | #define RUNNER_WIN32_WINDOW_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
11 | // inherited from by classes that wish to specialize with custom
12 | // rendering and input handling
13 | class Win32Window {
14 | public:
15 | struct Point {
16 | unsigned int x;
17 | unsigned int y;
18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
19 | };
20 |
21 | struct Size {
22 | unsigned int width;
23 | unsigned int height;
24 | Size(unsigned int width, unsigned int height)
25 | : width(width), height(height) {}
26 | };
27 |
28 | Win32Window();
29 | virtual ~Win32Window();
30 |
31 | // Creates a win32 window with |title| that is positioned and sized using
32 | // |origin| and |size|. New windows are created on the default monitor. Window
33 | // sizes are specified to the OS in physical pixels, hence to ensure a
34 | // consistent size this function will scale the inputted width and height as
35 | // as appropriate for the default monitor. The window is invisible until
36 | // |Show| is called. Returns true if the window was created successfully.
37 | bool Create(const std::wstring& title, const Point& origin, const Size& size);
38 |
39 | // Show the current window. Returns true if the window was successfully shown.
40 | bool Show();
41 |
42 | // Release OS resources associated with window.
43 | void Destroy();
44 |
45 | // Inserts |content| into the window tree.
46 | void SetChildContent(HWND content);
47 |
48 | // Returns the backing Window handle to enable clients to set icon and other
49 | // window properties. Returns nullptr if the window has been destroyed.
50 | HWND GetHandle();
51 |
52 | // If true, closing this window will quit the application.
53 | void SetQuitOnClose(bool quit_on_close);
54 |
55 | // Return a RECT representing the bounds of the current client area.
56 | RECT GetClientArea();
57 |
58 | protected:
59 | // Processes and route salient window messages for mouse handling,
60 | // size change and DPI. Delegates handling of these to member overloads that
61 | // inheriting classes can handle.
62 | virtual LRESULT MessageHandler(HWND window,
63 | UINT const message,
64 | WPARAM const wparam,
65 | LPARAM const lparam) noexcept;
66 |
67 | // Called when CreateAndShow is called, allowing subclass window-related
68 | // setup. Subclasses should return false if setup fails.
69 | virtual bool OnCreate();
70 |
71 | // Called when Destroy is called.
72 | virtual void OnDestroy();
73 |
74 | private:
75 | friend class WindowClassRegistrar;
76 |
77 | // OS callback called by message pump. Handles the WM_NCCREATE message which
78 | // is passed when the non-client area is being created and enables automatic
79 | // non-client DPI scaling so that the non-client area automatically
80 | // responds to changes in DPI. All other messages are handled by
81 | // MessageHandler.
82 | static LRESULT CALLBACK WndProc(HWND const window,
83 | UINT const message,
84 | WPARAM const wparam,
85 | LPARAM const lparam) noexcept;
86 |
87 | // Retrieves a class instance pointer for |window|
88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
89 |
90 | // Update the window frame's theme to match the system theme.
91 | static void UpdateTheme(HWND const window);
92 |
93 | bool quit_on_close_ = false;
94 |
95 | // window handle for top level window.
96 | HWND window_handle_ = nullptr;
97 |
98 | // window handle for hosted content.
99 | HWND child_content_ = nullptr;
100 | };
101 |
102 | #endif // RUNNER_WIN32_WINDOW_H_
103 |
--------------------------------------------------------------------------------