hungps / flutter_pokedex

Pokedex app built with Flutter (with lots of animations) using Clean Architecture
https://hungps.com
Other
2.31k stars 562 forks source link

Flutter web doesn't build #76

Closed wolkenschieber closed 10 months ago

wolkenschieber commented 10 months ago

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.
hungps commented 10 months ago

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

wolkenschieber commented 10 months ago

@hungps Probably, I was aiming for a less intrusive solution: https://github.com/wolkenschieber/flutter_pokedex/commit/5c666a4377ad03fabddb5d914523a34082c187f1

Edit: PR #75 fixes the build issue.

hungps commented 10 months ago

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

datpaitoon17 commented 6 months ago

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