Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译不通过 #3

Closed
wangj919 opened this issue Dec 8, 2023 · 6 comments
Closed

编译不通过 #3

wangj919 opened this issue Dec 8, 2023 · 6 comments

Comments

@wangj919
Copy link

wangj919 commented Dec 8, 2023

tdesign-flutter 版本

0.1.0

重现链接

No response

重现步骤

运行 example 编译不通过

Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
../lib/src/components/tabbar/td_bottom_tab_bar.dart:742:39: Error: Property 'context' cannot be accessed on 'OverlayState?' because it is potentially null.

  • 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('../../../../flutter/packages/flutter/lib/src/widgets/overlay.dart').
    Try accessing using ?. instead.
    Overlay.of(widget.btnContext).context.findRenderObject() as RenderBox;
    ^^^^^^^
    ../lib/src/components/toast/td_toast.dart:86:20: Error: Method 'insert' cannot be called on 'OverlayState?' because it is potentially null.
  • 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('../../../../flutter/packages/flutter/lib/src/widgets/overlay.dart').
    Try calling using ?. instead.
    overlayState.insert(_overlayEntry!);
    ^^^^^^
    ../lib/src/components/tabs/td_horizontal_tab_bar.dart:554:45: Error: Property 'color' cannot be accessed on 'MaterialInkController?' because it is potentially null.
  • 'MaterialInkController' is from 'package:flutter/src/material/material.dart' ('../../../../flutter/packages/flutter/lib/src/material/material.dart').
    Try accessing using ?. instead.
    color.value == Material.of(context).color?.value) {
    ^^^^^
    ../lib/src/components/tabs/td_horizontal_tab_bar.dart:1561:29: Error: Property 'animation' cannot be accessed on 'TabController?' because it is potentially null.
  • 'TabController' is from 'package:flutter/src/material/tab_controller.dart' ('../../../../flutter/packages/flutter/lib/src/material/tab_controller.dart').
    Try accessing using ?. instead.
    parent: tabController.animation!,
    ^^^^^^^^^
    ../lib/src/components/tabs/td_horizontal_tab_bar.dart:1569:39: Error: Property 'index' cannot be accessed on 'TabController?' because it is potentially null.
  • 'TabController' is from 'package:flutter/src/material/tab_controller.dart' ('../../../../flutter/packages/flutter/lib/src/material/tab_controller.dart').
    Try accessing using ?. instead.
    tabIndex: tabController.index + 1,
    ^^^^^
    ../lib/src/components/tabs/td_horizontal_tab_bar.dart:1570:39: Error: Property 'length' cannot be accessed on 'TabController?' because it is potentially null.
  • 'TabController' is from 'package:flutter/src/material/tab_controller.dart' ('../../../../flutter/packages/flutter/lib/src/material/tab_controller.dart').
    Try accessing using ?. instead.
    tabCount: tabController.length),
    ^^^^^^
    ../lib/src/components/tabs/td_horizontal_tab_bar.dart:1574:53: Error: Property 'length' cannot be accessed on 'TabController?' because it is potentially null.
  • 'TabController' is from 'package:flutter/src/material/tab_controller.dart' ('../../../../flutter/packages/flutter/lib/src/material/tab_controller.dart').
    Try accessing using ?. instead.
    List.generate(tabController.length, (int tabIndex) {
    ^^^^^^
    ../lib/src/components/tabs/td_horizontal_tab_bar.dart:1575:51: Error: The argument type 'TabController?' can't be assigned to the parameter type 'TabController' because 'TabController?' is nullable and 'TabController' isn't.
  • 'TabController' is from 'package:flutter/src/material/tab_controller.dart' ('../../../../flutter/packages/flutter/lib/src/material/tab_controller.dart').
    return _buildTabIndicator(tabIndex, tabController,
    ^
    Failed to compile application.

期望结果

正常运行

实际结果

No response

Flutter版本

3.3.0

设备与机型信息

No response

系统版本

No response

补充说明

小白不太懂,请教下各位大佬

Copy link

github-actions bot commented Dec 8, 2023

👋 @wangj919,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@wangj919 wangj919 changed the title 编译不过 编译不通过 Dec 8, 2023
@Luozf12345
Copy link
Collaborator

请问你使用的是哪个版本的Flutter SDK 呢?tdesign_flutter升级为0.1.1版本试试呢?

@wangj919
Copy link
Author

请问你使用的是哪个版本的Flutter SDK 呢?tdesign_flutter升级为0.1.1版本试试呢?

3.3.0 官网推荐的版本了,0.1.1 也试过了,编译不过了

@Luozf12345
Copy link
Collaborator

可以用flutter 3.10版本试下能否编译通过,我这边也用3.3尝试复现一下。

@moujunqiang
Copy link

我也碰到了这个问题,请问这个问题解决了吗3.3版本

@Luozf12345
Copy link
Collaborator

0.1.2版本,最低支持版本改为3.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants