Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commit #2

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rubitoolkit/.vscode/extension.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"dart-code.flutter",
"ms-vscode.cmake-tools"
]
}
10 changes: 10 additions & 0 deletions rubitoolkit/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"configurations": [
{
"name": "Dart",
"type": "dart",
"request": "launch",
"program": "lib/main.dart"
}
]
}
5 changes: 4 additions & 1 deletion rubitoolkit/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"cmake.sourceDirectory": "C:/Users/gabri/Desktop/projects/RubiToolkit/rubitoolkit/windows"
"cmake.sourceDirectory": "C:/Users/barnulf/Desktop/projects/rubitoolkit/rubitoolkit/windows",
"editor.formatOnSave": true,
"explorer.compactFolders": false,
"cmake.configureOnOpen": true
}
79 changes: 26 additions & 53 deletions rubitoolkit/lib/dns_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ class DnsPage extends StatefulWidget {
}

class DnsPageState extends State<DnsPage> {
final TextEditingController queryController = TextEditingController();
final _dnsController = TextEditingController();
final _queryController = TextEditingController();
List<String> lookupResults = [];
List<String> domainList = [];

Future<void> performDNSLookup() async {
final dnsolve = DNSolve();
final host = _queryController.text;
final results = <String>[];

for (final domain in domainList) {
final response = await dnsolve.lookup(
domain,
dnsSec: true,
type: RecordType.any,
);
_dnsController.text = "Quering $host";
final response = await dnsolve.lookup(
host,
dnsSec: true,
type: RecordType.any,
);

if (response.answer!.records != null) {
for (final record in response.answer!.records!) {
log(record.toBind);
results.add(record.toBind);
}
if (response.answer!.records != null) {
for (final record in response.answer!.records!) {
log(record.toBind);
results.add(record.toBind);
}
}

Expand All @@ -41,15 +41,6 @@ class DnsPageState extends State<DnsPage> {
});
}

void extractDomainsFromText() {
final text = queryController.text;
final domains = text.split(',');
domainList = domains
.map((domain) => domain.trim())
.where((domain) => domain.isNotEmpty)
.toList();
}

void sortRecordsByType() {
final Map<String, List<String>> recordGroups = {};

Expand Down Expand Up @@ -90,7 +81,7 @@ class DnsPageState extends State<DnsPage> {
child: Padding(
padding: const EdgeInsets.all(16.0),
child: TextField(
controller: queryController,
controller: _queryController,
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'Enter domain/domains',
Expand All @@ -103,7 +94,6 @@ class DnsPageState extends State<DnsPage> {
flex: 1,
child: IconButton(
onPressed: () {
extractDomainsFromText();
performDNSLookup();
sortRecordsByType();
},
Expand All @@ -121,36 +111,19 @@ class DnsPageState extends State<DnsPage> {
),
if (lookupResults.isNotEmpty)
Expanded(
child: Row(
children: [
SizedBox(
width: 256,
child: ListView.builder(
itemCount: domainList.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(domainList[index]),
);
},
),
),
const VerticalDivider(),
SizedBox(
width: 768,
child: Expanded(
child: ListView.builder(
itemCount: lookupResults.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(lookupResults[index]),
);
},
),
),
),
],
child: Column(children: [
TextField(
controller: _dnsController,
),
Expanded(
child: ListView.builder(
itemCount: lookupResults.length,
itemBuilder: (context, index) {
return Text(lookupResults[index]);
},
),
),
),
])),
],
),
);
Expand Down
3 changes: 0 additions & 3 deletions rubitoolkit/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import 'dart:io' show Platform;

import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:window_size/window_size.dart';

Expand Down