View gist:7bf185b718b7445a859b96ccf27f34d8
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/widgets.dart'; | |
import 'package:path/path.dart'; | |
import 'package:sqflite/sqflite.dart'; | |
void main() async { | |
// Avoid errors caused by flutter upgrade. | |
// Importing 'package:flutter/widgets.dart' is required. | |
WidgetsFlutterBinding.ensureInitialized(); |
View gist:2cadcbba5f44df61698bd94c3e4b79de
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 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:http/http.dart' as http; | |
Future<Album> createAlbum(String title) async { | |
final response = await http.post( | |
Uri.parse('https://jsonplaceholder.typicode.com/albums'), | |
headers: <String, String>{ |
View gist:5f59d6b9cd27cbf9c276fd4dc22abd37
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 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:http/http.dart' as http; | |
Future<Album> fetchAlbum() async { | |
final response = await http | |
.get(Uri.parse('https://jsonplaceholder.typicode.com/albums/1')); |
View Github Actions
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
name: Android CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: |
View ItemContentProvider
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
public class ItemContentProvider extends ContentProvider { | |
@Override | |
public boolean onCreate() { return true; } | |
@Nullable | |
@Override |
View Coroutine
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
GlobalScope | |
coroutineScope | |
runBlocking | |
runBlocking 2 | |
Job | |
Récupérer la valeur d'un Job | |
Exception | |
=============================== | |
GlobalScope | |
=============================== |
View Mockito
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
Dans Unit Test | |
============================================ | |
Database | |
============================================ | |
public class Database { | |
public boolean isAvailable() { | |
// currently not implemented, as this is just demo used in a software test | |
return false; | |
} |
View Network
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
Sans runTime permission | |
=================================== | |
Gradle | |
=================================== | |
implementation 'com.android.volley:volley:1.2.1' | |
=================================== | |
Manifest |
View Espresso Test
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
======================================================== | |
layout activity | |
======================================================== | |
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> |
NewerOlder