Skip to content

Problems encountered when running the sample project(运行示例项目碰到的问题) #171

Description

@Alrey-xxl

Q1:../lib/mp/chart/chart.dart:51:12: Error: The method 'then' isn't defined for the class 'FutureOr<dynamic>'. Try correcting the name to the name of an existing method, or defining a method named 'then'. .then((value) {

A1:change ‘../lib/mp/chart/chart.dart:51’
before:
ImageGallerySaver.saveImage(Uint8List.fromList(imgFile.readAsBytesSync())) .then((value) { imgFile.delete(); });
after:
var result = ImageGallerySaver.saveImage(Uint8List.fromList(imgFile.readAsBytesSync())); if(result is Future<dynamic>){ result.then((value) => imgFile.delete()); }

Q2:`../lib/mp/core/utils/painter_utils.dart:15:34: Error: The getter 'text' isn't defined for the class 'InlineSpan'.

  • 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/E:/flutter/packages/flutter/lib/src/painting/inline_span.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'text'.
    var preText = painter.text.text;A2:change '../lib/mp/core/utils/painter_utils.dart:15' before:var preText = painter.text.text;after:var preText = (painter.text as TextSpan).text;`

If you have other questions, you can try to leave me a message

Activity

  1. changed the title [-]Problems encountered when running the sample project[/-] [+]Problems encountered when running the sample project(运行示例项目碰到的问题)[/+] on Jul 6, 2021
  2. Alrey-xxl commented on Jul 12, 2021

    @Alrey-xxl
    Author

    Q3:If you are running the flutter app, the [mark] of [chart] can be displayed normally, but the [mark] cannot be displayed normally after being integrated into Android, you may need to make the following changes:
    Source file: line 197 of core/utils/screen_utils.dart, the variable [_screenDensity] is changed to [_screenWidth]
    (如果你在运行flutter app时,[chart]的[mark]能正常显示,但是集成到Android后却无法正常显示[mark],可能要做如下修改:
    源文件:core/utils/screen_utils.dart的第197行,的变量[_screenDensity]改为[_screenWidth])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions