Browse Source

im更改:

底部导航栏新增:心聊板块
im首页ui绘制;(删除操作暂未处理)
聊天框ui绘制;
好友分组列表ui绘制;
添加好友ui绘制;
tab新增下划线圆角处理;
个人中心底部导航栏暂未处理完;
聊天框键盘表情包更多功能收缩效果待优化;
dart3_last
wurong 5 months ago
parent
commit
53018f2ef2
  1. BIN
      assets/image/2x/add_friend.webp
  2. BIN
      assets/image/2x/fa_bu.webp
  3. BIN
      assets/image/2x/friend_grouping.webp
  4. BIN
      assets/image/2x/icon_chat_camera.webp
  5. BIN
      assets/image/2x/icon_chat_emo.webp
  6. BIN
      assets/image/2x/icon_chat_photo.webp
  7. BIN
      assets/image/3x/add_friend.webp
  8. BIN
      assets/image/3x/fa_bu.webp
  9. BIN
      assets/image/3x/friend_grouping.webp
  10. BIN
      assets/image/3x/icon_chat_camera.webp
  11. BIN
      assets/image/3x/icon_chat_emo.webp
  12. BIN
      assets/image/3x/icon_chat_photo.webp
  13. BIN
      assets/image/3x/多边形 1@3x.webp
  14. BIN
      assets/image/add_friend.webp
  15. BIN
      assets/image/fa_bu.webp
  16. BIN
      assets/image/friend_grouping.webp
  17. BIN
      assets/image/icon_chat_camera.webp
  18. BIN
      assets/image/icon_chat_emo.webp
  19. BIN
      assets/image/icon_chat_photo.webp
  20. 13
      assets/svg/im.svg
  21. 27
      assets/svg/shequn.svg
  22. 30
      lib/generated/intl/messages_all.dart
  23. 1628
      lib/generated/intl/messages_en.dart
  24. 1907
      lib/generated/intl/messages_en_US.dart
  25. 1628
      lib/generated/intl/messages_zh_CN.dart
  26. 1628
      lib/generated/intl/messages_zh_Hans_CN.dart
  27. 1617
      lib/generated/intl/messages_zh_Hant_CN.dart
  28. 1623
      lib/generated/intl/messages_zh_TW.dart
  29. 85
      lib/generated/l10n.dart
  30. 191
      lib/im/add_friend.dart
  31. 190
      lib/im/chat_details_page.dart
  32. 134
      lib/im/chat_friend_group.dart
  33. 0
      lib/im/chat_setting.dart
  34. 0
      lib/im/contact_share.dart
  35. 96
      lib/im/im_view/custom_underline_tabIndicator.dart
  36. 125
      lib/im/im_view/friend_groip_list.dart
  37. 388
      lib/im/im_view/im_page.dart
  38. 0
      lib/im/im_view/on_chat_message.dart
  39. 0
      lib/im/im_view/on_chat_msg_instance.dart
  40. 0
      lib/im/im_view/triangle_painter.dart
  41. 4
      lib/l10n/intl_en.arb
  42. 3
      lib/l10n/intl_en_US.arb
  43. 3
      lib/l10n/intl_zh_CN.arb
  44. 3
      lib/l10n/intl_zh_Hans_CN.arb
  45. 3
      lib/l10n/intl_zh_Hant_CN.arb
  46. 3
      lib/l10n/intl_zh_TW.arb
  47. 12
      lib/main.dart
  48. 13
      lib/main_page.dart
  49. 234
      lib/message/system_message.dart
  50. 37
      lib/union/union_page.dart
  51. 4
      lib/view_widget/my_appbar.dart

BIN
assets/image/2x/add_friend.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

BIN
assets/image/2x/fa_bu.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 868 B

BIN
assets/image/2x/friend_grouping.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

BIN
assets/image/2x/icon_chat_camera.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 566 B

BIN
assets/image/2x/icon_chat_emo.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 956 B

BIN
assets/image/2x/icon_chat_photo.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 948 B

After

Width:  |  Height:  |  Size: 434 B

BIN
assets/image/3x/add_friend.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

BIN
assets/image/3x/fa_bu.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/friend_grouping.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

BIN
assets/image/3x/icon_chat_camera.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 819 B

BIN
assets/image/3x/icon_chat_emo.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/3x/icon_chat_photo.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 609 B

BIN
assets/image/3x/多边形 1@3x.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 946 B

BIN
assets/image/add_friend.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

BIN
assets/image/fa_bu.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 479 B

BIN
assets/image/friend_grouping.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

BIN
assets/image/icon_chat_camera.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

After

Width:  |  Height:  |  Size: 330 B

BIN
assets/image/icon_chat_emo.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 505 B

BIN
assets/image/icon_chat_photo.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 B

After

Width:  |  Height:  |  Size: 260 B

13
assets/svg/im.svg

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 12备份 2</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="画板" transform="translate(-123.000000, -68.000000)">
<g id="编组-12备份-2" transform="translate(123.000000, 68.000000)">
<rect id="矩形" x="0" y="0" width="30" height="30"></rect>
<rect id="矩形" x="2.04545455" y="2.04545455" width="25.9090909" height="25.9090909"></rect>
<path d="M15,4 C21.0751322,4 26,8.92486775 26,15 L26,25 C26,25.5522847 25.5522847,26 25,26 L15,26 C8.92486775,26 4,21.0751322 4,15 C4,8.92486775 8.92486775,4 15,4 Z M11.75,12 C10.7835017,12 10,12.7835017 10,13.75 L10,13.75 L10,16.25 C10,17.2164983 10.7835017,18 11.75,18 C12.7164983,18 13.5,17.2164983 13.5,16.25 L13.5,16.25 L13.5,13.75 C13.5,12.7835017 12.7164983,12 11.75,12 Z M18.25,12 C17.2835017,12 16.5,12.7835017 16.5,13.75 L16.5,13.75 L16.5,16.25 C16.5,17.2164983 17.2835017,18 18.25,18 C19.2164983,18 20,17.2164983 20,16.25 L20,16.25 L20,13.75 C20,12.7835017 19.2164983,12 18.25,12 Z" id="形状结合" fill="#32A060"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

