Android version code

This commit is contained in:
Ming Ming 2022-05-04 01:27:25 +08:00
parent e63ae17014
commit c979d644e7
2 changed files with 12 additions and 1 deletions

View file

@ -25,3 +25,13 @@ class AndroidInfo {
/// Corresponding to Build.VERSION.SDK_INT
final int sdkInt;
}
abstract class AndroidVersion {
static const O = 26;
// ignore: constant_identifier_names
static const O_MR1 = 27;
static const P = 28;
static const Q = 29;
static const R = 30;
static const S = 31;
}

View file

@ -990,7 +990,8 @@ class _ThemeSettingsState extends State<_ThemeSettings> {
SliverList(
delegate: SliverChildListDelegate(
[
if (platform_k.isAndroid && AndroidInfo().sdkInt >= 29)
if (platform_k.isAndroid &&
AndroidInfo().sdkInt >= AndroidVersion.Q)
SwitchListTile(
title: Text(L10n.global().settingsFollowSystemThemeTitle),
value: _isFollowSystemTheme,