浏览代码

全局context

master
ZCM 5 年前
父节点
当前提交
636b60da59
共有 2 个文件被更改,包括 1 次插入28 次删除
  1. +0
    -27
      lib/chat/ChatPage.dart
  2. +1
    -1
      lib/data/constants.dart

+ 0
- 27
lib/chat/ChatPage.dart 查看文件

@@ -366,33 +366,6 @@ class _ChatPageState extends State<ChatPage> {
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFE2E9F1), backgroundColor: const Color(0xFFE2E9F1),
// appBar: PreferredSize(
// preferredSize: Size.fromHeight(58),
// child: Container(
// color: AppBarTheme.of(context).color,
// child: SafeArea(
// child: Container(
// height: 56,
// child: Row(children: <Widget>[
// SizedBox(width: 10),
// CustomUI.buildCustomLeading(context),
// Text(
// Provider.of<RefNameProvider>(context)
// .getRefName(friendInfo.userId,
// friendInfo.nickName),
// textScaleFactor: 1.0,
// style: TextStyle(
// textBaseline: TextBaseline.ideographic,
// color: Constants.BlackTextColor,
// fontSize: 16.47),
// ),
// Expanded(
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.end,
// children: actions))
// ]),
// )))),
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
'${Provider.of<RefNameProvider>(context).getRefName(friendInfo.userId, friendInfo.nickName)}', '${Provider.of<RefNameProvider>(context).getRefName(friendInfo.userId, friendInfo.nickName)}',


+ 1
- 1
lib/data/constants.dart 查看文件

@@ -117,7 +117,7 @@ class Constants {
static NavigatorState getCurrentState() => navigatorKey.currentState; static NavigatorState getCurrentState() => navigatorKey.currentState;
/// 获取当前的context /// 获取当前的context
static BuildContext getCurrentContext() => navigatorKey.currentContext;
static BuildContext getCurrentContext() => navigatorKey.currentState.overlay.context;//navigatorKey.currentContext;
///在pubspec.yaml中修改版本号 ///在pubspec.yaml中修改版本号
static String versionName = '1.0.0'; static String versionName = '1.0.0';


正在加载...
取消
保存