27
assets/svg/shequn.svg

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 12备份 2</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="画板" transform="translate(-123.000000, -68.000000)">
<g id="编组-12备份-2" transform="translate(123.000000, 68.000000)">
<rect id="矩形" x="0" y="0" width="30" height="30"></rect>
<rect id="矩形" x="2.04545455" y="2.04545455" width="25.9090909" height="25.9090909"></rect>
<path d="M15,4 C21.0751322,4 26,8.92486775 26,15 L26,25 C26,25.5522847 25.5522847,26 25,26 L15,26 C8.92486775,26 4,21.0751322 4,15 C4,8.92486775 8.92486775,4 15,4 Z M11.75,12 C10.7835017,12 10,12.7835017 10,13.75 L10,13.75 L10,16.25 C10,17.2164983 10.7835017,18 11.75,18 C12.7164983,18 13.5,17.2164983 13.5,16.25 L13.5,16.25 L13.5,13.75 C13.5,12.7835017 12.7164983,12 11.75,12 Z M18.25,12 C17.2835017,12 16.5,12.7835017 16.5,13.75 L16.5,13.75 L16.5,16.25 C16.5,17.2164983 17.2835017,18 18.25,18 C19.2164983,18 20,17.2164983 20,16.25 L20,16.25 L20,13.75 C20,12.7835017 19.2164983,12 18.25,12 Z" id="形状结合" fill="#32A060"></path>
</g>
</g>
</g>
</svg>
<svg width="22.000000" height="22.000000" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>
Created with Pixso.
</desc>
<defs>
<clipPath id="clip114_923">
<rect id="shequn" width="22.000000" height="22.000000" fill="white" fill-opacity="0"/>
</clipPath>
</defs>
<g clip-path="url(#clip114_923)">
<path id="path" d="M13.69 14.75C12.4 15.71 11.05 16.56 9.63 17.32C8.21 18.07 6.75 18.72 5.24 19.26C5.45 19.41 5.67 19.55 5.89 19.68C6.11 19.81 6.34 19.93 6.57 20.04C6.8 20.16 7.04 20.26 7.28 20.36C7.52 20.45 7.77 20.54 8.01 20.61C8.26 20.69 8.51 20.76 8.76 20.82C9.01 20.87 9.27 20.92 9.52 20.96C9.78 21 10.03 21.02 10.29 21.04C10.55 21.06 10.81 21.07 11.07 21.07C11.33 21.06 11.58 21.05 11.84 21.03C12.1 21.01 12.35 20.98 12.61 20.94C12.87 20.89 13.12 20.84 13.37 20.78C13.62 20.72 13.87 20.65 14.11 20.57C14.36 20.49 14.6 20.4 14.84 20.3C15.08 20.2 15.32 20.1 15.55 19.98C15.78 19.86 16 19.74 16.22 19.6C16.44 19.47 16.66 19.33 16.87 19.18C17.08 19.02 17.28 18.87 17.48 18.7C17.68 18.53 17.87 18.36 18.05 18.18C18.24 18 18.42 17.81 18.59 17.61C18.76 17.42 18.92 17.22 19.07 17.01C19.23 16.8 19.37 16.59 19.51 16.37C19.65 16.16 19.78 15.93 19.9 15.7C20.02 15.47 20.13 15.24 20.24 15.01C20.34 14.77 20.43 14.53 20.52 14.28C20.6 14.04 20.68 13.79 20.74 13.54C20.81 13.29 20.87 13.04 20.91 12.79C20.96 12.53 20.99 12.28 21.02 12.02C21.05 11.76 21.06 11.5 21.07 11.24C21.08 10.99 21.07 10.73 21.06 10.47C21.05 10.21 21.02 9.95 20.99 9.7C20.96 9.44 20.92 9.19 20.86 8.93C20.81 8.68 20.75 8.43 20.68 8.18C19.68 9.44 18.59 10.62 17.42 11.72C16.25 12.82 15.01 13.83 13.69 14.75Z" fill="#32A060" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="path" d="M21.79 3.25C21.24 2.46 19.65 2.56 17.51 3.31C17.3 3.13 17.08 2.96 16.85 2.8C16.63 2.64 16.39 2.49 16.15 2.34C15.91 2.2 15.67 2.07 15.42 1.95C15.17 1.82 14.92 1.71 14.66 1.61C14.4 1.51 14.13 1.42 13.87 1.34C13.6 1.26 13.33 1.19 13.06 1.14C12.79 1.08 12.51 1.03 12.24 1C11.96 0.97 11.68 0.94 11.41 0.93C11.13 0.92 10.85 0.92 10.57 0.93C10.29 0.95 10.02 0.97 9.74 1C9.47 1.04 9.19 1.08 8.92 1.14C8.65 1.2 8.38 1.27 8.11 1.35C7.84 1.43 7.58 1.52 7.32 1.62C7.06 1.72 6.81 1.83 6.56 1.96C6.31 2.08 6.07 2.21 5.83 2.35C5.59 2.5 5.36 2.65 5.13 2.81C4.9 2.97 4.69 3.14 4.47 3.32C4.26 3.5 4.06 3.69 3.86 3.89C3.66 4.09 3.48 4.29 3.3 4.51C3.12 4.72 2.95 4.94 2.79 5.16C2.63 5.39 2.47 5.62 2.33 5.86C2.19 6.1 2.06 6.35 1.94 6.6C1.82 6.85 1.71 7.1 1.61 7.36C1.51 7.62 1.42 7.88 1.34 8.15C1.26 8.42 1.19 8.69 1.13 8.96C1.08 9.23 1.03 9.51 1 9.78C0.97 10.06 0.94 10.34 0.93 10.61C0.92 10.89 0.92 11.17 0.94 11.45C0.95 11.73 0.97 12 1.01 12.28C1.04 12.55 1.09 12.83 1.15 13.1C1.21 13.37 1.28 13.64 1.36 13.91C1.44 14.17 1.53 14.44 1.63 14.7C0.23 16.5 -0.35 17.97 0.2 18.73C1.36 20.36 7.14 18.21 13.1 13.93C19.07 9.64 22.95 4.87 21.79 3.25ZM10.15 9.83L9.18 11.07L8.64 9.6L7.44 8.64L8.91 8.12L9.87 6.89L10.39 8.36L11.62 9.33L10.15 9.83Z" fill="#32A060" fill-opacity="1.000000" fill-rule="nonzero"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

30
lib/generated/intl/messages_all.dart

