Skip to content

Instantly share code, notes, and snippets.

View AmineLAHRIM's full-sized avatar
The Magic Inside Pixels

Amine LAHRIM AmineLAHRIM

The Magic Inside Pixels
View GitHub Profile
@AmineLAHRIM
AmineLAHRIM / .ts
Last active May 17, 2023 08:50
GET ALL children API
async findAll(
i18n: I18nContext,
dto: FilterChildDto,
user: User,
): Promise<Pagination<Child>> {
const { relation, take, skip, search, sharedCarerId } = dto;
const query = this.childRepo.createQueryBuilder('child');
switch (relation) {
case UserType.PARENT:
if (sharedCarerId) {
/*
* Here All App Routes
* */
import 'package:flutter/animation.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:get/get.dart';
import 'package:luna_events_app/presentation/pages/auth_pages/activate_page.dart';
import 'package:luna_events_app/presentation/pages/auth_pages/change_password_page.dart';
import 'package:luna_events_app/presentation/pages/change_profile_page/change_profile_page.dart';
Container(
decoration: BoxDecoration(
gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [
Get.theme.backgroundColor,
Get.theme.backgroundColor.withOpacity(0.8),
Get.theme.backgroundColor.withOpacity(0.2),
]),
),
),
@override
Future<bool> cache(Event event) async {
// TODO: implement cache
final jsonString = event.toJson();
return sharedPreferences.setString(
EVENT + event.id.toString(),
json.encode(jsonString),
);
}
@override
Future<bool> cacheAll(List<Event> events) async {
// TODO: implement cacheAll
var jsonData= events.map((v) => v.toJson()).toList();
return sharedPreferences.setString(
LIST_EVENTS,
json.encode(jsonData),
);
}
class MockSharedPreferences extends Mock implements SharedPreferences {}
main() {
// Here some classes declaration
setUp(() {});
group('description', () {
// Here some attribute to work with in the tests
test('description', () {
// ARRANGE
package com.ecomflutter.demo.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
@Configuration
public class SwaggerConfig {
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<Album> fetchAlbum() async {
final response = await http.get(
'https://jsonplaceholder.typicode.com/albums/1',
headers: {HttpHeaders.authorizationHeader: "Bearer your_api_token_here"},
typedef Future<NumberTrivia> _ConcreteOrRandomChooser();
class NumberTriviaRepositoryImpl implements NumberTriviaRepository {
final NumberTriviaRemoteDataSource remoteDataSource;
final NumberTriviaLocalDataSource localDataSource;
final NetworkInfo networkInfo;
NumberTriviaRepositoryImpl({
@required this.remoteDataSource,
@required this.localDataSource,
flutter pub run build_runner watch --delete-conflicting-outputs