version_tracker 2.4.1 copy "version_tracker: ^2.4.1" to clipboard
version_tracker: ^2.4.1 copied to clipboard

Local version and build tracker plugin. Provides the ability to keep track of previous installations and easily migrate data between upgrades.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:version_tracker/version_tracker.dart';

late final VersionTracker versionTracker;

void main() async {
  // Without this, SharePreferences doesn't work because is called before the runApp
  // See: https://stackoverflow.com/a/57775690/2584335
  WidgetsFlutterBinding.ensureInitialized();

  versionTracker = VersionTracker();

  await versionTracker.track();

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Version Tracker',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Version Tracker'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  // ignore: library_private_types_in_public_api
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              versionTracker.toString(),
            ),
          ],
        ),
      ),
    );
  }
}
47
likes
150
pub points
79%
popularity

Publisher

unverified uploader

Local version and build tracker plugin. Provides the ability to keep track of previous installations and easily migrate data between upgrades.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, package_info_plus, shared_preferences

More

Packages that depend on version_tracker