flutter模仿微信的例子

git地址:

 

1.flutter webchar源码结构

flutter模仿微信的例子_第1张图片

2.运行效果

flutter模仿微信的例子_第2张图片

 

3. im/all_im.dart

export 'login_handle.dart';
export 'search_handle.dart';
export 'friend_handle.dart';
export 'message_handle.dart';
export 'search_handle.dart';
export 'search_handle.dart';

4.包括模块为:

微信的仿照模块

  • 登录
  • 查询
  • 好友发现
  • 扫一扫
  • 用户列表

main.dart

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:dim_example/config/provider_config.dart';
import 'package:dim_example/app.dart';

import 'config/storage_manager.dart';

void main() async {
  /// 确保初始化
  WidgetsFlutterBinding.ensureInitialized();

  /// 配置初始化
  await StorageManager.init();

  /// APP入口并配置Provider
  runApp(ProviderConfig.getInstance().getGlobal(MyApp()));

  /// 自定义报错页面
  ErrorWidget.builder = (FlutterErrorDetails flutterErrorDetails) {
    debugPrint(flutterErrorDetails.toString());
    return new Center(child: new Text("App错误,快去反馈给作者!"));
  };

  /// Android状态栏透明
  if (Platform.isAndroid) {
    SystemUiOverlayStyle systemUiOverlayStyle =
        SystemUiOverlayStyle(statusBarColor: Colors.transparent);
    SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  }
}

5.操作日志

E/flutter (11385): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type 'String' is not a subtype of type 'List'
E/flutter (11385): #0      ContactsPageData.listFriend.getMethod (package:dim_example/im/model/contacts.dart:45:24)
E/flutter (11385): #1      ContactsPageData.listFriend (package:dim_example/im/model/contacts.dart:91:31)
E/flutter (11385):
E/flutter (11385): #2      _ContactsPageState.getContacts (package:dim_example/pages/contacts/contacts_page.dart:32:42)
E/flutter (11385): #3      _ContactsPageState.initState (package:dim_example/pages/contacts/contacts_page.dart:117:5)
E/flutter (11385): #4      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4355:58)
E/flutter (11385): #5      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter (11385): #6      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter (11385): #7      Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter (11385): #8      SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)
E/flutter (11385): #9      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter (11385): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter (11385): #11     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)
E/flutter (11385): #12     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter (11385): #13     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter (11385): #14     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
E/flutter (11385): #15     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
E/flutter (11385): #16     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
E/flutter (11385): #17     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter (11385): #18     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter (11385): #19     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter (11385): #20     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
E/flutter (11385): #21     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
E/flutter (11385): #22     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
E/flutter (11385): #23     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter (11385): #24     ParentDataElement.mount (package:flutter/src/widgets/framework.dart:4617:11)
E/flutter (11385): #25     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter (11385): #26     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter (11385): #27     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
E/flutter (11385): #28     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
E/flutter (11385): #29     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
E/flutter (11385): #30     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11)
E/flutter (11385): #31     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter (11385): #32     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter (11385): #33     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter (11385): #34     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
E/flutter (11385): #35     Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
E/flutter (11385): #36     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
E/flutter (11385): #37     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter (11385): #38     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter (11385): #39     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter (11385): #40     SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1288:36)
E/flutter (11385): #41     SliverMultiBoxAdaptorElement.createChild. (package:flutter/src/widgets/sliver.dart:1273:20)
E/flutter (11385): #42     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2412:19)
E/flutter (11385): #43     SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:1266:11)
E/flutter (11385): #44     RenderSliverMultiBoxAdaptor._createOrObtainChild. I/imsdk   (11385): TIM: 2020-04-11 17:35:43.310/I/11385-11465     /DataReport  -data_report_manager.cpp.65  operator()                     /first delay report task come
I/imsdk   (11385): TIM: 2020-04-11 17:35:48.416/I/11385-11465     /DataReport  -data_report_channel.cpp.126  operator()                    /SendData response|rsp_result:0|err_msg:ok
I/imsdk   (11385): TIM: 2020-04-11 17:36:06.411/I/11385-11385     /IMSDK       -TIMFriendshipManager.0                                     /getUsersProfile called
I/imsdk   (11385): TIM: 2020-04-11 17:36:06.411/I/11385-11385     /FriendShip  -imcore_friendship_manager.cpp.44  GetProfileAll            /identifier_list:1|forceUpdate:1
W

你可能感兴趣的:(Flutter实践大全)