From bcf1796bf63b07cc1cf00ba6485dc95830e36da7 Mon Sep 17 00:00:00 2001 From: spadek <1437921734@qq.com> Date: Fri, 26 Apr 2019 13:38:46 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/command/cmdMethod.dart | 1 + lib/src/view/route/dataRoute.dart | 74 +++++++++++++++---------------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/lib/src/command/cmdMethod.dart b/lib/src/command/cmdMethod.dart index 9efba85..a97c1a1 100644 --- a/lib/src/command/cmdMethod.dart +++ b/lib/src/command/cmdMethod.dart @@ -148,6 +148,7 @@ class CmdMethodUtil { return answer.first; } + ///创建一个线程用于计算微积分 static void _isolateCalculus(SendPort port) { final rPort = ReceivePort(); port.send(rPort.sendPort); diff --git a/lib/src/view/route/dataRoute.dart b/lib/src/view/route/dataRoute.dart index ce87c24..f71d945 100644 --- a/lib/src/view/route/dataRoute.dart +++ b/lib/src/view/route/dataRoute.dart @@ -222,42 +222,42 @@ class AndDataRoute extends StatelessWidget { length: 2, //tabBar的数量 child: Scaffold( body: NestedScrollView( - headerSliverBuilder: (context, isShow) => [ - SliverAppBar( - actions: [ - IconButton( - icon: Icon(Icons.delete), - onPressed: () => _handleEmpty(context), - ), - ], - title: Text("Saved"), - centerTitle: true, - pinned: false, - expandedHeight: 100.0, - ), - SliverPersistentHeader( - delegate: _SliverAppBarDelegate(TabBar( - labelColor: Colors.black, - indicatorColor: CupertinoColors.white, - tabs: [ - Tab( - text: "Data", - ), - Tab( - text: "Method", - ), - ], - )), - pinned: true, - ) - ], - body: TabBarView( - children: [ - _buildDataView(), - _buildMethodView(), + headerSliverBuilder: (context, isShow) => [ + SliverAppBar( + actions: [ + IconButton( + icon: Icon(Icons.delete), + onPressed: () => _handleEmpty(context), + ), + ], + title: Text("Saved"), + centerTitle: true, + pinned: false, + expandedHeight: 100.0, + ), + SliverPersistentHeader( + delegate: _SliverAppBarDelegate(TabBar( + labelColor: Colors.black, + indicatorColor: CupertinoColors.white, + tabs: [ + Tab( + text: "Data", + ), + Tab( + text: "Method", + ), + ], + )), + pinned: true, + ) ], - ), + body: TabBarView( + children: [ + _buildDataView(), + _buildMethodView(), + ], ), + ), floatingActionButton: FloatingActionButton( child: const Icon(Icons.add), onPressed: () { @@ -373,9 +373,9 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { Widget build( BuildContext context, double shrinkOffset, bool overlapsContent) { return new Container( - color: Colors.blue, - child: _tabBar, - ); + color: Colors.blue, + child: _tabBar, + ); } @override