Skip to content

Instantly share code, notes, and snippets.

View kumar-aakash86's full-sized avatar

Aakash Kumar kumar-aakash86

View GitHub Profile
@kumar-aakash86
kumar-aakash86 / main.dart
Last active October 8, 2024 15:42
Animated Play/Pause Button
// Copyright 2019 the Dart project authors. 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(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@kumar-aakash86
kumar-aakash86 / main.dart
Last active August 27, 2024 14:50
Smiley code to unicode converter
//Full imoji list - https://unicode.org/emoji/charts/full-emoji-list.html
String encodeToUtf16(String unicodeString) {
int rune = unicodeString.runes.first;
if (rune >= 0x10000) {
int high = (rune - 0x10000) ~/ 0x400 + 0xD800;
int low = (rune - 0x10000) % 0x400 + 0xDC00;
return String.fromCharCode(high) + String.fromCharCode(low);
} else {
return unicodeString;
@kumar-aakash86
kumar-aakash86 / main.dart
Created February 20, 2024 10:32
Animated canvas arrows - flutter
import 'package:flutter/material.dart';
// Animated canvas arrows
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@kumar-aakash86
kumar-aakash86 / main.dart
Created January 13, 2023 12:36
Flutter - Stack with listview
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@kumar-aakash86
kumar-aakash86 / main.dart
Last active January 11, 2023 13:52
Flutter - Search using provider
// This code is distributed under the MIT License.
// Copyright (c) 2019 Remi Rousselet.
// You can find the original at https://github.com/rrousselGit/provider.
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:http/http.dart' as http;
import 'dart:convert' as convert;
@kumar-aakash86
kumar-aakash86 / main.dart
Created January 6, 2023 07:46
Flutter - Bottom Navigation Bar
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@kumar-aakash86
kumar-aakash86 / main.dart
Created January 5, 2023 07:30
Flutter - Theme Toggle from Drawer
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(App());
}
class App extends StatelessWidget {
@kumar-aakash86
kumar-aakash86 / main.dart
Last active January 4, 2023 14:36
Flutter - StreamBuilder with setState
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 {
@kumar-aakash86
kumar-aakash86 / main.dart
Created January 28, 2022 15:22
Flutter Animated Dialog
// 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';
import 'dart:async';
import 'package:flutter/gestures.dart';
void main() {
runApp(MyApp());
@kumar-aakash86
kumar-aakash86 / main.dart
Last active September 30, 2021 15:12
Updating child array as per parent
var json = {
"Accessories": [
{
"id": 1,
"brand": "samsung",
"parentId": null,
"children": [
{"id": 4, "name": "Ace", "parentId": 1},
{"id": 5, "name": "note", "parentId": 1},
{"id": 6, "name": "galaxy", "parentId": 1}