@ -11,7 +11,6 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
import 'package:intl/src/intl_helpers.dart';
@ -25,12 +24,12 @@ import 'messages_zh_TW.dart' as messages_zh_tw;
typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'en': () => new SynchronousFuture(null),
'en_US': () => new SynchronousFuture(null),
'zh_CN': () => new SynchronousFuture(null),
'zh_Hans_CN': () => new SynchronousFuture(null),
'zh_Hant_CN': () => new SynchronousFuture(null),
'zh_TW': () => new SynchronousFuture(null),
'en': () => new Future.value(null),
'en_US': () => new Future.value(null),
'zh_CN': () => new Future.value(null),
'zh_Hans_CN': () => new Future.value(null),
'zh_Hant_CN': () => new Future.value(null),
'zh_TW': () => new Future.value(null),
};
MessageLookupByLibrary _findExact(String localeName) {
@ -53,18 +52,19 @@ MessageLookupByLibrary _findExact(String localeName) {
}
/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) {
Future<bool> initializeMessages(String localeName) async {
var availableLocale = Intl.verifiedLocale(
localeName, (locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
localeName,
(locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
if (availableLocale == null) {
return new SynchronousFuture(false);
return new Future.value(false);
}
var lib = _deferredLibraries[availableLocale];
lib == null ? new SynchronousFuture(false) : lib();
await (lib == null ? new Future.value(false) : lib());
initializeInternalMessageLookup(() => new CompositeMessageLookup());
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
return new SynchronousFuture(true);
return new Future.value(true);
}
bool _messagesExistFor(String locale) {
@ -76,8 +76,8 @@ bool _messagesExistFor(String locale) {
}
MessageLookupByLibrary _findGeneratedMessagesFor(String locale) {
var actualLocale =
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
onFailure: (_) => null);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}

1628
lib/generated/intl/messages_en.dart

File diff suppressed because it is too large Load Diff

1907
lib/generated/intl/messages_en_US.dart

File diff suppressed because it is too large Load Diff

1628
lib/generated/intl/messages_zh_CN.dart

File diff suppressed because it is too large Load Diff

1628
lib/generated/intl/messages_zh_Hans_CN.dart

File diff suppressed because it is too large Load Diff

1617
lib/generated/intl/messages_zh_Hant_CN.dart

File diff suppressed because it is too large Load Diff

1623
lib/generated/intl/messages_zh_TW.dart

File diff suppressed because it is too large Load Diff

85
lib/generated/l10n.dart

@ -10,43 +10,28 @@ import 'intl/messages_all.dart';
// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
// ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes
// ignore_for_file: avoid_redundant_argument_values
class S {
S();
static S _current;
static S get current {
assert(_current != null,
'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.');
return _current;
}
static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
static S current;
static const AppLocalizationDelegate delegate =
AppLocalizationDelegate();
static Future<S> load(Locale locale) {
final name = (locale.countryCode?.isEmpty ?? false)
? locale.languageCode
: locale.toString();
final localeName = Intl.canonicalizedLocale(name);
final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString();
final localeName = Intl.canonicalizedLocale(name);
return initializeMessages(localeName).then((_) {
Intl.defaultLocale = localeName;
final instance = S();
S._current = instance;
return instance;
S.current = S();
return S.current;
});
}
}
static S of(BuildContext context) {
final instance = S.maybeOf(context);
assert(instance != null,
'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
return instance;
}
static S maybeOf(BuildContext context) {
return Localizations.of<S>(context, S);
}
@ -7210,6 +7195,36 @@ class S {
);
}
/// ``
String get main_menu6 {
return Intl.message(
'心聊',
name: 'main_menu6',
desc: '',
args: [],
);
}
/// ``
String get haoyou {
return Intl.message(
'好友',
name: 'haoyou',
desc: '',
args: [],
);
}
/// ``
String get zhaoren {
return Intl.message(
'找人',
name: 'zhaoren',
desc: '',
args: [],
);
}
/// `使`
String get privacy_policy4 {
return Intl.message(
@ -7229,10 +7244,8 @@ class AppLocalizationDelegate extends LocalizationsDelegate<S> {
Locale.fromSubtags(languageCode: 'en'),
Locale.fromSubtags(languageCode: 'en', countryCode: 'US'),
Locale.fromSubtags(languageCode: 'zh', countryCode: 'CN'),
Locale.fromSubtags(
languageCode: 'zh', scriptCode: 'Hans', countryCode: 'CN'),
Locale.fromSubtags(
languageCode: 'zh', scriptCode: 'Hant', countryCode: 'CN'),
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: 'CN'),
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: 'CN'),
Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW'),
];
}
@ -7245,11 +7258,13 @@ class AppLocalizationDelegate extends LocalizationsDelegate<S> {
bool shouldReload(AppLocalizationDelegate old) => false;
bool _isSupported(Locale locale) {
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode) {
return true;
if (locale != null) {
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode) {
return true;
}
}
}
return false;
}
}
}

191
lib/im/add_friend.dart

@ -0,0 +1,191 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter/cupertino.dart';
import '../utils/font_weight.dart';
class AddFriend extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _AddFriend();
}
}
class _AddFriend extends State<AddFriend> {
ApiService apiService;
final TextEditingController editingController = TextEditingController();
FocusNode _focusNode = FocusNode();
@override
void initState() {
super.initState();
}
///
@override
void dispose() {
_focusNode.unfocus();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFFFFFFF),
appBar: MyAppBar(
title: "添加好友",
titleColor: Color(0xFF0D0D0D),
titleSize: 17.sp,
leading: true,
leadingColor: Colors.black,
background: Color(0xFFFFFFFF),
),
body: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.only(left:18.w),
child: Column(
children: [
Text(
"找人",
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF060606),
fontWeight: FontWeight.bold),
),
Container(
height: 4.h,
width: 32.w,
margin:EdgeInsets.only(top:5.h),
decoration:BoxDecoration(
borderRadius: BorderRadius.circular(4.r),
color: Color(0xFF32A060),
)
)
],
),),
friendGroupSearch(),
Padding(
padding: EdgeInsets.only(left:18.w,bottom: 16.h),
child: Text(
"好友推荐",
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF060606),
fontWeight: FontWeight.bold),
),
),
Expanded(
child: ListView.builder(
itemCount: 10,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return addFriendItem();
},
)),
],
),
),
);
}
///
Widget addFriendItem() {
return Container(
margin: EdgeInsets.only(left:16.w,right:16.w,bottom: 24.h),
child: Row(children: [
Container(
padding: EdgeInsets.only(right: 4.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(26.5.r),
),
child: Image.asset(
"assets/image/bs_mine_heading.webp",
width: 54.h,
height: 54.h,
fit: BoxFit.fill,
),
),
Expanded(
child: Text(
"哈喽喽哈",
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF060606),
fontWeight: FontWeight.w500),
),
),
Container(
padding: EdgeInsets.symmetric(horizontal:18.w,vertical:6.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(26.5.r),
color: Color(0xFF32A060),
boxShadow: [
BoxShadow(
color: Color(0xFF32A060).withOpacity(0.2),
spreadRadius: 0,
blurRadius: 4,
offset: Offset(0, 4), // changes position of shadow
),
],
),
child: Text(
"添加",
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
fontWeight:MyFontWeight.regular),
),
)
]),
);
}
///
Widget friendGroupSearch() {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w,29.h),
padding: EdgeInsets.symmetric(vertical: 13.h),
decoration: BoxDecoration(
color: Color(0xFFFDFCFC),
borderRadius: BorderRadius.circular(4),
),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
},
controller: editingController,
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
hintText: "搜索",
hintStyle: TextStyle(
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
isCollapsed: true,
prefixIcon: Padding(
padding: EdgeInsets.only(left: 15.w, right: 5.w),
child: Image.asset(
"assets/image/icon_search.webp",
width: 14.h,
height: 14.h,
color: Color(0xFFB3B3B3),
),
),
prefixIconConstraints: BoxConstraints(),
border: InputBorder.none,
),
),
);
}
}

