sdk_int 0.0.1
sdk_int: ^0.0.1 copied to clipboard
This plugin lets you get the Current SDK version for android. It includes all version codes to compare with.
import 'package:flutter/material.dart';
import 'package:sdk_int/sdk_int.dart';
void main() {
runApp(const MaterialApp(home: MyApp()));
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: FutureBuilder(
future: SDKInt.currentSDKVersion,
builder: (context, AsyncSnapshot<int> snapshot) {
if (snapshot.hasData) {
return Text(
"Current SDK Version\n" + snapshot.data.toString(),
textAlign: TextAlign.center,
);
}
return const SizedBox.shrink();
},
),
),
);
}
}