Skip to content

Instantly share code, notes, and snippets.

View enzoftware's full-sized avatar
🥷
Probably sleeping

Enzo Lizama Paredes enzoftware

🥷
Probably sleeping
View GitHub Profile
View transaction_modal.dart
// 1
return MergeSemantics(
child: ListTileTheme.merge(
selectedColor: activeColor ?? Theme.of(context).accentColor,
// 2
child: ListTile(
leading: leading,
// 3
title: title,
subtitle: subtitle,
View transaction_item.dart
return Semantics(
label: 'Transaction $type of $amount on $date',
// 1
child: ExcludeSemantics(
// 2
child: ListTile(
leading: TransactionIndicator(transactionType: transaction.type),
title: Text(transaction.description),
subtitle: Text(transaction.date),
trailing: Text(transaction.amount.toString()),
View transaction_screen.dart
const ExcludeSemantics(
child: Text(
'This month',
style: TextStyle(fontSize: 16, color: Colors.grey),
),
),
View transaction_item.dart
Widget build(BuildContext context) {
// 1
final type = transaction.type.value();
final amount = transaction.amount;
final date = transaction.date;
// 2
return Semantics(
// 3
label: 'Transaction $type of $amount on $date',
View transaction_screen.dart
Text(
amount.toString(),
semanticsLabel: 'The balance for this month is ${amount} dollars',
style: const TextStyle(fontSize: 48),
),
View semantic_test.dart
//1
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:flutter_transaction_tracker/main.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
// 2
testWidgets('bySemanticsLabel test', (WidgetTester tester) async {
// 3
View gist:6638ffc30443c2a9e9cf222e0757c3ef
// Android
startActivity(
FlutterActivity
.withCachedEngine("my_engine_id")
.build(this))
val mc = BasicMessageChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL, StringCodec.INSTANCE)
mc.send(Gson().toJson(quote))
@enzoftware
enzoftware / QuickSort.kt
Created October 6, 2018 20:37
PR of quicksort implementation for al-go-rithms
View QuickSort.kt
fun divideArr(array : ArrayList<Int>,low : Int, top : Int) : Int{
val pivot = array[top]
var i = (low - 1)
for (j in low .. top){
if(array[j] <= pivot){
i++
val t = array[i]
array[i] = array[j]
array[j] = t
@enzoftware
enzoftware / request.txt
Created September 7, 2018 05:09
Github GraphQL API Request to get my pinned repositories
View request.txt
{
repositoryOwner(login: "enzoftware") {
... on User {
pinnedRepositories(first: 6) {
edges {
node {
name
description
primaryLanguage {
name
@enzoftware
enzoftware / RaffleSqliteDBHelper.kt
Created August 18, 2018 16:58
SQLite helper secret example xddddd
View RaffleSqliteDBHelper.kt
package com.dupla.dupla.db
import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import android.util.Log
/**
* Created by enzoftware on 4/20/18.