190
lib/message/im/chat_details_page.dart → lib/im/chat_details_page.dart

@ -45,7 +45,7 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
bool needShowMore = false;
bool needHideMore = false;
var commentFocus = FocusNode();
String hintText = "输入消息内容...";
String hintText = "输入消息内容...";
final OnChatMessage _tempOnChatMessage =
OnChatMsgInstance.instance.onChatMessage;
final ScrollController scrollController = ScrollController();
@ -218,12 +218,11 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
}
return Scaffold(
// resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFFF9FAF7),
backgroundColor: Color(0xFFF6F6F6),
appBar: MyAppBar(
title: "哈哈哈哈",
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.white,
titleColor: Color(0xFF0D0D0D),
titleSize: 17.sp,
leading: true,
leadingColor: Colors.black,
action: GestureDetector(
@ -235,9 +234,7 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
});
},
child: Container(
padding: EdgeInsets.only(top: 3.h, bottom: 16.h),
alignment: Alignment.center,
// color: Colors.red,
child: Icon(
Icons.more_horiz,
color: Colors.black,
@ -420,18 +417,26 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
// ),
Image.asset(
"assets/image/fuka_zj.webp",
height: 44,
width: 44,
height: 44.h,
width: 44.h,
),
SizedBox(
width: 12.w,
),
Expanded(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Color(0xFFF0FAF4),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Color(0xFFFFFFFF),
boxShadow: [
BoxShadow(
color: Color(0xFFA8A3A3).withAlpha(12),
offset: Offset(0, 4),
blurRadius: 4,
spreadRadius: 0,
)
],
),
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 12.w),
child:GestureDetector(
onLongPress:(){
@ -445,9 +450,9 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
textAlign: TextAlign.left,
style: TextStyle(
height: 1.2.h,
color: Colors.black,
color: Color(0XFF0D0D0D),
fontSize: 17.sp,
fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.medium,
),
),
)
@ -575,9 +580,9 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
textAlign: TextAlign.left,
style: TextStyle(
height: 1.2.h,
color: Colors.black,
color: Colors.white,
fontSize: 17.sp,
fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.medium,
),
),
),
@ -601,6 +606,57 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
),
],
)),
Padding(padding:EdgeInsets.only(left: 17.w,right: 39.w,top: 20.h),
child: Row(
children: [
// MImage(
// "",
// isCircle: true,
// width: 44,
// height: 44,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_user.webp",
// fadeSrc: "assets/image/default_user.webp",
// ),
Image.asset(
"assets/image/fuka_zj.webp",
height: 44.h,
width: 44.h,
),
SizedBox(
width: 12.w,
),
Expanded(
flex: 3,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Color(0xFFFFFFFF),
boxShadow: [
BoxShadow(
color: Color(0xFFA8A3A3).withAlpha(12),
offset: Offset(0, 4),
blurRadius: 4,
spreadRadius: 0,
)
],
),
child:GestureDetector(
onLongPress:(){
setState((){
});
},
child: Image.asset(
"assets/image/icon_guide_4.webp",
width:180.h,
height: 200.h,
fit: BoxFit.fill,
),
)
)),
Expanded(flex:1,child: Container(),)
],
),),
Padding(
padding: EdgeInsets.only(left: 17.w, right: 17.w, top: 24.h),
child: Text(
@ -621,10 +677,11 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
///
Widget input() {
return Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16.h, bottom: 15.h),
color: Color(0xFFFDFCFC),
padding: EdgeInsets.only(top:14.h, bottom: 15.h),
child: Column(
children: [
///
Row(
children: [
Expanded(
@ -634,11 +691,11 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
left: 20.w,
),
decoration: BoxDecoration(
color: Color(0xFFF0FAF4),
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(6),
),
child: Container(
margin: EdgeInsets.symmetric(horizontal: 12.w),
margin: EdgeInsets.only(left:17.w),
alignment: Alignment.topLeft,
child: TextField(
textInputAction: TextInputAction.send,
@ -681,8 +738,8 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
padding: EdgeInsets.only(left: 15.w, right: 8.w),
child: Image.asset(
"assets/image/icon_chat_emo.webp",
height: 24,
width: 24,
height: 26.h,
width: 26.h,
)),
),
GestureDetector(
@ -698,8 +755,8 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
padding: EdgeInsets.only(left: 8.w, right: 19.w),
child: Image.asset(
"assets/image/fa_bu.webp",
height: 24,
width: 24,
height: 26.h,
width: 26.h,
),
),
),
@ -753,13 +810,14 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
Offstage(
offstage: !moreShow,
child: Container(
height: keyboard == -1 ? 270 : keyboard,
height: keyboard == -1 ? 167.h : keyboard,
child: Column(
children: [
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF7F7F7),
margin:EdgeInsets.only(bottom:10.h),
),
Row(
children: [
@ -768,14 +826,37 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
onTap: () {
getImageOrVideo(GalleryMode.video);
},
child: Container(
padding: EdgeInsets.only(
left: 19.w, right: 16.w, top: 11.h, bottom: 5.h),
child: Image.asset(
"assets/image/icon_chat_camera.webp",
height: 26,
width: 24,
),
child: Column(
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Color(0xFFFFFFFF),
boxShadow: [
BoxShadow(
color: Color(0xFFD5D5D5).withAlpha(25),
offset: Offset(4, 2),
blurRadius: 4,
spreadRadius: 0,
)
],
),
margin:EdgeInsets.only(right: 15.w,left: 14.w),
padding: EdgeInsets.all(12),
child: Image.asset(
"assets/image/icon_chat_camera.webp",
height: 24,
width: 24,
),
),
Padding(padding:EdgeInsets.only(top: 8.h),
child: Text(
"拍照",
style: TextStyle(
fontSize:12.sp, color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.regular,),
),),
],
),
),
GestureDetector(
@ -783,16 +864,37 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
onTap: () {
getImageOrVideo(GalleryMode.image);
},
child: Container(
// color: Colors.yellow,
padding: EdgeInsets.only(
left: 16.w, right: 16.w, top: 13.h, bottom: 5.h),
child: Image.asset(
"assets/image/icon_chat_photo.webp",
height: 24,
width: 24,
),
),
child: Column(
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Color(0xFFFFFFFF),
boxShadow: [
BoxShadow(
color: Color(0xFFD5D5D5).withAlpha(25),
offset: Offset(4, 2),
blurRadius: 4,
spreadRadius: 0,
)
],
),
padding: EdgeInsets.all(12),
child: Image.asset(
"assets/image/icon_chat_photo.webp",
height: 24,
width: 24,
),
),
Padding(padding:EdgeInsets.only(top: 8.h),
child: Text(
"相册",
style: TextStyle(
fontSize:12.sp, color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.regular,),
),),
],
)
),
],
)

134
lib/im/chat_friend_group.dart

@ -0,0 +1,134 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter/cupertino.dart';
import '../../generated/l10n.dart';
import '../../utils/font_weight.dart';
import '../main.dart';
import '../utils/event_type.dart';
import '../view_widget/my_tab.dart';
import 'im_view/custom_underline_tabIndicator.dart';
import 'im_view/friend_groip_list.dart';
class ChatFriendGroup extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _ChatFriendGroup();
}
}
class _ChatFriendGroup extends State<ChatFriendGroup>
with SingleTickerProviderStateMixin {
ApiService apiService;
TabController tabController;
List<GlobalKey> _allKey = [];
@override
void initState() {
super.initState();
tabController = TabController(length: 3, vsync: this, initialIndex: 0);
loadFinish();
}
loadFinish() {
_allKey = [GlobalKey(), GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFFFFFFF),
appBar: MyAppBar(
title: "好友(2)",
titleColor: Color(0xFF0D0D0D),
titleSize: 17.sp,
leading: true,
leadingColor: Colors.black,
background: Color(0xFFFFFFFF),
action: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/add_friend');
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(20.r),
boxShadow: [
BoxShadow(
color: Color(0xFF000000).withAlpha(25),
offset: Offset(0, 0),
blurRadius: 4,
spreadRadius: 0,
)
],
),
child: Image.asset(
"assets/image/add_friend.webp",
fit: BoxFit.fill,
height: 14.h,width: 14.h,
),
),
),
),
body: Container(
child: Column(
children: [
Align(
alignment: Alignment.centerLeft,
child: Theme(
data: ThemeData(
splashColor: Colors.transparent, //
highlightColor: Colors.transparent, //
),
child: TabBar(
controller: tabController,
isScrollable: true,
//
labelColor: Color(0xFF060606),
labelStyle: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
),
//
unselectedLabelColor: Color(0XFFA29E9E),
indicator: CustomUnderlineTabIndicator(
insets: EdgeInsets.only(top: 10.w, bottom: 2.w),
borderSide: BorderSide(width: 5.w, color: Color(0XFF32A060)),),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text: S.of(context).haoyou),
MyTab(text: S.of(context).guanzhu),
MyTab(text: S.of(context).fensi),
],
)),
),
Expanded(
child: TabBarView(
controller: tabController,
children: [
FriendGroupList(_allKey[0]),
FriendGroupList(_allKey[1]),
FriendGroupList(_allKey[2]),
],
),
)
],
),
),
);
}
}

