Skip to content

Instantly share code, notes, and snippets.

View maheshmnj's full-sized avatar
💭
Bring it on 🔥

Mahesh Jamdade maheshmnj

💭
Bring it on 🔥
View GitHub Profile
@maheshmnj
maheshmnj / main.dart
Last active February 16, 2020 17:08
change color of a box in list of boxes on tap flutter
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u want to Lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
@maheshmnj
maheshmnj / localization.md
Last active June 28, 2020 09:58
Steps to Adding locales to a Flutter Application
  1. Add to pubspec.yaml
  • flutter_localization: sdk:flutter
  • intl_translation: ^0.17.10
  • flutter_cupertino_localizations: ^1.0.1
  1. create a lib/locales folder with a lib/locales/locale.dart file and add DemoLocalizationDelegate class and AppLocalizationDelgate class from here

Note: make sure you have imported these libraries in locale.dart

@maheshmnj
maheshmnj / dropdownformcolor.dart
Last active May 31, 2023 11:53
workaround show hint and selectedItemBuilder together
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@maheshmnj
maheshmnj / .gitignore
Created October 13, 2020 07:19
flutter gitignore
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
@maheshmnj
maheshmnj / copyObject.dart
Last active October 15, 2020 13:00
copying dart objects doesnt actually copy the contents of the object but gets a reference to it.
void main() {
Foo t = Foo();
t.a = ['a', 'b', 'c']; // some value
t.x = 30;
Foo t1 = t;
t1.a = ['x', 'y', 'z'];
t1.x = 20;
print(t1.a); // [x, y, z]
print(t.a); // [x, y, z]
print(t.x);
@maheshmnj
maheshmnj / git.md
Last active November 5, 2023 02:57
git cheat Sheet
  1. Clone a project from remote to your system git clone https://github.example.com/project/example.git

  2. To know the status of your project

    • to know the uncommited changes
    • your current branch name etc run git status
  3. create a branch git branch <newBranchName>

@maheshmnj
maheshmnj / dynamic_bottomSheet_height.dart
Last active January 24, 2022 06:40
Example showing dynamic height of rounded bottomSheet,This sheet gets scrollable when it exceeds the Max available height originally posted: https://stackoverflow.com/a/64504274/8253662
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@maheshmnj
maheshmnj / temp.txt
Last active November 27, 2020 12:50
[reset link](https://www.stage3.co/change-password/e8d97829-6bd9-4c72-a000-78b99e0c9b0e)
7. [reset your branch to an old commit](https://stackoverflow.com/a/4940084/8253662)