How can I use splashFactory: NoSplash.splashFactory
on flutter default app bar back button?
CodePudding user response:
Do something like this to your AppBar
AppBar(
leading: Navigator.canPop(context)
? IconButton(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
icon: const Icon(
Icons.arrow_back,
),
onPressed: () => Navigator.of(context).pop(),
)
: null,
)
Overriding the exisitng appBar icon by using leading
property and removing the splash.