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
| // function to find the partition position | |
| int partition(List<int> array, int low, int high) { | |
| // select the rightmost element as pivot | |
| int pivot = array[high]; | |
| // pointer for greater element | |
| int i = (low - 1); | |
| // traverse each element of the array | |
| // compare them with the pivot |
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
| onPressed: () async { | |
| img.Image copyRotate(img.Image? image) { | |
| return img.copyRotate(image!, 90); | |
| } | |
| CustomDialogs.loadingDialog(context: context); | |
| img.Image fixedImage; | |
| final capturedImage = await compute(img.decodeImage, state.model.backImage!); | |
| fixedImage = await compute(copyRotate, capturedImage); |
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
| abstract class FurnaceRefinementFailure { | |
| const FurnaceRefinementFailure(); | |
| const factory FurnaceRefinementFailure.insufficientMinerals() = _FurnaceRefinementFailureInsufficientMinerals; | |
| const factory FurnaceRefinementFailure.insuficcientCoal() = _FurnaceRefinementFailureInsuficcientCoal; | |
| const factory FurnaceRefinementFailure.notEnoughCapacity() = _FurnaceRefinementFailureNotEnoughCapacity; | |
| const factory FurnaceRefinementFailure.invalidOwner() = _FurnaceRefinementFailureInvalidOwner; | |
| const factory FurnaceRefinementFailure.serverError() = _FurnaceRefinementFailureServerError; | |
| R map<R>({ | |
| required R Function(_FurnaceRefinementFailureInsufficientMinerals) insufficientMinerals, |
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
| extension MoviesListExtension on List<Movie>{ | |
| List<Movie> get cleanDuplicatedIds { | |
| final moviesMap = <int, Movie>{}; | |
| final moviesToReturn = <Movie>[]; | |
| for (final movie in this) { | |
| if (moviesMap[movie.id] == null) { | |
| moviesMap[movie.id] = movie; | |
| moviesToReturn.add(movie); | |
| } | |
| } |
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 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| class DropdownWidget<T> extends StatefulWidget { | |
| const DropdownWidget({ | |
| Key? key, | |
| required this.items, | |
| required this.itemBuilder, | |
| required this.onChanged, | |
| required this.value, |