This is the full Cloud Functions code explained in my blog post: How to schedule a Cloud Function to run in the future (in order to build a Firestore document TTL)
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 'staggered_grid.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: HomeScreen(), | |
), |
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
const MY_DOMAIN = 'rezaarkan.com'; | |
const SLUG_TO_PAGE = { | |
'': '882cd6dd6e1e482d823b464f326213e5', | |
'now': '25b7df64071d420d8f609bf76d9f4114', | |
'portfolio': '6000547bed0d441793bfba1498c063e2', | |
'resume': '0934b80d2d1544f99dedadb00be9d146', | |
'recommendations': '29115129efa44f1a870f390dd2c0a6c0', | |
'photos': 'e78c0492a5ec486aa51f4cdb2c6f4603', | |
'blog': '29bb193c1a104ba2b832788b57d58cd6', |
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
# define base image as python slim-buster. | |
FROM python:3.7-slim-buster as base | |
## start builder stage. | |
# this is the first stage of the build. | |
# it will install all requirements. | |
FROM base as builder | |
# install all packages for chromedriver: https://gist.github.com/varyonic/dea40abcf3dd891d204ef235c6e8dd79 |
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 DioAdapterMock extends Mock implements HttpClientAdapter {} | |
const dioHttpHeadersForResponseBody = { | |
Headers.contentTypeHeader: [Headers.jsonContentType], | |
}; | |
void main() { | |
group('UserRemoteDataSource', () { | |
final Dio dio = Dio(); |
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'; | |
@immutable | |
class ClipShadowPath extends StatelessWidget { | |
final Shadow shadow; | |
final CustomClipper<Path> clipper; | |
final Widget child; | |
ClipShadowPath({ | |
@required this.shadow, |
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:rect_getter/rect_getter.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Visible Demo', |
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
<!-- Maker Link by @levelsio --> | |
<!-- MIT License --> | |
<style> | |
body { | |
background:#333; | |
} | |
.levelsio-by { | |
font-family:"Helvetica Neue",sans-serif; | |
right: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
// Comparing to a color | |
if (Objects.equals(view.getBackground().getConstantState(), activity.getResources().getDrawable(R.color.anyColor).getConstantState())) { | |
// Do what you have to do... | |
} | |
// Comparing to a drawable | |
if (Objects.equals(view.getBackground().getConstantState(), activity.getResources().getDrawable(R.drawable.anyDrawable).getConstantState())) { | |
// Do what you have to do... | |
} |
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:intl/intl.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_localizations/flutter_localizations.dart'; | |
import 'package:intl_translate_example/l10n/messages_all.dart'; | |
void main() => runApp(new MyApp()); | |
class Translations { | |
static Future<Translations> load(Locale locale) { |
NewerOlder