Skip to content

Instantly share code, notes, and snippets.

View codebythura's full-sized avatar
🎯
Focusing

Thura Aung codebythura

🎯
Focusing
View GitHub Profile
@JyotimoyKashyap
JyotimoyKashyap / ProgressButton.kt
Created June 27, 2025 05:52
Progress Button Implementation in Jetpack Compose
/**
* A custom progress button Composable that displays an animated fill
* from left to right, contained within the button's specified shape.
*
* This button behaves like a standard Material Design button but includes
* a visual progress indicator that animates its width from 0% to 100%
* over a given duration. The progress animation is always clipped to match
* the button's corners, ensuring a seamless visual effect.
*
* Example Usage:
@ardakazanci
ardakazanci / VerticalText.kt
Last active August 6, 2025 19:40
Vertical Text Jetpack Compose
@SuppressLint("WrongConstant")
@Composable
fun FallingVerticalText(modifier: Modifier = Modifier) {
val text = "「春は、曙。」"
val textSize = 64.sp
val infiniteTransition = rememberInfiniteTransition()
val offsets = text.mapIndexed { index, _ ->
infiniteTransition.animateFloat(
@ardakazanci
ardakazanci / Maze.kt
Created November 22, 2024 17:31
Maze Generator Jetpack Compose
enum class CellType {
Space, Wall
}
data class MazeTile(val x: Int, val y: Int, var type: CellType = CellType.Wall)
@RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM)
class Maze(private val width: Int, private val height: Int) {
val maze: Array<Array<MazeTile>> = Array(height) { y ->
Array(width) { x -> MazeTile(x, y) }
@decodeandroid
decodeandroid / LineChartCompose.kt
Created May 23, 2024 06:41
Line Chart Jetpack Compose Canvas
@Preview(showBackground = true, showSystemUi = true)
@Composable
fun ShowLineChartPreview() {
val chartData = listOf(
Pair(1, 1.5),
Pair(2, 1.75),
Pair(3, 3.45),
Pair(4, 2.25),
Pair(5, 6.45),
Pair(6, 3.35),
@tolo
tolo / nested_navigation_shell_route.dart
Last active March 23, 2024 07:49
Example showing how to use go_router to build persistent nested navigation (i.e. separate nested navigation trees) with a BottomNavigationBar.
// This temporary implementation is now obsolete, see instead:
// https://pub.dev/documentation/go_router/latest/go_router/StatefulShellRoute-class.html
@eduardoflorence
eduardoflorence / main.dart
Created December 24, 2020 20:03
GetX - Sample GetConnect
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/home',
getPages: [
GetPage(
name: '/home',
page: () => HomePage(),
@Maadhav
Maadhav / SABT.dart
Created July 29, 2020 04:07
Hide title in Flutter SliverAppBar on scroll
class SABT extends StatefulWidget {
final Widget child;
const SABT({
Key key,
@required this.child,
}) : super(key: key);
@override
_SABTState createState() {
return new _SABTState();
}
@flutter-clutter
flutter-clutter / overlay_with_hole.dart
Created June 27, 2020 12:08
Flutter overlay with a hole
import 'package:flutter/material.dart';
class OverlayWithHole extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Flutterclutter: Holes")),
body: _getExperimentOne()
);
}
@Andrious
Andrious / alarm_manager.dart
Last active March 1, 2022 05:38
A Dart library file that works with the Flutter plugin, android_alarm_manager.
///
/// Copyright (C) 2020 Andrious Solutions
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
@mkiisoft
mkiisoft / Fancy Button - Flutter
Created June 22, 2019 03:44
Fancy Button made for Flutter Games and Apps
import 'package:flutter/material.dart';
class FancyButton extends StatefulWidget {
const FancyButton({
Key key,
@required this.child,
@required this.size,
@required this.color,
this.duration = const Duration(milliseconds: 160),
this.onPressed,