This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Container( | |
alignment: Alignment(0, 0), | |
padding: EdgeInsets.all(4), | |
transform: Matrix4.rotationZ(pi / 4), | |
child: Text('Hello Flutter community'), | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Center( | |
child: Padding( | |
padding: EdgeInsets.all(4), | |
child: Transform.rotate( | |
angle: pi / 4, | |
child: Text('Hello Flutter community'), | |
), | |
), | |
) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Container( | |
alignment: Alignment(0, 0), | |
child: Text('Hello Flutter community'), | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Center( | |
child: Text('Hello Flutter community'), | |
) | |
// equivalent to: | |
Container( | |
alignment: Alignment(0, 0), | |
child: Text('Hello Flutter community'), | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ajax } from 'rxjs/ajax'; | |
// action$ c'est le stream de TOUTES les actions Redux de l'application, c'est un observable qui émet chaque fois qu'une action Redux est dispatchée | |
const fetchUserEpic = action$ => action$.pipe( | |
// ofType: On filtre le stream pour ne déclencher un traitement que sur l'action qui nous intéresse. | |
ofType(FETCH_USER), | |
// quand l'observable filtré émet, ca veut dire qu'une action FETCH_USER a été dispatché. Le mergeMap (ou switchMap) créé un "sous-observable" qui va être dédié au traitement de cette action en particulier | |
mergeMap(action => { | |
// Voilà le sous-observable qu'on va retourner: On veut un observable qui émet quand l'appel réussi ou échoue | |
const apiCall$ = ajax.getJSON(`/api/users/${action.payload}`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "Run custom test frameworks" | |
cd .. | |
# Create the directory expected by buddybuild | |
mkdir -p buddybuild_artifacts/Jest | |
mkdir -p buddybuild_artifacts/ESLint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Global metadata | |
output.numFailedTestSuites = errors ? 1 : 0; | |
output.numFailedTests = errors; | |
output.numPassedTestSuites = errors ? 0 : 1; | |
output.numPassedTests = eslintReport.length - errors; | |
output.numTotalTestSuites = 1; | |
output.numTotalTests = eslintReport.length; | |
output.success = !errors; | |
// Test suite metadata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let errors = 0; | |
eslintReport.forEach(entry => { | |
errors += entry.errorCount ? 1 : 0; // Count only 1 error in case of multiple errors in the same file | |
output.testResults[0].assertionResults.push({ | |
status: entry.errorCount ? 'failed' : 'passed', | |
title: entry.filePath, | |
failureMessages: entry.messages.map( | |
// Transform the object-based ESLint message into a Jest-style string: | |
({ ruleId, message, line, column }) => `Error ${ruleId} at ${line}:${column}: ${message}`, | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const output = { | |
testResults: [ | |
{ | |
assertionResults: [], | |
}, | |
], | |
}; |
NewerOlder