I am trying to use the upgrader package as my goal is to make it so that when a user accesses their app it will check that there is a new update and ask the user to update their app, but I am not sure how integrate this package within my app, can I do it by turning it into a custom widget?
https://pub.dev/packages/upgrader/install
// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/backend/schema/structs/index.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/widgets/index.dart'; // Imports other custom widgets
import '/custom_code/actions/index.dart'; // Imports custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom widget code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'package:upgrader/upgrader.dart';
class Upgrader extends StatefulWidget {
const Upgrader({
Key? key,
this.width,
this.height,
}) : super(key: key);
final double? width;
final double? height;
@override
_UpgraderState createState() => _UpgraderState();
}
class _UpgraderState extends StatelessWidget {
const _UpgraderState({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Upgrader Example',
home: UpgradeAlert(
child: Scaffold(
appBar: AppBar(title: Text('Upgrader Example')),
body: Center(child: Text('Checking...')),
)),
);
}
}