caduandrade / tabbed_view

Widget inspired by the classic Desktop-style tab component.
MIT License
51 stars 16 forks source link

[bug?] add rendering.dart on tab_button_widget.dart to fix SystemMouseCursors.click error #4

Closed b14cknc0d3 closed 3 years ago

b14cknc0d3 commented 3 years ago

i need to add this for window[tested] to fix MouseRegion in src\tabbed_button_widget.dart import 'package:flutter/rendering.dart';

return MouseRegion(
        cursor: SystemMouseCursors.click,
        onEnter: _onEnter,
        onExit: _onExit,
        child: GestureDetector(child: icon, onTap: onPressed));
  }
caduandrade commented 3 years ago

This is scary as it compiles normally without the import. Did you have a problem with Windows? What is the problem? The cursor does not change? It only worked when you added the import?

b14cknc0d3 commented 3 years ago

When I was using tabbed view first time . I was facing the same problem and I commented out

 SystemMouseCursors 

somewhere I don't remember the exact location. Today when I updated to the latest package. Then the problem also occurred. So, I imported the import 'package:flutter/rendering.dart'; base on the StackOverflow question, and it worked fine.

caduandrade commented 3 years ago

Hi!

Do you still have the link to this question on StackOverflow? If so, I can link to the issue.

Are you locally changing a clone of tabbed_view by adding this import and then importing that changed tabbed_view into your project?

b14cknc0d3 commented 3 years ago

statckoverflow No, I change directly to the package [pub-cache] Here is the Logs. If I don't add rendering. dart it won't build.

/P:/flutter_windows_2.0.6-stable/flutter/.pub-cache/hosted/pub.dartlang.org/tabbed_view-1.2.0/lib/src/tab_button_widget.dart(77,17): error GD65BB2B6: The getter 'SystemMouseCursors' isn't defined for the class 'TabButtonWidgetState'. [P:\backup\flutter_trai\build\windows\flutter\flutter_assemble.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for 'P:\backup\build\windows\CMakeFiles\a8f44d55808fd5fbaf93c5f5c450a883\flutter_windows.dll.rule;P:\backup\websocket_tester\build\windows\CMakeFiles\eccd846fbeb91a552a6bd973985d794a\flutter_assemble.rule' exited with code 1. [P:\backup\build\windows\flutter\flutter_assemble.vcxproj]
caduandrade commented 3 years ago

OK! I'm finalizing another bug then I generate a version with both.

If possible, can I ask you a favor? This looks like a bug in Flutter! Could you open an issue for them? It's easy, just paste this build text, a sample code, and the result of "flutter doctor -v". With that, I will be able to commit with a comment with this import linking to this issue. Otherwise, in the future, this import may be unintentionally removed.

As I don't have Windows, the result of the "flutter doctor -v" will be different.

Sample code:

import 'package:flutter/material.dart';
// Build with error without this import:
import 'package:flutter/rendering.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Center(
      child: MouseRegion(
          cursor: SystemMouseCursors.click,
          onEnter: (event) => print("onEnter"),
          onExit: (event) => print("onExit"),
          child: Container(width: 50, height: 50, color: Colors.blue)),
    ));
  }
}
b14cknc0d3 commented 3 years ago

issue link

caduandrade commented 3 years ago

issue link

@b14cknc0d3 , they closed the issue. Apparently, you just need to update the Flutter version. I'll close this issue as well, ok?

b14cknc0d3 commented 3 years ago

ok thanks.