Skip to content

Instantly share code, notes, and snippets.

View ltvu93's full-sized avatar

Vu Luong Trieu ltvu93

  • TP.HCM, Việt Nam
View GitHub Profile
@ltvu93
ltvu93 / CustomTabBar.kt
Last active April 23, 2021 10:28
Custom tab bar with animation in Jetpack Compose
package com.example.testcompose
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.MaterialTheme
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
void main() => runApp(MyApp());
const sampleText = '''
Flutter is an open-source UI software development kit created by Google.
It is used to develop applications for Android, iOS, Linux, Mac, Windows, Google Fuchsia,[4] and the web from a single codebase.[5]
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@ltvu93
ltvu93 / main.dart
Last active April 12, 2021 10:57
Tab bar with section scroll
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
import 'dart:math' as math;
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
void main() {
runApp(MyApp());
}
def tag = 'git describe --tags --always --abbrev=0'.execute().getText().trim()
def (versionMajor, versionMinor, versionPatch) = tag.tokenize('.')
def buildNumber = System.getenv("BUILD_NUMBER") as Integer ?: 1
def VERSION_NAME = "$versionMajor.$versionMinor.$versionPatch.$buildNumber"
def VERSION_CODE = versionMajor.toInteger() * 1000 + versionMinor.toInteger() * 100 + versionPatch.toInteger() * 10 + buildNumber.toInteger()
defaultConfig {
applicationId ""
minSdkVersion 19
targetSdkVersion 28
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
Future<void> loadImage() async {
final response = await http.get(widget.url);
if (response.statusCode == 200) {
imageBytes = response.bodyBytes;
imageRotate = await getRotateFromImageBytes(imageBytes);
setState(() {});
}
}
@ApplicationScope
public class FileHelper {
private Context context;
@Inject
public FileHelper(Context context) {
this.context = context;
}
@Nullable