blackmann / locationpicker

Location picker for Flutter.
Other
167 stars 159 forks source link

The getter 'body1' isn't defined for the class 'TextTheme'. #57

Open DavidSamir opened 3 years ago

DavidSamir commented 3 years ago

I've just installed the package in my project and now every time I try to run the project crashes

I get this error message in the terminal

`λ flutter run Using hardware rendering with device sdk gphone x86 arm. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering". Launching lib\main.dart on sdk gphone x86 arm in debug mode... ../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/rich_suggestion.dart:35:89: Error: The getter 'body1' isn't defined for the class 'TextTheme'.

FAILURE: Build failed with an exception.

BUILD FAILED in 1m 1s Running Gradle task 'assembleDebug'... 64.4s Exception: Gradle task assembleDebug failed with exit code 1`

mo-ah-dawood commented 2 years ago

you can use this for ow

  place_picker:
    git: 
      url: https://github.com/mo-ah-dawood/locationpicker.git
      ref: nullsafety
auric-co commented 2 years ago

Getting the same error. When is the update coming to fix this

Sreejith93 commented 2 years ago

Getting the same error. When is the update coming to fix this

Same error any solution ?

xbtasvs commented 2 years ago

/C:/Users/kuk/Documents/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/search_input.dart:60:65: Error: The getter 'body1' isn't defined for the class 'TextTheme'.

I am getting this error. Please let me know the solution.

lucasjinreal commented 2 years ago

@mo-ah-dawood Your solution build error:

Error: Couldn't resolve the package 'flutter_localizations' in 'package:flutter_localizations/flutter_localizations.dart'.
../../../../development/flutter/.pub-cache/git/locationpicker-29613afd29d6b854451e7feba81e4d6dcc98762b/lib/l10n/gen_l10n/place_picker_localizations.dart:6:8: Error: Not found: 'package:flutter_localizations/flutter_localizations.dart'
import 'package:flutter_localizations/flutter_localizations.dart';
       ^
../../../../development/flutter/.pub-cache/git/locationpicker-29613afd29d6b854451e7feba81e4d6dcc98762b/lib/l10n/gen_l10n/place_picker_localizations.dart:86:5: Error: Undefined name 'GlobalMaterialLocalizations'.
    GlobalMaterialLocalizations.delegate,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../development/flutter/.pub-cache/git/locationpicker-29613afd29d6b854451e7feba81e4d6dcc98762b/lib/l10n/gen_l10n/place_picker_localizations.dart:87:5: Error: Undefined name 'GlobalCupertinoLocalizations'.
    GlobalCupertinoLocalizations.delegate,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../development/flutter/.pub-cache/git/locationpicker-29613afd29d6b854451e7feba81e4d6dcc98762b/lib/l10n/gen_l10n/place_picker_localizations.dart:88:5: Error: Undefined name 'GlobalWidgetsLocalizations'.
    GlobalWidgetsLocalizations.delegate,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
mo-ah-dawood commented 2 years ago

@jinfagang try again after upgrading packages you can also use PlacePickerLocalization.delegate

 return MaterialApp(
   localizationsDelegates: [
     /// ...other delegates,
     PlacePickerLocalization.delegate
   ],
   home: MyApplicationHome(),
 );