-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #250 from syphon-org/upgrade-dart-2
[Maintenance] Upgrades for Dart 2
- Loading branch information
Showing
207 changed files
with
5,459 additions
and
5,339 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
{ | ||
"flutterSdkVersion": "2.0.6", | ||
"flavors": {} | ||
} |
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,32 @@ | ||
## Changes | ||
|
||
### 🔮 Features | ||
### 🔒 Security | ||
### 🛠 Performance | ||
### 🐛 Fixes | ||
### 📐 Refactoring | ||
|
||
### Media (if applicable) | ||
|
||
### Types of changes | ||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
|
||
### QA | ||
|
||
- [ ] Signup | ||
- [ ] Login | ||
- [ ] Logout | ||
- [ ] Unencrypted Chat | ||
- [ ] Encrypted Chat | ||
- [ ] Group Chats | ||
- [ ] Profile Changes | ||
- [ ] Themeing Changes | ||
- [ ] Force Kill and Restart | ||
|
||
### Final Checklist | ||
|
||
- [ ] All associated issues have been linked to PR | ||
- [ ] All necessary changes made to the documentation | ||
- [ ] Parties interested in these changes have been notified |
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 @@ | ||
include: package:lint/analysis_options.yaml | ||
|
||
# TODO: implicit casts should be fine, but we'll play the game later | ||
analyzer: | ||
strong-mode: | ||
implicit-casts: true | ||
|
||
linter: | ||
rules: | ||
# Disabled | ||
type_annotate_public_apis: false | ||
avoid_classes_with_only_static_members: false | ||
always_declare_return_types: false # can be explicit in declaration | ||
constant_identifier_names: false | ||
|
||
# Enabled | ||
prefer_single_quotes: true | ||
|
||
# sort_constructors_first: true | ||
# prefer_double_quotes: true | ||
# public_member_api_docs: true | ||
# always_specify_types: true | ||
# always_put_required_named_parameters_first: false | ||
|
||
# TODO: | ||
prefer_const_constructors: false | ||
lines_longer_than_80_chars: false |
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
File renamed without changes.
File renamed without changes.
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,18 +1,18 @@ | ||
# | ||
# NOTE: This podspec is NOT to be published. It is only used as a local source! | ||
# This is a generated file; do not edit or check into version control. | ||
# | ||
|
||
Pod::Spec.new do |s| | ||
s.name = 'Flutter' | ||
s.version = '1.0.0' | ||
s.summary = 'High-performance, high-fidelity mobile apps.' | ||
s.description = <<-DESC | ||
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. | ||
DESC | ||
s.homepage = 'https://flutter.io' | ||
s.license = { :type => 'MIT' } | ||
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } | ||
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } | ||
s.ios.deployment_target = '8.0' | ||
s.vendored_frameworks = 'Flutter.framework' | ||
# Framework linking is handled by Flutter tooling, not CocoaPods. | ||
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs. | ||
s.vendored_frameworks = 'path/to/nothing' | ||
end |
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
2 changes: 1 addition & 1 deletion
2
ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,78 @@ | ||
import 'dart:convert'; | ||
import 'dart:typed_data'; | ||
|
||
import 'package:encrypt/encrypt.dart'; | ||
|
||
const IV_LENGTH = 16; | ||
const IV_LENGTH_BASE_64 = (IV_LENGTH + (IV_LENGTH / 2)); | ||
|
||
/// Random bytes generator | ||
Uint8List _generateIV(int length) { | ||
return IV.fromSecureRandom(length).bytes; | ||
} | ||
|
||
/// Generate an encryption password based on a user input password | ||
Key _generateEncryptPassword(String password) { | ||
return Key.fromBase64(password); | ||
} | ||
|
||
class _EncryptEncoder extends Converter<String, String> { | ||
final AES aes; | ||
|
||
_EncryptEncoder(this.aes); | ||
|
||
@override | ||
String convert(String input) { | ||
// Generate random initial value | ||
final iv = _generateIV(IV_LENGTH); | ||
final ivEncoded = base64.encode(iv); | ||
assert(ivEncoded.length == IV_LENGTH_BASE_64.round()); | ||
|
||
// Encode the input value | ||
final encoded = Encrypter(aes).encrypt(input, iv: IV(iv)).base64; | ||
|
||
// Prepend the initial value | ||
return '$ivEncoded$encoded'; | ||
} | ||
} | ||
|
||
class _EncryptDecoder extends Converter<String, String> { | ||
final AES aes; | ||
|
||
_EncryptDecoder(this.aes); | ||
|
||
@override | ||
String convert(String input) { | ||
// Read the initial value that was prepended | ||
assert(input.length >= IV_LENGTH_BASE_64.round()); | ||
final iv = base64.decode(input.substring(0, IV_LENGTH_BASE_64.round())); | ||
|
||
// Extract the real input | ||
input = input.substring(IV_LENGTH_BASE_64.round()); | ||
|
||
// Decode the input | ||
return Encrypter(aes).decrypt64(input, iv: IV(iv)); | ||
} | ||
} | ||
|
||
/// Salsa20 based Codec | ||
class EncryptCodec extends Codec<String, String> { | ||
late _EncryptEncoder _encoder; | ||
late _EncryptDecoder _decoder; | ||
|
||
EncryptCodec(Key passwordBytes) { | ||
var aes = AES(passwordBytes, mode: AESMode.ctr, padding: null); | ||
|
||
_encoder = _EncryptEncoder(aes); | ||
_decoder = _EncryptDecoder(aes); | ||
} | ||
|
||
@override | ||
Converter<String, String> get decoder => _decoder; | ||
|
||
@override | ||
Converter<String, String> get encoder => _encoder; | ||
} | ||
|
||
EncryptCodec initCacheEncrypter({required String password}) => | ||
EncryptCodec(_generateEncryptPassword(password)); |
Oops, something went wrong.