๐
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'; | |
import 'package:flutter_svg/flutter_svg.dart'; | |
import 'package:path/path.dart' as Path; | |
class SmartImageLoader extends StatefulWidget { | |
final String imageUrl; | |
// add others image params like width height fit , alignment, errorBuilder | |
final double? width; | |
final double? height; |
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:io'; | |
import 'dart:convert'; | |
class FileCache { | |
// The directory where the cache files are stored | |
final Directory cacheDir; | |
// The constructor that takes the cache directory as a parameter | |
FileCache(this.cacheDir); |
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:intl/intl.dart'; | |
String getFormattedDate(_date) { | |
var inputFormat = DateFormat('yyyy-MM-dd HH:mm'); | |
var inputDate = inputFormat.parse(_date); | |
var outputFormat = DateFormat('dd/MM/yyyy HH:mm'); | |
// Calculate time difference | |
final timeDifference = DateTime.now().difference(inputDate); |
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 java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.Random; | |
public class BagTripsCalculator { | |
// Default const values 1.01-3.0Kg | |
static final float MINIMUM_WEIGHT = 1.01f; | |
static final float MAXIMUM_WEIGHT = 3f; |
NewerOlder