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
class StackedVideoView extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return ViewModelBuilder<StackedVideoViewModel>.reactive( | |
viewModelBuilder: () => StackedVideoViewModel(), | |
onModelReady: (model) { | |
model.initialize('https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4'); | |
}, | |
builder: (context, model, child) { | |
return Container( |
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
class StackedVideoViewModel extends BaseViewModel { | |
VideoPlayerController videoPlayerController; | |
void initialize(String videoUrl) { | |
videoPlayerController = VideoPlayerController.network(videoUrl); | |
videoPlayerController.initialize().then((value) { | |
notifyListeners(); | |
}); | |
} |
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
RichText( | |
text: TextSpan(children: [ | |
TextSpan(text: "Forgot "), | |
TextSpan( | |
text: "Password?", | |
style: TextStyle( | |
decoration: TextDecoration.underline, | |
decorationThickness: 2, | |
decorationStyle: TextDecorationStyle.wavy)) | |
], style: TextStyle(color: Colors.black))) |
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
Text( | |
"Forgot Password?", | |
style: TextStyle( | |
shadows: [ | |
Shadow( | |
color: Colors.red, | |
offset: Offset(0, -5)) | |
], | |
color: Colors.transparent, | |
decoration: |
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
Container( | |
padding: EdgeInsets.only( | |
bottom: 5, // Space between underline and text | |
), | |
decoration: BoxDecoration( | |
border: Border(bottom: BorderSide( | |
color: Colors.amber, | |
width: 1.0, // Underline thickness | |
)) | |
), |
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
Text( | |
"Forgot Password?", | |
style: TextStyle( | |
decoration: TextDecoration.underline, | |
decorationColor: Colors.blue, | |
decorationThickness: 4, | |
decorationStyle: TextDecorationStyle.dashed, | |
), | |
) |
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
Text( | |
"Forgot Password?", | |
style: TextStyle( | |
decoration: TextDecoration.underline, | |
), | |
) |
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
Future<String> uploadNetworkImage(String _image) async { | |
// Retrieve the image form the tinyPNG URL | |
http.Response response = | |
await http.get(_image, headers: {"Content-Type": 'application/json'}); | |
print(response.body); | |
// Convert to form that can be saved to Cloud Storage | |
Uint8List networkBytes = response.bodyBytes; | |
StorageReference storageReference = FirebaseStorage.instance | |
.ref() |
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
class TinyResponse { | |
String url; | |
void printURL() { | |
print(url); | |
} | |
TinyResponse.fromJson(Map<String, dynamic> json) | |
: url = json['output']['url']; | |
} |
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
Future<String> tinyFile(File file) async { | |
var url = 'https://api.tinify.com/shrink'; | |
TinyResponse tinyResponse; | |
try { | |
var response = await http.post( | |
url, | |
body: file.readAsBytesSync(), | |
headers: { | |
'Authorization': | |
"Basic {YOUR base64 API KEY}" |