Sorry everyone.
I am literally stuck at this point and badly need your starter kick. Sorry again and thanks for responses you have made so far.
I want to show dialog box to force update users when I publish a new version in App Store.
I am using New Version Flutter Plugin.
I want to install the code at my Spash Screen.
But I get this error:
Error: No named parameter with the name 'context'.
newVersion.showAlertIfNecessary(context: context);
So, here is my code for splash screen. Could you kindly help.
class SplashScreen extends StatefulWidget {
@override
_SplashScreenState createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
@override
void initState() {
super.initState();
// Implementation is here
final newVersion = NewVersion(
iOSId: 'com.google.Vespa',
androidId: 'com.google.android.apps.cloudconsole',
);
newVersion.showAlertIfNecessary(context: context);
}
void navigateNext(AuthState state) {
final routeName =
state.auth.isLoggedIn ? Routes.homeScreen : Routes.authScreen;
Timer(
Duration(seconds: 2),
() => ExtendedNavigator.root.replace(routeName),
);
}
@override
Widget build(BuildContext context) {
return BaseContent<AuthState>(
onStateReady: (state) => navigateNext(state),
create: (context, state, child) {
return Scaffold(
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/splash.jpg'),
fit: BoxFit.cover,
),
),
),
);
},
);
}
}