-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove external libraries from server dependency (#16)
* Remove uuid and quiver dependency * Remove json_serializable and json_annotation dependencies * bump version --------- Co-authored-by: saikrishna321 <saikrishna321@yahoo.com>
- Loading branch information
1 parent
712ded3
commit 444e996
Showing
37 changed files
with
315 additions
and
598 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,27 @@ | ||
import 'dart:collection'; | ||
|
||
class LRUCache<K, V> { | ||
final int _capacity; | ||
final Map<K, V> _cache = LinkedHashMap<K, V>(); | ||
|
||
LRUCache(this._capacity); | ||
|
||
void put(K key, V value) { | ||
if (_cache.containsKey(key)) { | ||
_cache.remove(key); | ||
} else if (_cache.length >= _capacity) { | ||
var oldestKey = _cache.keys.first; | ||
_cache.remove(oldestKey); | ||
} | ||
_cache[key] = value; | ||
} | ||
|
||
V? get(K key) { | ||
if (_cache.containsKey(key)) { | ||
var value = _cache.remove(key)!; | ||
_cache[key] = value; | ||
return value; | ||
} | ||
return null; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
part 'generated/create_session.g.dart'; | ||
|
||
@JsonSerializable() | ||
class CreateSessionModel { | ||
Map<String, dynamic>? capabilities; | ||
CreateSessionModel({required this.capabilities}); | ||
|
||
factory CreateSessionModel.fromJson(Map<String, dynamic> json) => | ||
_$CreateSessionModelFromJson(json); | ||
CreateSessionModel( | ||
capabilities: json['capabilities'] as Map<String, dynamic>?, | ||
); | ||
|
||
Map<String, dynamic> toJson() => _$CreateSessionModelToJson(this); | ||
Map<String, dynamic> toJson() => <String, dynamic>{ | ||
'capabilities': capabilities, | ||
}; | ||
} |
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 |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import 'package:appium_flutter_server/src/models/api/find_element.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
import 'package:appium_flutter_server/src/models/api/element.dart'; | ||
|
||
part 'generated/drag_drop.g.dart'; | ||
|
||
@JsonSerializable() | ||
class DragAndDropModel { | ||
ElementModel source; | ||
ElementModel target; | ||
int? dragDuration; | ||
|
||
DragAndDropModel( | ||
{required this.source, | ||
required this.target, | ||
this.dragDuration}); | ||
{required this.source, required this.target, this.dragDuration}); | ||
|
||
factory DragAndDropModel.fromJson(Map<String, dynamic> json) => | ||
_$DragAndDropModelFromJson(json); | ||
DragAndDropModel( | ||
source: ElementModel.fromJson(json['source'] as Map<String, dynamic>), | ||
target: ElementModel.fromJson(json['target'] as Map<String, dynamic>), | ||
dragDuration: (json['dragDuration'] as num?)?.toInt(), | ||
); | ||
|
||
Map<String, dynamic> toJson() => _$DragAndDropModelToJson(this); | ||
Map<String, dynamic> toJson() => <String, dynamic>{ | ||
'source': source, | ||
'target': target, | ||
'dragDuration': dragDuration, | ||
}; | ||
} |
Oops, something went wrong.