0
lib/message/im/chat_setting.dart → lib/im/chat_setting.dart

0
lib/message/im/contact_share.dart → lib/im/contact_share.dart

96
lib/im/im_view/custom_underline_tabIndicator.dart

@ -0,0 +1,96 @@
import 'package:flutter/material.dart';
///UnderlineTabIndicator,StrokeCap.square StrokeCap.round
class CustomUnderlineTabIndicator extends Decoration {
/// Create an underline style selected tab indicator.
///
/// The [borderSide] and [insets] arguments must not be null.
const CustomUnderlineTabIndicator({
this.borderSide = const BorderSide(width: 2.0, color: Colors.white),
this.insets = EdgeInsets.zero,
}) : assert(borderSide != null),
assert(insets != null);
/// The color and weight of the horizontal line drawn below the selected tab.
final BorderSide borderSide;
/// Locates the selected tab's underline relative to the tab's boundary.
///
/// The [TabBar.indicatorSize] property can be used to define the tab
/// indicator's bounds in terms of its (centered) tab widget with
/// [TabBarIndicatorSize.label], or the entire tab with
/// [TabBarIndicatorSize.tab].
final EdgeInsetsGeometry insets;
@override
Decoration lerpFrom(Decoration a, double t) {
if (a is UnderlineTabIndicator) {
return UnderlineTabIndicator(
borderSide: BorderSide.lerp(a.borderSide, borderSide, t),
insets: EdgeInsetsGeometry.lerp(a.insets, insets, t),
);
}
return super.lerpFrom(a, t);
}
@override
Decoration lerpTo(Decoration b, double t) {
if (b is UnderlineTabIndicator) {
return UnderlineTabIndicator(
borderSide: BorderSide.lerp(borderSide, b.borderSide, t),
insets: EdgeInsetsGeometry.lerp(insets, b.insets, t),
);
}
return super.lerpTo(b, t);
}
@override
_UnderlinePainter createBoxPainter([VoidCallback onChanged]) {
return _UnderlinePainter(this, onChanged);
}
Rect _indicatorRectFor(Rect rect, TextDirection textDirection) {
assert(rect != null);
assert(textDirection != null);
final Rect indicator = insets.resolve(textDirection).deflateRect(rect);
return Rect.fromLTWH(
indicator.left,
indicator.bottom - borderSide.width,
indicator.width,
borderSide.width,
);
}
@override
Path getClipPath(Rect rect, TextDirection textDirection) {
return Path()..addRect(_indicatorRectFor(rect, textDirection));
}
}
class _UnderlinePainter extends BoxPainter {
_UnderlinePainter(this.decoration, VoidCallback onChanged)
: assert(decoration != null),
super(onChanged);
final CustomUnderlineTabIndicator decoration;
BorderSide get borderSide => decoration?.borderSide;
EdgeInsetsGeometry get insets => decoration?.insets;
@override
void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) {
assert(configuration != null);
assert(configuration.size != null);
final Rect rect = offset & configuration.size;
final TextDirection textDirection = configuration.textDirection;
final Rect indicator = decoration._indicatorRectFor(rect, textDirection)
.deflate(decoration.borderSide.width / 2.0);
final Paint paint = decoration.borderSide.toPaint();
paint.strokeWidth = 5;
paint.strokeCap = StrokeCap.round; //
canvas.drawLine(indicator.bottomLeft, indicator.bottomRight, paint);
}
}

