Skip to content

Commit

Permalink
Release 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeloAvv committed Mar 12, 2023
1 parent b88cd70 commit d17304d
Show file tree
Hide file tree
Showing 29 changed files with 244 additions and 295 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.2.

* Mapper, DTOMapper and DTO are now constants

## 1.0.1.

* Fixed DTOMapper subtype
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ in your [pubspec.yaml](https://dart.dev/tools/pub/pubspec):

```yaml
dev_dependencies:
pine: ^1.0.1
pine: ^1.0.2
```
You can install packages from the command line:
Expand Down
2 changes: 1 addition & 1 deletion example/lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/blocs/news/news_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/blocs/news/news_event.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/blocs/news/news_state.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/di/blocs.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/di/dependency_injector.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
4 changes: 2 additions & 2 deletions example/lib/di/mappers.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -27,6 +27,6 @@ part of 'dependency_injector.dart';

final List<SingleChildWidget> _mappers = [
Provider<DTOMapper<ArticleDTO, Article>>(
create: (_) => ArticleMapper(),
create: (_) => const ArticleMapper(),
),
];
2 changes: 1 addition & 1 deletion example/lib/di/providers.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/di/repositories.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/models/article.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
37 changes: 31 additions & 6 deletions example/lib/pages/webview_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -27,24 +27,49 @@ import 'package:flutter/material.dart';
import 'package:news_app/models/article.dart';
import 'package:webview_flutter/webview_flutter.dart';

class WebViewPage extends StatelessWidget {
class WebViewPage extends StatefulWidget {
final Article article;

const WebViewPage(
this.article, {
Key? key,
}) : super(key: key);

@override
State<StatefulWidget> createState() => _WebViewPageState();
}

class _WebViewPageState extends State<WebViewPage> {
final WebViewController _controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(const Color(0x00000000))
..setNavigationDelegate(
NavigationDelegate(
onProgress: (int progress) {
// Update loading bar.
},
onPageStarted: (String url) {},
onPageFinished: (String url) {},
onWebResourceError: (WebResourceError error) {},
),
);

@override
void initState() {
_controller.loadRequest(Uri.parse(widget.article.url));
super.initState();
}

@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
title: Text(article.title),
title: Text(widget.article.title),
),
body: _webView(),
);

Widget _webView() => WebView(
key: Key('webview_${article.url}'),
initialUrl: article.url,
Widget _webView() => WebViewWidget(
key: Key('webview_${widget.article.url}'),
controller: _controller,
);
}
5 changes: 4 additions & 1 deletion example/lib/repositories/mappers/article_mapper.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -28,6 +28,9 @@ import 'package:news_app/services/responses/article_dto.dart';
import 'package:pine/pine.dart';

class ArticleMapper extends DTOMapper<ArticleDTO, Article> {

const ArticleMapper();

@override
Article fromDTO(ArticleDTO dto) => Article(
title: dto.title,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/repositories/news_repository.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion example/lib/services/news_service.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
24 changes: 17 additions & 7 deletions example/lib/services/news_service.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions example/lib/services/responses/article_dto.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -34,7 +34,7 @@ class ArticleDTO extends DTO with EquatableMixin {
final String? publishedAt;
final String? content;

ArticleDTO({
const ArticleDTO({
required this.title,
required this.description,
this.urlToImage,
Expand Down
4 changes: 2 additions & 2 deletions example/lib/services/responses/everything_response.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -31,7 +31,7 @@ class EverythingResponse extends DTO {
final int totalResults;
final List<ArticleDTO> articles;

EverythingResponse({
const EverythingResponse({
required this.status,
required this.totalResults,
required this.articles,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/widgets/article_widget.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 MyLittleSuite
* Copyright (c) 2023 MyLittleSuite
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
Loading

0 comments on commit d17304d

Please sign in to comment.