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
package product.methods; | |
import com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import java.net.URLDecoder; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; |
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
function Stopwatch() { | |
let isStarted = false; | |
let startTime; | |
let stopTime; | |
Object.defineProperty(this, "duration", { | |
get: () => { | |
if(startTime && stopTime) { | |
return (stopTime - startTime) / 1000; | |
} |
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
/** | |
* {@link WordAdapter} is an {@link ArrayAdapter} that can provide the layout for each list | |
* based on a data source, which is a list of {@link Word} objects. | |
* | |
*/ | |
public class WordAdapter extends ArrayAdapter<Word> { | |
WordAdapter(@NonNull Context context, ArrayList<Word> wordArrayList) { | |
// Here, we initialize the ArrayAdapter's internal storage for the context and the list. | |
// the second argument is used when the ArrayAdapter is populating a single TextView. |
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
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Hala para refrescar"), | |
), | |
body: list != null | |
? RefreshIndicator( | |
key: refreshKey, | |
child: ListView.builder( |
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
@override | |
void initState() { | |
super.initState(); | |
random = Random(); | |
refreshList(); | |
} | |
Future<Null> refreshList() async { | |
refreshKey.currentState?.show(); | |
await Future.delayed(Duration(seconds: 2)); |
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:math'; | |
var list; | |
var random; | |
var refreshKey = GlobalKey<RefreshIndicatorState>(); |
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 PdfViewPage extends StatefulWidget { | |
final String path; | |
const PdfViewPage({Key key, this.path}) : super(key: key); | |
@override | |
_PdfViewPageState createState() => _PdfViewPageState(); | |
} | |
class _PdfViewPageState extends State<PdfViewPage> { | |
int _total_de_paginas = 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
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text("Abrir pdf"), | |
), | |
body: Center( | |
child: Builder( | |
builder: (context) => Column( |
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
String assetPDFPath = ""; | |
String urlPDFPath = ""; | |
@override | |
void initState() { | |
super.initState(); | |
getFileFromAsset("assets/mypdf.pdf").then((f) { | |
setState(() { | |
assetPDFPath = f.path; |
NewerOlder