125
lib/im/im_view/friend_groip_list.dart

@ -0,0 +1,125 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/retrofit_api.dart';
class FriendGroupList extends StatefulWidget {
FriendGroupList(
Key key,
) : super(key: key);
@override
State<StatefulWidget> createState() {
return _FriendGroupList();
}
}
class _FriendGroupList extends State<FriendGroupList> {
ApiService apiService;
final TextEditingController editingController = TextEditingController();
FocusNode _focusNode = FocusNode();
@override
void initState() {
super.initState();
}
///
@override
void dispose() {
_focusNode.unfocus();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: Column(
children: [
friendGroupSearch(),
Expanded(
child: ListView.builder(
itemCount: 10,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return friendGroupItem();
},
)),
],
),
);
}
Widget friendGroupItem() {
return Container(
margin: EdgeInsets.only(left:16.w,right:16.w,bottom: 24.h),
child: Row(children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(26.5.r),
),
child: Image.asset(
"assets/image/bs_mine_heading.webp",
width: 54.h,
height: 54.h,
fit: BoxFit.fill,
),
),
Padding(
padding: EdgeInsets.only(left: 4.w),
child: Text(
"哈喽喽哈",
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF060606),
fontWeight: FontWeight.w500),
),
)
]),
);
}
///
Widget friendGroupSearch() {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w,24.h),
padding: EdgeInsets.symmetric(vertical: 13.h),
decoration: BoxDecoration(
color: Color(0xFFFDFCFC),
borderRadius: BorderRadius.circular(4),
),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
},
controller: editingController,
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
hintText: "搜索",
hintStyle: TextStyle(
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
isCollapsed: true,
prefixIcon: Padding(
padding: EdgeInsets.only(left: 15.w, right: 5.w),
child: Image.asset(
"assets/image/icon_search.webp",
width: 14.h,
height: 14.h,
color: Color(0xFFB3B3B3),
),
),
prefixIconConstraints: BoxConstraints(),
border: InputBorder.none,
),
),
);
}
}

388
lib/im/im_view/im_page.dart

@ -0,0 +1,388 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/message.dart';
import 'package:huixiang/retrofit/data/msg_stats.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'on_chat_message.dart';
import 'on_chat_msg_instance.dart';
class IMPage extends StatefulWidget {
IMPage(Key key): super(key: key);
@override
State<StatefulWidget> createState() {
return _IMPage();
}
}
class _IMPage extends State<IMPage> implements OnChatMessage {
ApiService apiService;
int pageNum = 1;
List<Message> messages = [];
Map<String, int> msgNumber = {
"1": 0,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"6": 0,
};
int state = 0;
final TextEditingController imEditingController = TextEditingController();
@override
void onMessage(txt){
// SmartDialog.showToast("列表 $txt", alignment: Alignment.center);
}
@override
void dispose() {
super.dispose();
OnChatMsgInstance.instance.onChatMessage = null;
}
@override
void initState() {
super.initState();
OnChatMsgInstance.instance.onChatMessage = this;
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), token: value.getString("token"), context: context);
queryMessage();
queryMsgStats();
});
}
_refresh() {
pageNum = 1;
queryMessage();
queryMsgStats();
}
queryMessage() async {
BaseData<PageInfo<Message>> baseData = await apiService.msgList({
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
"state": "",
"typed": ""
}).catchError((onError) {
_refreshController.loadFailed();
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
if (pageNum == 1) {
messages.clear();
}
List<Message> message = [];
message.addAll(baseData.data.list);
message.forEach((element) {
if (element.typed == 2 || element.typed == 3) {
messages.add(element);
}
});
_refreshController.loadComplete();
_refreshController.refreshCompleted();
if (mounted) setState(() {});
if (pageNum * 10 > int.tryParse(baseData.data.total)) {
_refreshController.loadNoData();
} else {
pageNum += 1;
}
} else {
_refreshController.loadFailed();
_refreshController.refreshFailed();
}
}
queryMsgStats() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<MsgStats>> baseData =
await apiService.stats().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
msgNumber.forEach((key, value) {
msgNumber[key] = 0;
});
baseData.data.forEach((element) {
if (msgNumber.containsKey(element.name)) {
msgNumber[element.name] = element.number;
}
});
});
_refreshController.loadComplete();
_refreshController.refreshCompleted();
}
EasyLoading.dismiss();
}
RefreshController _refreshController = RefreshController();
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFFFFFFF),
body: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
loadStyle: LoadStyle.ShowWhenLoading,
builder: (BuildContext context, LoadStatus mode) {
return (messages.length == 0) ? Container() : MyFooter(mode);
},
),
controller: _refreshController,
onRefresh: _refresh,
onLoading: () {
setState(() {
_refresh();
});
},
child: Container(
// color: Colors.white,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFFD9FFDE),
Color(0xFFD9FFDE),
Color(0xFFFFFFFF),
Color(0xFFFFFFFF),
],
stops: [
0,
0.2,
0.4,
1
]),
),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
padding: EdgeInsets.only(bottom: 30.h),
child: Column(
children: [
Container(
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 12.h,
bottom: 15.h,right: 16.w,left: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
S.of(context).xiaoxi,
style: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: MyFontWeight.bold,
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/chat_friend_group');
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(20.r),
),
child: Image.asset(
"assets/image/friend_grouping.webp",
fit: BoxFit.fill,
height: 14.h,width: 14.h,
),
),
),
],
),
),
imSearchItem(),
chatList(),
// buildMessage(),fgg
],
),
),
),
),
),
);
}
///
Widget imSearchItem() {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 0),
padding: EdgeInsets.symmetric(vertical:13.h),
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
},
controller: imEditingController,
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
hintText: "搜索",
hintStyle: TextStyle(
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
isCollapsed: true,
prefixIcon: Padding(
padding: EdgeInsets.only(left: 15.w, right: 5.w),
child: Image.asset(
"assets/image/icon_search.webp",
width: 14.h,
height: 14.h,
color: Color(0xFF353535),
),
),
prefixIconConstraints: BoxConstraints(),
border: InputBorder.none,
),
),
);
}
///
Widget chatList(){
return Container(
child: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: 6,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
behavior:HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/chat_details_page');
},
child: chatItem(),
);
}),
);
}
Widget chatItem(){
return Container(
padding: EdgeInsets.only(left: 16.w,right: 17.w,bottom:18.h),
child: Row(
children: [
// MImage(
// "",
// isCircle: true,
// width: 40,
// height: 40,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_user.webp",
// fadeSrc: "assets/image/default_user.webp",
// ),
Image.asset(
"assets/image/fuka_zj.webp",
height:54.h,
width:54.h,
),
SizedBox(width: 12.w,),
Expanded(child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(child: Text(
"喽哈",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF060606),
fontWeight: MyFontWeight.semi_bold,
)),),
Text(
"2021.03.08 13:22",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.regular,
),
),
],
),
SizedBox(height: 7.h,),
Row(
children: [
Expanded(child:Text(
"新开的火锅店好吃得很",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular,
),
)),
Container(
width: 16,
height: 16,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xFFFF441A),
),
child: RoundButton(
text:"99",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
))
],
)
],
)),
],
),
);
}
}

