mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-18 07:22:12 +03:00
32 lines
842 B
Dart
Executable File
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,
|
|
);
|
|
}
|
|
}
|