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
private val httpClient = OkHttpClient.Builder() | |
//This Interceptor is the main logging Interceptor | |
.addInterceptor { chain -> | |
val request = chain.request() | |
val jsonObj = JSONObject(Gson().toJson(request)) | |
val requestBody = (jsonObj | |
?.getJSONObject("tags") | |
?.getJSONObject("class retrofit2.Invocation") | |
?.getJSONArray("arguments")?.get(0) ?: "").toString() |
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:animated_text_kit/animated_text_kit.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
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 ShortStreamBuilder<T> extends StatelessWidget { | |
const ShortStreamBuilder({@required this.stream, @required this.builder}); | |
final Stream<T> stream; | |
final AsyncWidgetBuilder<T> builder; | |
@override | |
Widget build(BuildContext context) { | |
return StreamBuilder<T>( | |
stream: stream, |
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:async'; | |
import 'package:flutter/material.dart'; | |
StreamController<bool> isLightTheme = StreamController(); | |
main() { | |
runApp(MainApp()); | |
} |
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
void main() { | |
var now = DateTime.now(); | |
var nextYear = now.nextYear; | |
var lastYear = now.previousYear(); | |
now.printYYYYMMdd("-"); | |
nextYear.printYYYYMMdd("/"); | |
lastYear.printYYYYMMdd("."); |
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:async'; | |
import 'package:flutter/material.dart'; | |
StreamController<bool> isLightTheme = StreamController.broadcast(); | |
main() { | |
runApp(MainApp()); | |
} |
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'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
main() { | |
runApp(MainApp()); | |
} | |
class MainApp extends StatelessWidget { |
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
void main() { | |
normalFunction("Laxman", "Bhattarai", 26, 65); | |
optionalFunction("Laxman", "Bhattarai"); | |
optionalFunction("Laxman", "Bhattarai", age: 26); | |
optionalFunction("Laxman", "Bhattarai", weight: 65); | |
optionalFunction("Laxman", "Bhattarai", weight: 65, age: 26); | |
positionalFunction("Laxman", "Bhattarai"); | |
positionalFunction("Laxman", "Bhattarai", 26); |
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'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |