View main.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:flutter/material.dart'; | |
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
void main() { | |
runApp( | |
const ProviderScope(child: MyApp()), | |
); | |
} | |
final sourceProvider = StateProvider((ref) => 0); |
View json
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
{ | |
"openapi": "3.0.0", | |
"info": { | |
"title": "TestApi", | |
"version": "1.0" | |
}, | |
"paths": { | |
"/users/{userId}": { | |
"parameters": [ | |
{ |
View main.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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
import 'dart:math'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { |
View gist:d1a04bc00a19e973add816f970efc860
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
allProjects { | |
tasks.withType(JavaCompile).configureEach { | |
options.compilerArgs += [ | |
"-Adagger.formatGeneratedSource=disabled", | |
"-Adagger.gradle.incremental=true" | |
] | |
} | |
afterEvaluate { |
View installflutter.sh
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
#!/usr/bin/env bash | |
# fail if any commands fails | |
set -e | |
# debug log | |
set -x | |
cd .. | |
git clone -b dev https://github.com/flutter/flutter.git | |
export PATH=`pwd`/flutter/bin:$PATH | |
envman add --key PATH --value $PATH |
View mapme-additems.kt
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
// add new data and tell the adapter about it | |
items.addAll(myData) | |
adapter.notifyDataSetChanged() | |
// or with DiffUtil | |
val diff = DiffUtil.calculateDiff(myDiffCallback) | |
diff.dispatchUpdatesTo(adapter) |
View mapme-setup.kt
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
val adapter: MapMeAdapter = GoogleMapMeAdapter(context, items) | |
adapter.setOnAnnotationClickListener(this) | |
mapView.getMapAsync { googleMap -> | |
//Attach the adapter to the map view once it's initialized | |
adapter.attach(mapView, googleMap) | |
} |
View mapme.kt
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 MapsAdapter(context: Context, private val markers: List<MarkerData>) : GoogleMapMeAdapter(context) { | |
fun onCreateAnnotation(factory: AnnotationFactory, position: Int, annotationType: Int): MapAnnotation { | |
val item = this.markers[position] | |
return factory.createMarker(item.getLatLng(), null, item.getTitle()) | |
} | |
fun onBindAnnotation(annotation: MapAnnotation, position: Int, payload: Any) { | |
if (annotation is MarkerAnnotation) { | |
val item = this.markers[position] |
View androidmanifest.xml
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
<!-- Prevents TouchWiz from surrounding your app icon in a frame --> | |
<!-- Add to your manifest inside the application tag --> | |
<meta-data | |
android:name="com.samsung.android.icon_container.has_icon_container" | |
android:value="true"/> |
NewerOlder