hungps/flutter_pokedex

Flutter web doesn't build

wolkenschieber opened this issue · 4 comments

Flutter web doesn't build. When running flutter build web following error is emitted:

Target dart2js failed: Exception: lib/ui/screens/home/sections/header_card_content.dart:51:13:
Error: 'SearchBar' is imported from both 'package:flutter/src/material/search_anchor.dart' and 'package:pokedex/ui/widgets/search_bar.dart'.
            SearchBar(),
            ^^^^^^^^^
lib/ui/modals/search_modal.dart:15:18:
Error: 'SearchBar' is imported from both 'package:flutter/src/material/search_anchor.dart' and 'package:pokedex/ui/widgets/search_bar.dart'.
          child: SearchBar(margin: EdgeInsets.zero),
                 ^^^^^^^^^
Error: Compilation failed.

The PR #75 seems to fix the problem, could you please confirm?

@hungps Probably, I was aiming for a less intrusive solution: wolkenschieber@5c666a4

Edit: PR #75 fixes the build issue.

I think renaming the widget to avoid Flutter's SearchBar is a good approach, that way we can import the widget anywhere without manually hiding the Flutter one

Flutter web doesn't build. When running flutter build web following error is emitted:

Target dart2js failed: Exception: lib/ui/screens/home/sections/header_card_content.dart:51:13:
Error: 'SearchBar' is imported from both 'package:flutter/src/material/search_anchor.dart' and 'package:pokedex/ui/widgets/search_bar.dart'.
            SearchBar(),
            ^^^^^^^^^
lib/ui/modals/search_modal.dart:15:18:
Error: 'SearchBar' is imported from both 'package:flutter/src/material/search_anchor.dart' and 'package:pokedex/ui/widgets/search_bar.dart'.
          child: SearchBar(margin: EdgeInsets.zero),
                 ^^^^^^^^^
Error: Compilation failed.

analysis_options.yaml