Skip to content

Commit

Permalink
feat: timeago feature implementation
Browse files Browse the repository at this point in the history
Resolved build issues and upgraded dependencies
  • Loading branch information
EnesKaraosman committed Jun 27, 2023
1 parent 6b9e80b commit 4d97804
Show file tree
Hide file tree
Showing 30 changed files with 118 additions and 653 deletions.
18 changes: 0 additions & 18 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,12 @@ PODS:
- FlutterMacOS
- url_launcher_ios (0.0.1):
- Flutter
- video_player_avfoundation (0.0.1):
- Flutter
- wakelock (0.0.1):
- Flutter
- webview_flutter_wkwebview (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)

EXTERNAL SOURCES:
Flutter:
Expand All @@ -32,21 +23,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/ios"
wakelock:
:path: ".symlinks/plugins/wakelock/ios"
webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
integration_test: 13825b8a9334a850581300559b8839134b124670
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

Expand Down
6 changes: 3 additions & 3 deletions example/lib/advanced_chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:swifty_chat/swifty_chat.dart';
import 'package:swifty_chat_mocked_data/swifty_chat_mocked_data.dart';

class AdvancedChat extends StatefulWidget {
const AdvancedChat(Key? key) : super(key: key);
const AdvancedChat({super.key});

@override
_AdvancedChat createState() => _AdvancedChat();
Expand Down Expand Up @@ -64,7 +64,7 @@ class _AdvancedChat extends State<AdvancedChat> {
setState(
() {
final message = MockMessage(
time: DateTime.now(),
date: DateTime.now(),
user: MockChatUser.outgoingUser,
id: DateTime.now().toString(),
isMe: true,
Expand All @@ -89,7 +89,7 @@ class _AdvancedChat extends State<AdvancedChat> {
(item) {
debugPrint(item.title);
final message = MockMessage(
time: DateTime.now(),
date: DateTime.now(),
user: MockChatUser.outgoingUser,
id: DateTime.now().toString(),
isMe: true,
Expand Down
43 changes: 3 additions & 40 deletions example/lib/basic_chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:swifty_chat/swifty_chat.dart';
import 'package:swifty_chat_mocked_data/swifty_chat_mocked_data.dart';

class BasicChat extends StatefulWidget {
const BasicChat(Key? key) : super(key: key);
const BasicChat({super.key});

@override
_BasicChatState createState() => _BasicChatState();
Expand Down Expand Up @@ -32,8 +32,7 @@ class _BasicChatState extends State<BasicChat> {
}

Chat _chatWidget(BuildContext context) => Chat(
customLookupMessages: Custom1Messages(),
locale: LocaleType.de,
locale: LocaleType.tr,
theme: const DarkChatTheme(),
messages: _messages,
chatMessageInputField: MessageInputField(
Expand All @@ -43,7 +42,7 @@ class _BasicChatState extends State<BasicChat> {
setState(
() {
final message = MockMessage(
time: DateTime.now(),
date: DateTime.now(),
user: MockChatUser.outgoingUser,
id: DateTime.now().toString(),
isMe: true,
Expand All @@ -57,39 +56,3 @@ class _BasicChatState extends State<BasicChat> {
),
);
}

class Custom1Messages implements LookupMessages {
const Custom1Messages() : super();
@override
String prefixAgo() => '';
@override
String prefixFromNow() => '';
@override
String suffixAgo() => 'önce';
@override
String suffixFromNow() => 'kaldı';
@override
String lessThanOneMinute(int seconds) => 'asd';
@override
String aboutAMinute(int minutes) => 'asd';
@override
String minutes(int minutes) => '$minutes asd';
@override
String aboutAnHour(int minutes) => 'asd';
@override
String hours(int hours) => '$hours asd';
@override
String aDay(int hours) => 'asd';
@override
String days(int days) => '$days ads';
@override
String aboutAMonth(int days) => 'asd';
@override
String months(int months) => '$months asd';
@override
String aboutAYear(int year) => 'bir yıl';
@override
String years(int years) => '$years yıl';
@override
String wordSeparator() => ' ';
}
4 changes: 2 additions & 2 deletions example/lib/custom_message_kind_chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import 'package:swifty_chat/swifty_chat.dart';
import 'package:swifty_chat_mocked_data/swifty_chat_mocked_data.dart';

class CustomMessageKindChat extends StatelessWidget {
const CustomMessageKindChat(Key? key) : super(key: key);
const CustomMessageKindChat({super.key});

List<MockMessage> _mockMessages() => generateRandomTextMessages(count: 5)
..insert(
0,
MockMessage(
time: DateTime.now(),
date: DateTime.now(),
user: MockChatUser.incomingUser,
id: DateTime.now().toString(),
isMe: false,
Expand Down
6 changes: 3 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class _MyAppState extends State<MyApp> {
debugShowCheckedModeBanner: false,
routes: {
'/': (_) => const Home(),
'/basic-chat': (_) => const BasicChat(Key('basic_chat')),
'/advanced-chat': (_) => const AdvancedChat(Key('advanced_chat')),
'/custom-message-kind-chat': (_) => CustomMessageKindChat(Key('custom_message_kind_chat')),
'/basic-chat': (_) => const BasicChat(key: Key('basic_chat')),
'/advanced-chat': (_) => const AdvancedChat(key: Key('advanced_chat')),
'/custom-message-kind-chat': (_) => CustomMessageKindChat(key: Key('custom_message_kind_chat')),
},
);
}
Expand Down
2 changes: 0 additions & 2 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import Foundation

import path_provider_foundation
import url_launcher_macos
import wakelock_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
}
Loading

0 comments on commit 4d97804

Please sign in to comment.