0
lib/message/im/im_view/on_chat_message.dart → lib/im/im_view/on_chat_message.dart

0
lib/message/im/im_view/on_chat_msg_instance.dart → lib/im/im_view/on_chat_msg_instance.dart

0
lib/message/im/im_view/triangle_painter.dart → lib/im/im_view/triangle_painter.dart

4
lib/l10n/intl_en.arb

@ -748,6 +748,10 @@
"yinzhang":"印章",
"dianpuchongzhi":"店铺充值",
"zhuxiaozhanghao":"注销账号",
"main_menu6": "心聊",
"haoyou": "好友",
"zhaoren": "找人",

3
lib/l10n/intl_en_US.arb

@ -749,6 +749,9 @@
"yinzhang":"Seal",
"dianpuchongzhi":"Recharge",
"zhuxiaozhanghao":"Account cancellation",
"main_menu6": "Heart Chat",
"haoyou": "Friend",
"zhaoren": "Find for Friend",

3
lib/l10n/intl_zh_CN.arb

@ -749,6 +749,9 @@
"yinzhang":"印章",
"dianpuchongzhi":"店铺充值",
"zhuxiaozhanghao":"注销账号",
"main_menu6": "心聊",
"haoyou": "好友",
"zhaoren": "找人",

3
lib/l10n/intl_zh_Hans_CN.arb

@ -749,6 +749,9 @@
"yinzhang":"印章",
"dianpuchongzhi":"店铺充值",
"zhuxiaozhanghao":"注销账号",
"main_menu6": "心聊",
"haoyou": "好友",
"zhaoren": "找人",

3
lib/l10n/intl_zh_Hant_CN.arb

@ -740,6 +740,9 @@
"yinzhang":"印章",
"dianpuchongzhi":"店鋪充值",
"zhuxiaozhanghao":"註銷帳號",
"main_menu6": "心聊",
"haoyou": "好友",
"zhaoren": "找人",

3
lib/l10n/intl_zh_TW.arb

@ -742,6 +742,9 @@
"yinzhang":"印章",
"dianpuchongzhi":"店鋪充值",
"zhuxiaozhanghao":"註銷帳號",
"main_menu6": "心聊",
"haoyou": "好友",
"zhaoren": "找人",

12
lib/main.dart

@ -145,13 +145,15 @@ import 'home/start_page.dart';
import 'home/trading_card_page.dart';
import 'home/welfare_exchange.dart';
import 'home/welfare_page.dart';
import 'im/add_friend.dart';
import 'im/chat_details_page.dart';
import 'im/chat_friend_group.dart';
import 'im/chat_setting.dart';
import 'im/contact_share.dart';
import 'login/login_store_select.dart';
import 'login/new_login_page.dart';
import 'login/phone_address_page.dart';
import 'main_page.dart';
import 'message/im/chat_details_page.dart';
import 'message/im/chat_setting.dart';
import 'message/im/contact_share.dart';
import 'message/system_details.dart';
import 'message/system_notice.dart';
import 'mine/coupon_page.dart';
@ -497,6 +499,10 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
ChatDetailsPage(),
'/router/chat_setting': (context, {arguments}) =>
ChatSetting(),
'/router/chat_friend_group': (context, {arguments}) =>
ChatFriendGroup(),
'/router/add_friend': (context, {arguments}) =>
AddFriend(),
'/router/notice_setting': (context, {arguments}) =>
NoticeSetting(),
'/router/share_trends': (context, {arguments}) =>

13
lib/main_page.dart

