-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flutter Version Upgrade. Code Fix but Testing Pending
- Loading branch information
1 parent
43b2ab3
commit 1a50a40
Showing
19 changed files
with
179 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:bloc/bloc.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'ping_event.dart'; | ||
part 'ping_state.dart'; | ||
part 'ping_bloc.freezed.dart'; | ||
|
||
class PingBloc extends Bloc<PingEvent, PingState> { | ||
PingBloc() : super(PingState.initial()) { | ||
on<StartPing>(_startPing); | ||
on<StopPing>(_stopPing); | ||
} | ||
|
||
_startPing(StartPing event, Emitter<PingState> emit) {} | ||
|
||
_stopPing(StopPing event, Emitter<PingState> emit) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
part of 'ping_bloc.dart'; | ||
|
||
@freezed | ||
class PingEvent with _$PingEvent { | ||
const factory PingEvent.startPing() = StartPing; | ||
const factory PingEvent.stopPing() = StopPing; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
part of 'ping_bloc.dart'; | ||
|
||
@freezed | ||
class PingState with _$PingState { | ||
const factory PingState.initial() = _Initial; | ||
const factory PingState.pingRunning() = _PingRunning; | ||
const factory PingState.pingStopped() = _PingStopped; | ||
const factory PingState.pingCompleted() = _PingCompleted; | ||
} |
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
lib/pages/port_scan_page/port_scan_bloc/port_scan_bloc.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:injectable/injectable.dart'; | ||
import 'package:network_tools/network_tools.dart'; | ||
|
||
part 'port_scan_bloc.freezed.dart'; | ||
part 'port_scan_event.dart'; | ||
part 'port_scan_state.dart'; | ||
|
||
@injectable | ||
class PortScanBloc extends Bloc<PortScanEvent, PortScanState> { | ||
PortScanBloc() : super(PortScanState.initial()) { | ||
on<Initialized>(_initialized); | ||
on<StartNewScan>(_startNewScan); | ||
on<StopScan>(_stopScan); | ||
} | ||
|
||
Future<void> _initialized(Initialized event, Emitter<PortScanState> emit) { | ||
emit(const PortScanState.loadInProgress()); | ||
return Future.delayed(Duration(microseconds: 1)); | ||
} | ||
|
||
Future<void> _startNewScan(StartNewScan event, Emitter<PortScanState> emit) { | ||
return Future.delayed(Duration(microseconds: 1)); | ||
} | ||
|
||
Future<void> _stopScan(StopScan event, Emitter<PortScanState> emit) { | ||
return Future.delayed(Duration(microseconds: 1)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
part of 'port_scan_bloc.dart'; | ||
|
||
@freezed | ||
class PortScanEvent with _$PortScanEvent { | ||
const factory PortScanEvent.initialized() = Initialized; | ||
const factory PortScanEvent.startNewScan() = StartNewScan; | ||
const factory PortScanEvent.stopScan() = StopScan; | ||
} |
12 changes: 12 additions & 0 deletions
12
lib/pages/port_scan_page/port_scan_bloc/port_scan_state.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
part of 'port_scan_bloc.dart'; | ||
|
||
@freezed | ||
class PortScanState with _$PortScanState { | ||
factory PortScanState.initial() = _Initial; | ||
const factory PortScanState.loadInProgress() = _LoadInProgress; | ||
const factory PortScanState.foundOpenPort(List<OpenPort> openPortList) = | ||
FoundOpenPort; | ||
const factory PortScanState.loadFailure() = _LoadFailure; | ||
const factory PortScanState.noPortFound() = _NoPortFound; | ||
const factory PortScanState.error() = Error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class PortScanPage extends StatefulWidget { | ||
final String target; | ||
const PortScanPage({Key? key, this.target = ''}) : super(key: key); | ||
|
||
@override | ||
State<PortScanPage> createState() => _PortScanPageState(); | ||
} | ||
|
||
class _PortScanPageState extends State<PortScanPage> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('Open Port Scanner'), | ||
), | ||
body: Center( | ||
child: Text('Hi'), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.