How to implement in-app update in flutter

604 views
Skip to first unread message

Siddhartha Bhattacharyya

unread,
May 7, 2021, 11:03:39 PM5/7/21
to flutt...@googlegroups.com
Hello everyone,

Can you please suggest how to implement in-app update for a Flutter Application?

My flutter SDK Version is 1.22.0

Thank you in advance,

Siddhartha

Suzuki Tomohiro

unread,
May 7, 2021, 11:21:03 PM5/7/21
to Siddhartha Bhattacharyya, flutt...@googlegroups.com
What is in-app updates?

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/CABX8OS_8X%3Dcxkc0zZGU0TCfNkYkZgOdfZr2k5qPw4RGJTduKcA%40mail.gmail.com.

David McCreary

unread,
May 7, 2021, 11:36:46 PM5/7/21
to Suzuki Tomohiro, Siddhartha Bhattacharyya, Flutter Dev
I am working on this myself right now.  There is a nice package that helps you:

However, it's tricky to test.  I can get it to ascertain the need for an update and to start the update and to download the update, but it rolls back to the original version.  I am speculating that perhaps both the current version you have (ie. the one you want to update) as well as the one in the google play store both need the functionality, perhaps there is some handshaking in there.

Siddhartha Bhattacharyya

unread,
May 10, 2021, 5:38:52 AM5/10/21
to David McCreary, Suzuki Tomohiro, Flutter Dev
Thank you.

I am working with flutter 1.22.0. in_app_update does not run on this platform. 

I have implemented forceupdate, https://pub.dev/packages/forceupdate
It works perfectly but when I click the Update Now button, nothing happens.

But I need to implement force update in flutter version 1.22.0.

Still looking for a solution, any help will be appreciated.

Thanks and regards,
Siddhartha

--
Kind Regards,

Siddhart
ha Bhattacharyya,



A man dedicated for IT & Allied Services

Mobile: 8697652321

Siddhartha Bhattacharyya

unread,
May 11, 2021, 11:19:36 AM5/11/21
to Flutter Dev
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,
),
),
),
);
},
);
}
}

Reply all
Reply to author
Forward
0 new messages