Skip to content

Instantly share code, notes, and snippets.

View ThiagoFontes's full-sized avatar
📱
Programing

Thiago Fontes ThiagoFontes

📱
Programing
View GitHub Profile
# Privacy Policy
We takes your privacy seriously. To better protect your privacy we provide this privacy policy notice explaining the way your personal information is collected and used.
## Collection of Routine Information
This app track basic information about their users. This information includes, but is not limited to, IP addresses, app details, timestamps, game stats and referring pages. None of this information can personally identify specific user to this app. The information is tracked for routine administration and maintenance purposes.
@ThiagoFontes
ThiagoFontes / dart_operators.dart
Created November 9, 2023 05:30
Dart Operators
void main() {
arithmetricOperators();
equalityOperators();
typeTestOperators();
assigmentOperators();
logicalOperators();
bitwiseAndShiftOperators();
conditionalExpressions();
cascateNotation();
otherOperators();
@ThiagoFontes
ThiagoFontes / my_generic_type.dart
Last active July 30, 2022 06:24
Demonstration the use of generics in Dart
class MyGenericType<T> {
const MyGenericType(this.data);
final T data;
}
void main() {
final type = MyGenericType('Exemplo');
print(type);
}
# This is a basic workflow to help you get started with Actions
name: Run tests
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
import 'dart:ui';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_test/src/widget_tester.dart';
import 'package:golden_tests/main.dart';
void main() {
testWidgets('Testing with 360x640', (WidgetTester tester) async {
await tester.setScreenSize(width: 360, height: 640); //Samsung Galaxy S7
await tester.pumpWidget(MyApp());
await expectLater(
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
import 'package:flutter/material.dart';
import 'package:flutter_test/src/widget_tester.dart';
extension SetScreenSize on WidgetTester {
Future<void> setScreenSize(
{double width = 540,
double height = 960,
double pixelDensity = 1}) async {
final size = Size(width, height);
await this.binding.setSurfaceSize(size);
// Função do test
testWidgets('Descrição do golden teste', (WidgetTester tester) async {
//Renderiza Widget
await tester.pumpWidget(MyWidget());
//Define golden test
await expectLater(find.byType(MyWidget), matchesGoldenFile('my_widget.png'));
}
void main() {
testWidgets('MyWidget has a title and message', (WidgetTester tester) async {
await tester.pumpWidget(MyWidget(title: 'T', message: 'M'));
final titleFinder = find.text('T');
final messageFinder = find.text('M');
// Use the `findsOneWidget` matcher provided by flutter_test to verify
// that the Text widgets appear exactly once in the widget tree.
expect(titleFinder, findsOneWidget);
expect(messageFinder, findsOneWidget);
});