private fun changedrawabletoUri(resourceId :Int):Uri{
val imageUri = (Uri.Builder())
.scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
.authority(resources.getResourcePackageName(resourceId))
.appendPath(resources.getResourceTypeName(resourceId))
.appendPath(resources.getResourceEntryName(resourceId))
.build()
return imageUri
}
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
| class Injector { | |
| static final Injector _singleton = new Injector._internal(); | |
| static final dio = Dio(); | |
| factory Injector() { | |
| return _singleton; | |
| } | |
| Injector._internal(); | |
| RestApiClient getClient() { | |
| // dio.options.connectTimeout = 10000; | |
| // dio.options.receiveTimeout = 3000; |
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
| static const String routeName = '/LogInScreen'; | |
| static Route route() { | |
| return PageRouteBuilder( | |
| settings: RouteSettings(name: routeName), | |
| pageBuilder: (context, animation, secondaryAnimation) => LogInScreen(), | |
| transitionsBuilder: (context, animation, secondaryAnimation, child) { | |
| const begin = Offset(1.0, 0.0); |
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
| // Use this class as | |
| MapMarkerGeneratorFromWidget(CommonMethods.customNumberMarker("${i+1}"), (bitmaps) { | |
| setState(() { | |
| BitmapDescriptor icon = BitmapDescriptor.fromBytes(bitmaps); | |
| dev.log("$TAG icon :-- $icon"); | |
| if(updatedOrders[i].addressDelivery?.latLng != null) { | |
| LatLng markerLatLng = LatLng( | |
| (updatedOrders[i].addressDelivery?.latLng?.latitude ?? 0.0) |
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
| fun listFilesInDirectory(directoryPath: String): List<File> { | |
| val directory = File(directoryPath) | |
| return directory.listFiles()?.toList() ?: emptyList() | |
| } | |
| //--- Implement Read text from file | |
| fun readTextFromFile(filePath: String): String? { | |
| val file = File(filePath) | |
| if (!file.exists() || !file.isFile) { | |
| return null |
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
| class Order { | |
| String? uid; | |
| String? orderNo; | |
| String? email; | |
| String? phoneNumber; | |
| String? firstName; | |
| String? lastName; | |
| String? numberOfAdults; | |
| String? numberOfChildren; | |
| String? table; |
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
| #!/bin/sh | |
| # lowerit | |
| # convert all file names in the current directory to lower case | |
| # only operates on plain files--does not change the name of directories | |
| # will ask for verification before overwriting an existing file | |
| for x in `ls` | |
| do | |
| if [ ! -f $x ]; then | |
| continue | |
| fi |
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
| find . -depth -name '* *' | while read fname | |
| do | |
| new_fname=`echo $fname | tr " " "_"` | |
| if [ -e $new_fname ] | |
| then | |
| echo "File $new_fname already exists. Not replacing $fname" | |
| else |
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
| countries.add(Country("af", "+93", "Afghanistan")) | |
| countries.add(Country("al", "+355", "Albania")) | |
| countries.add(Country("dz", "+213", "Algeria")) | |
| countries.add(Country("ad", "+376", "Andorra")) | |
| countries.add(Country("ao", "+244", "Angola")) | |
| countries.add(Country("ai", "+1", "Anguilla")) | |
| countries.add(Country("aq", "+672", "Antarctica")) | |
| countries.add(Country("ag", "+1", "Antigua and Barbuda")) | |
| countries.add(Country("ar", "+54", "Argentina")) | |
| countries.add(Country("am", "+374", "Armenia")) |
NewerOlder