This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// em…………由于大量文字计算,即Cpu计算,在UI的Isolate会阻塞后续的UI事件(例如跳转,动画啥的),所以采取新建Isolate的方式,这也是flutter中建议的&…… | |
/// 但是目前尴尬的是: | |
/// 非UI的Isolate不支持UI控件,即下面的textPainter.layout废了……一调用就报错 | |
/// https://github.com/flutter/flutter/issues/30604 | |
/// 所以,理论上来说,这块的计算应该放到一个子线程中,对于目前功能来说,也可以说是isolate中,但是flutter 现在不支持…… | |
/// 现在个人有几种想法: | |
/// 1、翻页的时候动态计算,只缓存几页的内容,下次翻页的时候再计算 | |
/// 2、https://github.com/flutter/flutter/issues/30604 裁剪canvas | |
/// 3、平台计算…… |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2016 The Chromium Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
import 'dart:async'; | |
import 'dart:math' as math; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/physics.dart'; | |
import 'package:flutter/rendering.dart'; |