mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-30 09:47:43 +03:00
31 lines
683 B
Dart
Executable File
31 lines
683 B
Dart
Executable File
import 'package:flutter/material.dart';
|
|
|
|
import '../../app/models.dart';
|
|
import '../models.dart';
|
|
import 'account_view.dart';
|
|
|
|
class AccountList extends StatelessWidget {
|
|
final DeviceNode device;
|
|
final List<OathPair> credentials;
|
|
const AccountList(this.device, this.credentials, {Key? key})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (credentials.isEmpty) {
|
|
return const Center(
|
|
child: Text('No credentials'),
|
|
);
|
|
}
|
|
|
|
return ListView(
|
|
shrinkWrap: true,
|
|
children: [
|
|
...credentials.map(
|
|
(entry) => AccountView(device, entry.credential, entry.code),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|