Skip to content

Instantly share code, notes, and snippets.

@AyushBherwani1998
Created June 30, 2020 11:16
Show Gist options
  • Select an option

  • Save AyushBherwani1998/56e98693717029939535c7892a07fd5d to your computer and use it in GitHub Desktop.

Select an option

Save AyushBherwani1998/56e98693717029939535c7892a07fd5d to your computer and use it in GitHub Desktop.
ISSUE: #50400
// If you run this code, you won't encounter the issue. It has a drawer and a Scaffold as mentioned. Hovering over the
// back button, places the tooltip at the expected position. However, the person has given reproducible code due to which I was
// able to reproduce the error. And the error is not because of Drawer, it because of the Navigator being inside the Row. If you remove
// the drawer and have a container, the tooltip move it's place. One more finding, it will move it's place to the right which is
// equivalent to the width of other widget in the Row. The person code is given in the issue which you can try out. Also, the issue is
// producible on the Android too.
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
routes: {
'/': (context) => MyApp(),
'/nextPage': (context) => NextPage(),
},
));
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(
children: [
Drawer(),
Expanded(
child: Scaffold(
appBar: AppBar(
title: Text('MyApp'),
),
body: Center(
child: RaisedButton(
onPressed: () => Navigator.pushNamed(context, '/nextPage'),
child: Text('Tap Me!'),
),
),
),
)
],
);
}
}
class NextPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(
children: [
Drawer(),
Expanded(
child: Scaffold(
appBar: AppBar(
title: Text('Next Page Title'),
),
body: Center(
child: Text("Next Page"),
),
),
)
],
);
}
}
@TahaTesser
Copy link

TahaTesser commented Jun 30, 2020

If you run this code, you won't encounter the issue. It has a drawer and a Scaffold as mentioned. Hovering over the
back button, places the tooltip at the expected position. However, the person has given reproducible code due to which I was
able to reproduce the error. And the error is not because of Drawer, it because of the Navigator being inside the Row. If you remove the drawer and have a container, the tooltip move it's place. One more finding, it will move it's place to the right which is equivalent to the width of other widget in the Row. The person's code is given in the issue which you can try out. Also, the issue is
producible on the Android too.

@TahaTesser
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment