forked from luiscib3r/todo
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luis Ciber
committed
Aug 29, 2021
1 parent
947aefc
commit 140e112
Showing
25 changed files
with
1,403 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export 'exceptions/exceptions.dart'; | ||
export 'platform/platform.dart'; | ||
export 'result/result.dart'; | ||
export 'utils/utils.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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export 'http_client/http_client.dart'; | ||
export 'platform_channels.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,42 @@ | ||
import 'package:flutter/services.dart'; | ||
|
||
const platform = MethodChannel('com.cubanopensource.todo'); | ||
|
||
//! Call | ||
Future<bool?> callTo(String number) async { | ||
return platform.invokeMethod<bool>('callTo', number); | ||
} | ||
|
||
//! Show float widget | ||
Future<bool?> getShowWidgetPreference() async { | ||
return platform.invokeMethod('getShowWidgetPreference'); | ||
} | ||
|
||
Future<void> setTrueShowWidget() async { | ||
await platform.invokeMethod('setTrueShowWidget'); | ||
} | ||
|
||
Future<void> setFalseShowWidget() async { | ||
await platform.invokeMethod('setFalseShowWidget'); | ||
} | ||
|
||
//! Turn on/off wifi | ||
Future<bool?> getTurnOffWifiPreference() async { | ||
return platform.invokeMethod('getTurnOffWifiPreference'); | ||
} | ||
|
||
Future<void> setTrueTurnOffWifi() async { | ||
await platform.invokeMethod('setTrueTurnOffWifi'); | ||
} | ||
|
||
Future<void> setFalseTurnOffWifi() async { | ||
await platform.invokeMethod('setFalseTurnOffWifi'); | ||
} | ||
|
||
Future<void> turnOnWifi() async { | ||
await platform.invokeMethod('turnOnWifi'); | ||
} | ||
|
||
Future<void> turnOffWifi() async { | ||
await platform.invokeMethod('turnOffWifi'); | ||
} |
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 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'result.freezed.dart'; | ||
|
||
@freezed | ||
class Result<T> with _$Result<T> { | ||
const factory Result.success({required T data}) = _Success; | ||
const factory Result.error({required String message}) = _Error; | ||
} |
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,12 @@ | ||
import 'package:fluttercontactpicker/fluttercontactpicker.dart'; | ||
|
||
Future<String> getContactPhoneNumber() async { | ||
final contact = await FlutterContactPicker.pickPhoneContact(); | ||
|
||
return contact.phoneNumber | ||
.toString() | ||
.replaceAll('+53', '') | ||
.replaceAll(' ', '') | ||
.replaceAll(RegExp('([a-zA-Z])'), '') | ||
.replaceAll('()', ''); | ||
} |
Oops, something went wrong.