@ -35,7 +35,7 @@ import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
import 'community/order_page.dart';
import 'message/im/im_view/on_chat_msg_instance.dart';
import 'im/im_view/im_page.dart';
class MainPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -55,7 +55,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
final GlobalKey homePageKey = GlobalKey();
final GlobalKey minePageKey = GlobalKey();
final GlobalKey unionPageKey = GlobalKey();
final GlobalKey vipPageKey = GlobalKey();
// final GlobalKey vipPageKey = GlobalKey();
final GlobalKey imPageKey = GlobalKey();
// List<String> iconn;
ApiService apiService;
@ -156,7 +157,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
),
// MainHomePage(),
UnionPage(unionPageKey, 0),
VipPage(vipPageKey),
// VipPage(vipPageKey),
IMPage(imPageKey),
Platform.isAndroid
? (ExamineInstance.instance.isExamine ? OrderPage() : CommunityPage())
: CommunityPage(),
@ -167,7 +169,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
icons = [
"assets/svg/jingbi.svg",
"assets/svg/lianmeng.svg",
"assets/svg/huixiang_vip.svg",
// "assets/svg/huixiang_vip.svg",
"assets/svg/im.svg",
"assets/svg/shequn.svg",
"assets/svg/wode.svg",
];
@ -512,7 +515,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
bottomNavigationItem(S.of(context).main_menu1, 0),
bottomNavigationItem(S.of(context).main_menu2, 1),
// bottomNavigationItem(S.of(context).main_menu3 , 2),
bottomNavigationItem(S.of(context).main_menu5, 2),
bottomNavigationItem(S.of(context).main_menu6, 2),
bottomNavigationItem(
Platform.isAndroid
? (ExamineInstance.instance.isExamine

234
lib/message/system_message.dart

@ -18,9 +18,9 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../im/im_view/on_chat_message.dart';
import '../im/im_view/on_chat_msg_instance.dart';
import '../view_widget/custom_image.dart';
import 'im/im_view/on_chat_message.dart';
import 'im/im_view/on_chat_msg_instance.dart';
class SystemMessagePage extends StatefulWidget {
@override
@ -29,7 +29,7 @@ class SystemMessagePage extends StatefulWidget {
}
}
class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessage {
class _SystemMessagePage extends State<SystemMessagePage>{
ApiService apiService;
int pageNum = 1;
List<Message> messages = [];
@ -43,21 +43,9 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
};
int state = 0;
@override
void onMessage(txt){
// SmartDialog.showToast("列表 $txt", alignment: Alignment.center);
}
@override
void dispose() {
super.dispose();
OnChatMsgInstance.instance.onChatMessage = null;
}
@override
void initState() {
super.initState();
OnChatMsgInstance.instance.onChatMessage = this;
SharedPreferences.getInstance().then((value) {
apiService =
@ -171,9 +159,10 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
// ),
// ],
// ),
backgroundColor: Colors.white,
body: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
enablePullUp: true,
header: MyHeader(),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
@ -190,7 +179,6 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
});
},
child: Container(
color: Colors.white,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
@ -224,13 +212,13 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
),
Expanded(
child: Text(
S.of(context).xiaoxi,
style: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: MyFontWeight.bold,
),
)),
S.of(context).xiaoxi,
style: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: MyFontWeight.bold,
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
@ -301,9 +289,11 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
},
child:messageItem("assets/image/icon_system_message.webp", S.of(context).xitongxiaoxi, (msgNumber["2"]+msgNumber["3"]).toString()),
),
// newSurvey(),
chatList(),
// buildMessage(),fgg
// newsSurvey(),
// SizedBox(
// height: 16.h,
// ),
// buildMessage(),
],
),
),
@ -342,36 +332,36 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
width: 9.w,
),
if(messageNum != "0")
((double.tryParse(messageNum) < 100)?
Container(
width: 16,
height: 16,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xFFFF441A),
),
child: RoundButton(
text:messageNum,
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
)):
Container(
padding: EdgeInsets.symmetric(horizontal:4.w,vertical:2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xFFFF441A),
),
child: RoundButton(
text:"99+",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
))),
((double.tryParse(messageNum) < 100)?
Container(
width: 16,
height: 16,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xFFFF441A),
),
child: RoundButton(
text:messageNum,
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
)):
Container(
padding: EdgeInsets.symmetric(horizontal:4.w,vertical:2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xFFFF441A),
),
child: RoundButton(
text:"99+",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
))),
Spacer(),
Icon(
Icons.keyboard_arrow_right,
@ -379,6 +369,7 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
),
],
),
if(title != S.of(context).xitongxiaoxi)
Container(
margin: EdgeInsets.only(top: 12.h),
width: double.infinity,
@ -390,7 +381,7 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
);
}
Widget newSurvey() {
Widget newsSurvey() {
return Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
@ -572,7 +563,6 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
);
}
///
Widget buildMessage() {
return Container(
color: Colors.white,
@ -633,6 +623,20 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
Widget buildMessageItem(Message message) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
// margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h),
// padding: EdgeInsets.all(20.w),
// decoration: BoxDecoration(
// color: Colors.white,
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// borderRadius: BorderRadius.circular(8),
// ),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
@ -854,116 +858,4 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
// ),
);
}
///
Widget chatList(){
return Container(
child: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: 6,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
behavior:HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/chat_details_page');
},
child: chatItem(),
);
}),
);
}
Widget chatItem(){
return Container(
padding: EdgeInsets.only(left: 16.w,right: 17.w,bottom:27.h),
child: Column(
children: [
Row(
children: [
// MImage(
// "",
// isCircle: true,
// width: 40,
// height: 40,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_user.webp",
// fadeSrc: "assets/image/default_user.webp",
// ),
Image.asset(
"assets/image/fuka_zj.webp",
height:40,
width:40,
),
SizedBox(width: 12.w,),
Expanded(child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(child: Text(
"好大一只鞋子",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF060606),
fontWeight: MyFontWeight.semi_bold,
)),),
Text(
"2021.03.08 13:22",
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.regular,
),
),
],
),
SizedBox(height: 7.h,),
Row(
children: [
Expanded(child:Text(
"新开的火锅店好吃得很",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular,
),
)),
Container(
width: 16,
height: 16,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xFFFF441A),
),
child: RoundButton(
text:"99",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
))
],
)
],
)),
],
),
Container(
margin: EdgeInsets.only(top: 12.h),
width: double.infinity,
height: 1.h,
color: Color(0xFFF7F7F7),
)
],
),
);
}
}

37
lib/union/union_page.dart

@ -225,6 +225,24 @@ class UnionPageState extends State<UnionPage>
alignment: Alignment.bottomCenter,
children: [
Container(
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 17.h),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF32A060),
Color(0xFF32A060),
Colors.white,
Colors.white,
],
stops: [
0,
0.2,
0.4,
1
]),
),
child: Column(
children: [
Row(
@ -319,25 +337,6 @@ class UnionPageState extends State<UnionPage>
)
],
),
padding:
EdgeInsets.only(top: MediaQuery.of(context).padding.top + 17.h),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF32A060),
Color(0xFF32A060),
Colors.white,
Colors.white,
],
stops: [
0,
0.2,
0.4,
1
]),
),
),
if (_isShowLocalTips)
Padding(

4
lib/view_widget/my_appbar.dart

@ -58,7 +58,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
@override
Widget build(BuildContext context) {
return AppBar(
backgroundColor: background,
backgroundColor: background ??Colors.transparent,
elevation: 0,
brightness: brightness,
leading: leading
@ -93,7 +93,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
},
child: Container(
width: double.infinity,
margin: EdgeInsets.only(right:50.w),
margin: EdgeInsets.only(right:actions.isNotEmpty?0:50.w),
padding: EdgeInsets.all(10),
alignment: Alignment.center,
child: Text(

Loading…
Cancel
Save