yubioath-flutter/lib/app/views/device_avatar.dart
2022-01-18 12:26:31 +01:00

32 lines
842 B
Dart
Executable File

import 'package:flutter/material.dart';
import 'package:yubico_authenticator/management/models.dart';
import '../models.dart';
import 'device_images.dart';
class DeviceAvatar extends StatelessWidget {
final DeviceNode node;
final String name;
final DeviceInfo? info;
final bool selected;
const DeviceAvatar(this.node, this.name, this.info,
{this.selected = false, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return CircleAvatar(
child: CircleAvatar(
child:
info != null ? getProductImage(info!, name) : const Icon(Icons.nfc),
backgroundColor: Theme.of(context).colorScheme.background,
),
radius: 22,
backgroundColor: selected
? Theme.of(context).colorScheme.secondary
: Colors.transparent,
);
}
}