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
/** | |
* A generic class that holds a value with its loading status. | |
* @param <T> | |
*/ | |
// ImmutableClass | |
class Resource<T> private constructor( | |
val status: Status, | |
val data: T? = null, | |
val throwable: Throwable? = null, | |
val id: Long = 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
class DateTimeSerializer { | |
static DateTime? deserialize(String? serialized) { | |
if (serialized == null) return null; | |
final serializedString = serialized; | |
final fixed = serializedString.replaceAllMapped( | |
RegExp(r'(.*:\d\d)(\.\d+)?(Z|[+-]\d{2}:\d{2})'), | |
(match) { | |
// #1 capturing group is date and time without a fraction of a second |
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:convert'; | |
import 'package:logger/logger.dart'; | |
class PrettyLogPrinter extends LogPrinter { | |
static final levelColors = { | |
Level.verbose: AnsiColor.fg(AnsiColor.grey(0.5)), | |
Level.debug: AnsiColor.none(), | |
Level.info: AnsiColor.fg(12), | |
Level.warning: AnsiColor.fg(208), |
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:convert'; | |
import 'package:dio/dio.dart'; | |
/// Log Level | |
enum Level { | |
/// No logs. | |
none, | |
/// Logs request and response lines. |
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 { | |
final appTitle = 'Drawer Demo'; | |
@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 { | |
final appTitle = 'Drawer Demo'; | |
@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
<!-- Copyright 2011 the Dart project authors. All rights reserved. | |
Use of this source code is governed by a BSD-style license | |
that can be found in the LICENSE file. --> | |
<h2>Dr. Fibonacci's Sunflower Spectacular</h2> | |
<div> | |
<canvas id="canvas" width="300" height="300"></canvas> | |
</div> |
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
GITHUB_MIGRATOR_SOURCE_TOKEN={{your_access_tokens}} | |
GITHUB_MIGRATOR_SOURCE_HOSTNAME=github.example.com/api/v3 | |
GITHUB_MIGRATOR_SOURCE_REPO={{source_repository}} | |
GITHUB_MIGRATOR_DESTINATION_TOKEN={{your_access_tokens}} | |
GITHUB_MIGRATOR_DESTINATION_HOSTNAME= | |
GITHUB_MIGRATOR_DESTINATION_REPO={{destination_repository}} |
NewerOlder