Skip to content

Commit

Permalink
Merge pull request #4 from prasadsunny1/master
Browse files Browse the repository at this point in the history
Migrate to null safety
  • Loading branch information
jakelumetta authored May 13, 2021
2 parents c2673ef + ef45b72 commit 4d0675a
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 84 deletions.
12 changes: 6 additions & 6 deletions lib/src/butter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ class Butter {
/// The API token for Butter user
final String _apiKey;

Pages page;
Content content;
Posts post;
Authors author;
Categories category;
Tags tag;
Pages? page;
Content? content;
Posts? post;
Authors? author;
Categories? category;
Tags? tag;

Butter(this._apiKey) {
if (_apiKey == "") {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/files/authors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Authors {
/// Retrieves a single author using slug
/// [params] is a Map used to add additional parameters to the query
Future<Response> retrieve([
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand All @@ -22,7 +22,7 @@ class Authors {
/// Lists all authors
/// [params] is a Map used to add additional parameters to the query
Future<Response> list([
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/files/categories.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Categories {
/// Retrieves a single category using slug
/// [params] is a Map used to add additional parameters to the query
Future<Response> retrieve([
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand All @@ -22,7 +22,7 @@ class Categories {
/// Lists all categories
/// [params] is a Map used to add additional parameters to the query
Future<Response> list([
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/files/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Content {
/// [params] is a Map used to add additional parameters to the query
Future<Response> retrieve(
List<String> keys, [
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/files/pages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Pages {
Future<Response> retrieve(
String pageType,
String pageSlug, [
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand All @@ -30,7 +30,7 @@ class Pages {
/// [params] is a Map used to add additional parameters to the query
Future<Response> list(
String pageType, [
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand Down
6 changes: 3 additions & 3 deletions lib/src/files/posts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Posts {
/// [params] is a Map used to add additional parameters to the query
Future<Response> retrieve(
String slug, [
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null) {
params["auth_token"] = _apiKey;
Expand All @@ -25,7 +25,7 @@ class Posts {
/// Lists multiple posts according to page size
/// [params] is a Map used to add additional parameters to the query
Future<Response> list([
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand All @@ -39,7 +39,7 @@ class Posts {
/// [params] is a Map used to add additional parameters to the query
Future<Response> search(
String query, [
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null) {
params["auth_token"] = _apiKey;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/files/tags.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Tags {
/// Retrieves a single page from Pages
/// [params] is a Map used to add additional parameters to the query
Future<Response> retrieve([
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand All @@ -22,7 +22,7 @@ class Tags {
/// Retrieves multiple pages from a pageType of Pages
/// [params] is a Map used to add additional parameters to the query
Future<Response> list([
Map<String, String> params,
Map<String, String>? params,
]) {
if (params != null)
params["auth_token"] = _apiKey;
Expand Down
Loading

0 comments on commit 4d0675a

Please sign in to comment.