mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-14 05:52:51 +00:00
Improved select interface modal bottom sheet
This commit is contained in:
parent
252c299dbc
commit
474ddd1f41
1 changed files with 112 additions and 106 deletions
|
@ -27,116 +27,122 @@ class SelectInterfaceModal extends StatelessWidget {
|
|||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 28),
|
||||
child: Icon(
|
||||
Icons.settings_ethernet_rounded,
|
||||
size: 26,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.selectInterface,
|
||||
style: const TextStyle(
|
||||
fontSize: 24
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
child: ListView(
|
||||
controller: scrollController,
|
||||
shrinkWrap: true,
|
||||
itemCount: interfaces.length,
|
||||
itemBuilder: (context, index) => Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
onSelect(interfaces[index]);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
interfaces[index].name,
|
||||
style: const TextStyle(
|
||||
fontSize: 18
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${AppLocalizations.of(context)!.hardwareAddress}: ",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].hardwareAddress),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
if (interfaces[index].flags.isNotEmpty) ...[
|
||||
Row(
|
||||
children: [
|
||||
const Text(
|
||||
"Flags: ",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].flags.join(', ')),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
],
|
||||
if (interfaces[index].gatewayIp != '') ...[
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${AppLocalizations.of(context)!.gatewayIp}: ",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].gatewayIp),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
],
|
||||
if (interfaces[index].ipv4Addresses.isNotEmpty) ...[
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${AppLocalizations.of(context)!.ipv4addresses}: ",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].ipv4Addresses.join(', ')),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
],
|
||||
if (interfaces[index].ipv6Addresses.isNotEmpty) ...[
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${AppLocalizations.of(context)!.ipv4addresses}: ",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].ipv6Addresses.join(', ')),
|
||||
],
|
||||
),
|
||||
]
|
||||
],
|
||||
),
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 28),
|
||||
child: Icon(
|
||||
Icons.settings_ethernet_rounded,
|
||||
size: 26,
|
||||
),
|
||||
),
|
||||
)
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.selectInterface,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 24
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ListView.builder(
|
||||
primary: false,
|
||||
shrinkWrap: true,
|
||||
itemCount: interfaces.length,
|
||||
itemBuilder: (context, index) => Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
onSelect(interfaces[index]);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
interfaces[index].name,
|
||||
style: const TextStyle(
|
||||
fontSize: 18
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${AppLocalizations.of(context)!.hardwareAddress}: ",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].hardwareAddress),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
if (interfaces[index].flags.isNotEmpty) ...[
|
||||
Row(
|
||||
children: [
|
||||
const Text(
|
||||
"Flags: ",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].flags.join(', ')),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
],
|
||||
if (interfaces[index].gatewayIp != '') ...[
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${AppLocalizations.of(context)!.gatewayIp}: ",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].gatewayIp),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
],
|
||||
if (interfaces[index].ipv4Addresses.isNotEmpty) ...[
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${AppLocalizations.of(context)!.ipv4addresses}: ",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].ipv4Addresses.join(', ')),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
],
|
||||
if (interfaces[index].ipv6Addresses.isNotEmpty) ...[
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${AppLocalizations.of(context)!.ipv4addresses}: ",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
Text(interfaces[index].ipv6Addresses.join(', ')),
|
||||
],
|
||||
),
|
||||
]
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue