Skip to content

Instantly share code, notes, and snippets.

View enzoftware's full-sized avatar
:shipit:
Probably sleeping

Enzo Lizama Paredes enzoftware

:shipit:
Probably sleeping
View GitHub Profile
// 1
return MergeSemantics(
child: ListTileTheme.merge(
selectedColor: activeColor ?? Theme.of(context).accentColor,
// 2
child: ListTile(
leading: leading,
// 3
title: title,
subtitle: subtitle,
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()),
const ExcludeSemantics(
child: Text(
'This month',
style: TextStyle(fontSize: 16, color: Colors.grey),
),
),
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',
Text(
amount.toString(),
semanticsLabel: 'The balance for this month is ${amount} dollars',
style: const TextStyle(fontSize: 48),
),
//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
// 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
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
{
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
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.