Implementation
void showAndroidSystemDialog({required String reportType}) async {
final _appInfo = await _appService.getAppInfo();
final _deviceInfo = await _identifierService.getAndroidDeviceInformation();
showDialog(
context: context,
builder: (BuildContext context) => AlertDialog(
title: Text(
'System Information',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
fontWeight: FontWeight.bold,
),
),
content: SizedBox(
height: MediaQuery.of(this.context).size.height,
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
title: Text(
'Report Type',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
reportType,
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Package name',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
_appInfo.packageName,
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Package Version',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
_appInfo.appBuildNumber,
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Package Version Name',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
_appInfo.appVersion,
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Process Name',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
_appInfo.packageName,
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Time',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${DateTime.now().day}-${DateTime.now().month}-${DateTime.now().year}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
const Divider(
thickness: 2,
),
Text(
'System',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
ListTile(
title: Text(
'Device',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo!.device}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Build Fingerprint',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo.fingerprint}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Model',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo.model}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Product',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo.product}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'SDK Version',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo.version.sdkInt}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Release',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo.version.release}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Incremental Version',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo.version.incremental}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Codename',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo.version.codename}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Board',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo.board}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
ListTile(
title: Text(
'Brand',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
subtitle: Text(
'${_deviceInfo.brand}',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
),
),
),
],
),
),
),
),
);
}