Code Monkey home page Code Monkey logo

book's Issues

求教求教求教

小说分页是如何实现的呢,如何才能知道每页要显示多少个字符,本人新手小白,代码实在看不太懂。

可否简单跟我讲讲。

关于flutter pub run build_runner build

修改了entity HotBook.dart 对象属性之后 重新生成HotBook.g.dart

发现build_runner被注释,尝试使用原版本build报错

flutter pub run build_runner build --delete-conflicting-outputs
[INFO] Generating build script...
[INFO] Generating build script completed, took 787ms

[WARNING] Deleted previous snapshot due to missing asset graph.
[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 15.9s

[INFO] There was output on stdout while compiling the build script snapshot, run with `--verbose` to see it (you will need to run a `clean` first to re-snapshot).

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 975ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Deleting 17 declared outputs which already existed on disk.
[INFO] Checking for unexpected pre-existing outputs. completed, took 6ms

[INFO] Running build...
[INFO] 1.2s elapsed, 11/26 actions completed.
[SEVERE] json_serializable:json_serializable on lib/entity/ReadPage.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/ReadPage.dart:7:7
  ╷
7 │ class ReadPage {
  │       ^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/GBook.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/GBook.dart:6:7
  ╷
6 │ class GBook {
  │       ^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/ChapterList.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/ChapterList.dart:7:7
  ╷
7 │ class ChapterList {
  │       ^^^^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/TextLine.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/TextLine.dart:6:7
  ╷
6 │ class TextLine {
  │       ^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/BookVotec.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/BookVotec.dart:4:7
  ╷
4 │ class BookVotec {
  │       ^^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/BookTag.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/BookTag.dart:6:7
  ╷
6 │ class BookTag {
  │       ^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/DetailVO.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/DetailVO.dart:6:7
  ╷
6 │ class DetailVO {
  │       ^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/Info.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/Info.dart:6:7
  ╷
6 │ class Info {
  │       ^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/BookInfo.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/BookInfo.dart:8:7
  ╷
8 │ class BookInfo {
  │       ^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/Chapter.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/Chapter.dart:6:7
  ╷
6 │ class Chapter {
  │       ^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/TopBook.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/TopBook.dart:6:7
  ╷
6 │ class TopBooks {
  │       ^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/Book.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/Book.dart:6:7
  ╷
6 │ class Book {
  │       ^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/ParseContentConfig.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/ParseContentConfig.dart:6:7
  ╷
6 │ class ParseContentConfig {
  │       ^^^^^^^^^^^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/SearchItem.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/SearchItem.dart:6:7
  ╷
6 │ class SearchItem {
  │       ^^^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/HotBook.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/HotBook.dart:6:7
  ╷
6 │ class HotBook {
  │       ^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/TextPage.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/TextPage.dart:7:7
  ╷
7 │ class TextPage {
  │       ^^^^^^^^
  ╵
[SEVERE] json_serializable:json_serializable on lib/entity/TopResult.dart:

Generator cannot target libraries that have not been migrated to null-safety.
package:book/entity/TopResult.dart:7:7
  ╷
7 │ class TopResult {
  │       ^^^^^^^^^
  ╵
[INFO] Running build completed, took 2.7s

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 67ms

[SEVERE] Failed after 2.8s

那我升版本或者降到无null safety版本 之后再运行build报错

Failed to build build_runner:build_runner:
/usr/local/flutter/.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:258:50: Error: The property 'displayString' is defined in multiple extensions for 'TargetKind' and neither is more specific.
 - 'TargetKind' is from 'package:meta/meta_meta.dart' ('/usr/local/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/lib/meta_meta.dart').
Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.
        var kindNames = kinds.map((kind) => kind.displayString).toList()
                                                 ^^^^^^^^^^^^^
/usr/local/flutter/.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:1950:14: Context: This is one of the extension members.
  String get displayString {
             ^^^^^^^^^^^^^
/usr/local/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/lib/meta_meta.dart:91:14: Context: This is one of the extension members.
  String get displayString {
             ^^^^^^^^^^^^^
/usr/local/flutter/.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:260:36: Error: The getter 'commaSeparatedWithOr' isn't defined for the class 'List<dynamic>'.
 - 'List' is from 'dart:core'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'commaSeparatedWithOr'.
        var validKinds = kindNames.commaSeparatedWithOr;
                                   ^^^^^^^^^^^^^^^^^^^^

�请问有没有保持版本可以编译通过的办法

flutter pub outdated --mode=null-safety 
Showing dependencies that are currently not opted in to null-safety.
[✗] indicates versions without null safety support.
[✓] indicates versions opting in to null safety.

Package Name               Current       Upgradable    Resolvable    Latest

direct dependencies:
flutter_statusbar_manager  ✗2.0.0 (git)  ✗2.0.0 (git)  ✗2.0.0 (git)  ✗2.0.0 (git)
flutter_swiper             ✗1.1.6        ✗1.1.6        ✗1.1.6        ✗1.1.6

dev_dependencies:
build_runner               ✗1.12.2       ✗1.12.2       ✓2.1.5        ✓2.1.5

或者如果要升级到null-safety的话 flutter_statusbar_manager flutter_swiper这两个package又好像没办法直接升 有办法吗

🐂

🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂🐂

protobuf

chapter.proto文件能不能给个schema,章节数据都从这个来

教程

出一个部署教程?

Flutter的版本是多少,pub get 一直失败

dart --version
Dart SDK version: 2.12.4 (stable) (Thu Apr 15 12:26:53 2021 +0200) on "macos_x64"
judgerhu@hujiajundeMac-mini book % flutter pub get
Resolving dependencies...
The lower bound of "sdk: '>=2.10.0 <3.0.0'" must be 2.12.0'
or higher to enable null safety.

The current Dart SDK (3.1.5) only supports null safety.

解决翻页卡顿建议

这种方式的翻页TextPainter有性能问题,你给TextSpan指定下fontFamily会流畅非常多。

连接超时

进入软件后如图,显示连接超时,试着挂了梯但没什么效果,请问这种情况是怎么回事?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.