Closed newbieflutter closed 4 years ago
This is not the question related to the package. StackOverFlow will be the place you can ask this sort of question I think.
But, FYI, Putting Scaffold in MainSearchPage's build method may solve your issue.
Hi Fysoul, I dont quite get you when you said putting scallfold in the MainSearchPage ? Which mainsearch page are you referring too ?
Navigator.push(
context,
MaterialPageRoute(builder: (context) => MainSearchPage()),
);
It is in your code.
If you use PlacePicker within another widget such as MainSearchPage as you said, app bar or other outer screen UI is depending on MainSearchPage not PlacePicker.
So I think you need more understanding of how flutter works rather than how this package can do to achieve your goal.
Hi, Ok thank you.
I am now calling this google map picker from another page. From that page say I call it like this.
So now here is the codes for my picker page. It call the page all works well. The problem first was on function onPlacePicked I put this function Navigator.of(context).pop(); it didnt as it takes to am empty black page then this work so I put this function ``` Navigator.push( context, MaterialPageRoute(builder: (context) => MainSearchPage()), );
class AddressChangePage extends StatelessWidget { // Light Theme final ThemeData lightTheme = ThemeData.light().copyWith( // Background color of the FloatingCard cardColor: Colors.white, buttonTheme: ButtonThemeData( // Select here's button color buttonColor: Color.fromRGBO(0, 116, 226, 1), textTheme: ButtonTextTheme.primary, ), );
// Dark Theme final ThemeData darkTheme = ThemeData.dark().copyWith( // Background color of the FloatingCard cardColor: Colors.white, buttonTheme: ButtonThemeData( // Select here's button color buttonColor: Colors.blue, textTheme: ButtonTextTheme.primary, ), );
// This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Google Map Place Picker Demo', theme: lightTheme, darkTheme: lightTheme, themeMode: ThemeMode.light, home: AddressChangeDetails(), debugShowCheckedModeBanner: false, ); } }
class AddressChangeDetails extends StatefulWidget {
final Color cardBackgroundColor = Color(0xFFFFFFFF); final String logo = Assets.setLocation;
AddressChangeDetails({Key key}) : super(key: key);
static final kInitialPosition = LatLng(5.285153, 100.456238);
@override _AddressChangeDetailsState createState() => _AddressChangeDetailsState(); }
class _AddressChangeDetailsState extends State {
PickResult selectedPlace;
double _height, _width, _fixedPadding;
String code = "";
@override Widget build(BuildContext context) {
} }