Skip to content

Instantly share code, notes, and snippets.

View manthri-mohan-sai's full-sized avatar
👨‍💻
Coding

Mohan Sai Manthri manthri-mohan-sai

👨‍💻
Coding
  • 09:58 (UTC +05:30)
View GitHub Profile
@manthri-mohan-sai
manthri-mohan-sai / video_player_test.dart
Created July 18, 2023 03:22
Test Application for video player
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@manthri-mohan-sai
manthri-mohan-sai / datetime_description_extension.dart
Created June 1, 2023 02:23
A descriptive datetime extension
extension DescribeDateTime on DateTime {
void describe() {
final now = DateTime.now();
final difference = this.difference(DateTime(now.year, now.month, now.day));
String description = switch (difference) {
Duration(inDays: 0) => 'today',
Duration(inDays: -1) => 'yesterday',
Duration(inDays: 1) => 'tomorrow',
Duration(inDays: int d, isNegative: false) => "$d days from now",

Import GPG keys

gpg --import <path to your private gpg.key>

Generate GPG keys

gpg --full-generate-key 

The recommended choices are:

@manthri-mohan-sai
manthri-mohan-sai / timer.dart
Last active November 7, 2022 11:17
Pausing timer
import 'package:flutter/material.dart';
import 'dart:async';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@manthri-mohan-sai
manthri-mohan-sai / arc.dart
Last active October 5, 2022 16:02
How to draw Arc?
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@manthri-mohan-sai
manthri-mohan-sai / card.dart
Last active November 27, 2022 19:19
Subtitle overflow to elipsis
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@manthri-mohan-sai
manthri-mohan-sai / example.dart
Created October 14, 2021 10:42
PopupMenuButton -> show dialog on popupMenuItem tap
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@manthri-mohan-sai
manthri-mohan-sai / cupertino_segmented_control.dart
Created October 12, 2021 01:36
Cupertino Segmented Control implementation
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@manthri-mohan-sai
manthri-mohan-sai / stack_example
Created September 13, 2021 04:11
This gist explains how can we stack items like image and decorated container on top at bottom center.
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override