'Push navigation transition remove shadow
I found that Flutter App has slightly hard shadows than the Native App when pushing a new screen.
I searched on the internet and I didn't find much about this. Is there any way to remove that shadow?
Flutter doctor
Full reproducible code
File: main.dart
import 'package:flutter/cupertino.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return CupertinoApp(
initialRoute: '/',
onGenerateRoute: generateRoute,
home: Home(),
);
}
}
class Home extends StatefulWidget {
Home({Key key}) : super(key: key);
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: Center(child: CupertinoButton(child: Text('Navigate'), onPressed: () => Navigator.pushNamed(context, 'details'))),
);
}
}
class Details extends StatefulWidget {
Details({Key key}) : super(key: key);
@override
_DetailsState createState() => _DetailsState();
}
class _DetailsState extends State<Details> {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: Center(child: Text('Details')),
);
}
}
Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case '/':
return CupertinoPageRoute(builder: (context) => Home());
case 'details':
return CupertinoPageRoute(builder: (context) => Details());
default:
return CupertinoPageRoute(builder: (context) => Home());
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|



