This file contains 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:typed_data'; | |
import 'dart:ui'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
import 'package:google_maps_flutter/google_maps_flutter.dart'; | |
Future<BitmapDescriptor> createCustomMarkerBitmap(int markerNumber, String imageURL) async { | |
int markerWidth; | |
if (kIsWeb) markerWidth= 30; else markerWidth = 100; |
This file contains 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
List<LatLng> decodeEncodedPolyline(String encoded) { | |
List<LatLng> poly = []; | |
int index = 0, len = encoded.length; | |
int lat = 0, lng = 0; | |
BigInt Big0 = BigInt.from(0); | |
BigInt Big0x1f = BigInt.from(0x1f); | |
BigInt Big0x20 = BigInt.from(0x20); | |
while (index < len) { | |
int shift = 0; |
This file contains 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
@JS('navigator.geolocation') // navigator.geolocation namespace | |
library jslocation; // library name can be whatever you want | |
import "package:js/js.dart"; | |
// locjs.getCurrentPosition(allowInterop((pos) => success(pos)) | |
@JS('getCurrentPosition') // Accessing method getCurrentPosition from Geolocation API | |
external void getCurrentPosition(Function success(GeolocationPosition pos), Function error(var err), options); | |
@JS('watchPosition') // Accessing method watchPosition from Geolocation API |
This file contains 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:flame/position.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flame/flame.dart'; | |
import 'package:flame/game.dart'; | |
import 'dart:math'; | |
import 'package:flame/components/component.dart'; | |
import 'package:flame/components/mixins/tapable.dart'; | |
import 'package:flame/sprite.dart'; | |
import 'package:flame/text_config.dart'; | |
import 'i18n.dart'; |
This file contains 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:flame/flame.dart'; | |
import 'package:flame/game.dart'; | |
import 'dart:math'; | |
class MyGame extends BaseGame { | |
static int kills; | |
static int target; | |
static final Paint paint = Paint(); | |
static Rect progressIndicatorRect; | |
static double progressIndicatorLength; | |
Rect bgRect; |
This file contains 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_localizations/flutter_localizations.dart'; | |
import 'package:flame/components/component.dart'; | |
import 'package:flame/sprite.dart'; | |
import 'package:flame/flame.dart'; | |
import 'package:audioplayers/audioplayers.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'package:firebase_admob/firebase_admob.dart'; | |
// Create the following file with this command: flutter pub run flappy_translator | |
import 'i18n.dart'; |
This file contains 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 Gnat extends SpriteComponent with Tapable { | |
Sprite sprite; | |
double xMax, yMax; | |
double xSpeed, ySpeed; | |
double spriteSize; | |
final spriteSpeed = 18.0; | |
final spriteMin = 30.0; | |
final spriteMax = 60.0; | |
bool wall = false; | |
bool remove = false; |
This file contains 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:flame/components/component.dart'; | |
import 'package:flame/sprite.dart'; | |
import 'package:flame/flame.dart'; | |
import 'package:audioplayers/audioplayers.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'gameclasses.dart'; | |
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); |
This file contains 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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains 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/services.dart'; | |
import 'package:camera/camera.dart'; | |
import 'package:soundpool/soundpool.dart'; | |
import 'dart:ui' as ui; | |
import 'dart:typed_data'; | |
import 'package:image/image.dart' as imglib; | |
import 'package:flutter/foundation.dart'; | |
import 'breedinfo.dart'; | |
import 'package:image_gallery_saver/image_gallery_saver.dart'; |
NewerOlder