Skip to content

Instantly share code, notes, and snippets.

View ivasanth's full-sized avatar

Vasanth Jagadeesan ivasanth

  • Twilight IT Solution
  • Puducherry, India
View GitHub Profile
@ivasanth
ivasanth / terraform-aws-s3-backend.tf
Created November 10, 2019 17:06
Terraform setup S3 backend for remote state
terraform {
backend "s3" {
region = "ap-south-1"
bucket = "mobilelabs.in"
key = "mobilelabs.in/development/state.tfstate"
encrypt = true #AES-256 encryption
}
}
@ivasanth
ivasanth / terraform-aws-ec2.tf
Created November 10, 2019 16:59
Terraform setup aws EC2 instance
provider "aws" {
profile = "default"
region = "ap-south-1"
}
resource "aws_instance" "mobilelabs" {
ami = "ami-040c7ad0a93be494e"
instance_type = "t2.micro"
}
@ivasanth
ivasanth / flutter-selectable-text-tootlbar.dart
Created November 9, 2019 21:16
Flutter SelectableText with the ToolbarOptions - mobilelabs.in
SelectableText(
'You can only copy me!',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.bold),
toolbarOptions(copy: true),
)
@ivasanth
ivasanth / flutter-selectable-text-cursor.dart
Created November 9, 2019 21:05
Flutter SelectableText with the cursor - mobileabs.in
SelectableText(
'Hello! How are you?',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.bold),
showCursor: true
)
@ivasanth
ivasanth / flutter-selectable-text-rich.dart
Last active November 9, 2019 20:57
Flutter SelectableText.rich mobilelabs.in
const SelectableText.rich(
TextSpan(
text: 'Hi There - mobilelabs', // default text style
children: <TextSpan>[
TextSpan(text: ' Wonderful ', style: TextStyle(fontStyle: FontStyle.italic)),
TextSpan(text: 'Life', style: TextStyle(fontWeight: FontWeight.bold)),
],
),
)
@ivasanth
ivasanth / flutter-selectable-text.dart
Created November 9, 2019 20:53
Flutter selectable text example - mobilelabs.in
SelectableText(
'You can select me now!',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.bold),
)
@ivasanth
ivasanth / flutter-alert-dialog.dart
Last active November 9, 2019 20:25
Flutter AlertDialog widget
Future<void> logOut() async {
return showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: Text('Are you sure?'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[