Skip to content

Instantly share code, notes, and snippets.

View agnamc9's full-sized avatar

Agnaramon Boris-Carnot agnamc9

View GitHub Profile
List<Purchase> purchases = [
Purchase(amount: 500),
Purchase(amount: 1500),
Purchase(amount: 1000),
];
var material = Materials(purchase: purchases);
var count = material.purchase
.map((e) => e.amount)
.toList()
.fold(0, (previousValue, element) => previousValue + element);
//Here debug console output
Expected: <Instance of 'DataResponse<Utilisateur>'>
Actual: <null>
package:test_api expect
package:flutter_test/src/widget_tester.dart 369:3 expect
test/repositories/login/login_api_client_test.dart 30:7 main.<fn>.<fn>
// login_api_client_test.dart
import 'package:flutter/material.dart';
class AnimatedContainerTest extends StatefulWidget {
@override
_AnimatedContainerTestState createState() => _AnimatedContainerTestState();
}
class _AnimatedContainerTestState extends State<AnimatedContainerTest> {
bool isBigger = false;
import 'package:flutter/material.dart';
import 'dart:math' as math;
class TweenAnimationTest extends StatefulWidget {
@override
_TweenAnimationTestState createState() => _TweenAnimationTestState();
}
class _TweenAnimationTestState extends State<TweenAnimationTest> {
double endValue = 0.0;
import 'package:flutter/material.dart';
class RotationTransitionTest extends StatefulWidget {
@override
_RotationTransitionTestState createState() => _RotationTransitionTestState();
}
class _RotationTransitionTestState extends State<RotationTransitionTest>
with SingleTickerProviderStateMixin {
AnimationController _animationController;
import 'package:flutter/material.dart';
class CompoundWidget extends StatefulWidget {
final Function onChanged;
const CompoundWidget({Key key, this.onChanged}) : super(key: key);
@override
_CompoundWidgetState createState() => _CompoundWidgetState();
}
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math.dart' as vector_math;
import 'package:custom_view/composition_widget.dart';
import 'package:custom_view/custom_circle.dart';
/*
custom_circle.dart
*/
class CustomCircle extends CustomPainter {
Paint circlePaint = Paint()
// custom_circle.dart
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math.dart' as vector_math;
class CustomCircle extends CustomPainter {
Paint circlePaint = Paint()
..color = Colors.grey.shade800
..style = PaintingStyle.stroke
..strokeWidth = 10;
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 '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) {