diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000000000000000000000000000000000..d2ddd5752c982da5de37600a591e4da684f82829 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["dart-code.dart-code", "dart-code.flutter"] +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 549a35f24ff76c2153fc8d65a9ad53df6b1ecbb8..362eaf118555fc0cbe9ba62c02265631c5e2b816 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,16 +1,76 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Flutter", - "request": "launch", - "type": "dart", - "args": [ - "--web-hostname", - "127.0.0.1", - "--web-port", - "8181" - ] - } - ] + "version": "0.2.0", + "configurations": [ + { + "name": "Flutter", + "request": "launch", + "type": "dart", + "args": ["--web-hostname", "127.0.0.1", "--web-port", "8181"] + }, + { + "name": "Flutter (Linux)", + "program": "lib/main.dart", + "deviceId": "linux", + "request": "launch", + "type": "dart" + }, + { + "name": "Flutter (macOS)", + "program": "lib/main.dart", + "deviceId": "macos", + "request": "launch", + "type": "dart" + }, + { + "name": "Flutter (Windows)", + "program": "lib/main.dart", + "deviceId": "windows", + "request": "launch", + "type": "dart" + }, + { + "name": "Flutter (Chrome)", + "request": "launch", + "deviceId": "chrome", + "type": "dart", + "args": ["--web-renderer", "html", "--web-hostname", "127.0.0.1", "--web-port", "8181"] + }, + + { + "name": "Flutter (Edge)", + "request": "launch", + "type": "dart", + "args": ["--web-renderer", "html", "--web-hostname", "127.0.0.1", "--web-port", "8181"] + }, + { + "name": "Flutter (Firefox)", + "request": "launch", + "type": "dart", + "args": ["--web-renderer", "html", "--web-hostname", "127.0.0.1", "--web-port", "8181"] + }, + { + "name": "Flutter (Safari)", + "request": "launch", + "type": "dart", + "args": ["--web-renderer", "html", "--web-hostname", "127.0.0.1", "--web-port", "8181"] + }, + { + "name": "Flutter (Opera)", + "request": "launch", + "type": "dart", + "args": ["--web-renderer", "html", "--web-hostname", "127.0.0.1", "--web-port", "8181"] + }, + { + "name": "Flutter (Vivaldi)", + "request": "launch", + "type": "dart", + "args": ["--web-renderer", "html", "--web-hostname", "127.0.0.1", "--web-port", "8181"] + }, + { + "name": "Flutter (Internet Explorer)", + "request": "launch", + "type": "dart", + "args": ["--web-renderer", "html", "--web-hostname", "127.0.0.1", "--web-port", "8181"] + } + ] } diff --git a/README.md b/README.md index 4f87dcf5706239f2784d607583a1d9fd9f631635..0114d80b9b31699dcf1e3a3929fbd56e5676b07d 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,28 @@ # Ğ1nkgo - + Ğ1nkgo (aka Ginkgo) is a lightweight Ğ1 wallet for Duniter v1 written in Flutter. The app allows users to manage their Ğ1 currency on their mobile device using just a browser. ## Features -* Introduction for beginners -* Generation of Cesium wallet and persistence (if you refresh the page, it should display the same - wallet address). -* A point-of-sale device that generates a QR code for the public address and other QR codes with - amounts (which lightweight wallets will understand). -* Send Ğ1 transactions -* Transactions history page and Balance with persistence to load last transactions on boot -* Contact management and cache (to avoid too much API petitions) -* Internationalization (i18n) -* QR code reader -* Import/export of your wallet -* Automatic discover and selection of nodes, error recovery & retry -* Customizable via [env file](https://git.duniter.org/vjrj/ginkgo/-/blob/master/assets/env.production.txt) -* Inline tutorials -* Pagination of transactions -* Some contextual help (for example, by tapping on "Validity"). +- Introduction for beginners +- Generation of Cesium wallet and persistence (if you refresh the page, it should display the same + wallet address). +- A point-of-sale device that generates a QR code for the public address and other QR codes with + amounts (which lightweight wallets will understand). +- Send Ğ1 transactions +- Transactions history page and Balance with persistence to load last transactions on boot +- Contact management and cache (to avoid too much API petitions) +- Internationalization (i18n) +- QR code reader +- Import/export of your wallet +- Automatic discover and selection of nodes, error recovery & retry +- Customizable via [env file](https://git.duniter.org/vjrj/ginkgo/-/blob/master/assets/env.production.txt) +- Inline tutorials +- Pagination of transactions +- Some contextual help (for example, by tapping on "Validity"). ## Demo @@ -32,8 +32,8 @@ This is a demo used for testing a development, please use a production server fo ## Ğ1nkgo in production -- [https://g1nkgo.comunes.org](https://g1nkgo.comunes.org) -- (...) +- [https://g1nkgo.comunes.org](https://g1nkgo.comunes.org) +- (...) ## Translations @@ -44,7 +44,7 @@ First of all, you can contribute translating Ğ1nkgo to your language: ## Docker mkdir -p ~/.ginkgo/nginx-conf -mkdir -p ~/.ginkgo/www +mkdir -p ~/.ginkgo/www ## Dev contributions @@ -53,7 +53,7 @@ mkdir -p ~/.ginkgo/www This repository requires [Flutter](https://flutter.dev/docs/get-started/install) to be installed and present in your development environment. -Project runs in Dart >=2.17.1 <3.0.0, so [higest admisible Flutter version is 3.7.12](https://docs.flutter.dev/release/archive). +<!-- Project runs in Dart >=2.17.1 <3.0.0, so [higest admisible Flutter version is 3.7.12](https://docs.flutter.dev/release/archive). ```sh flutter downgrade 3.7.12 @@ -66,7 +66,7 @@ git checkout 3.7.12 flutter doctor cd - ``` -You will see a warning about _unknown channel_. You can ignore it. +You will see a warning about _unknown channel_. You can ignore it.--> Clone the project and enter the project folder. @@ -83,10 +83,21 @@ flutter pub get ### Build & deploy -Something like this should work: +#### Launch all the tests + +```sh +flutter test ``` -flutter test -flutter build web --release + +#### Build for web (release version) + +```sh +flutter build web --release --no-tree-shake-icons +``` + +#### Build and deploy to your server + +```sh rsync --progress=info2 --delete -aH build/web/ youruser@yourserver:/var/www/ginkgo/ ``` @@ -95,7 +106,7 @@ rsync --progress=info2 --delete -aH build/web/ youruser@yourserver:/var/www/gink Run the app via command line or through your development environment. ```sh -flutter run lib/main.dart +flutter run ``` In order to do gva operations, you should disable cors in the flutter run config: @@ -110,20 +121,20 @@ In order to do gva operations, you should disable cors in the flutter run config This repository makes use of the following pub packages: -| Package | Version | Usage | -|---------------------------------------------------------------------|---------|------------------------------------------------------| -| [Durt](https://pub.dev/packages/durt) | ^0.1.6 | Duniter crypto lib | -| [Bloc](https://pub.dev/packages/bloc) | ^8.1.0 | State management | -| [Flutter Bloc](https://pub.dev/packages/flutter_bloc) | ^8.1.1 | State management | -| [Hydrated Bloc](https://pub.dev/packages/hydrated_bloc) | ^9.0.0 | Persists Bloc state with Hive | -| [Equatable](https://pub.dev/packages/equatable) | ^2.0.5 | Easily compare custom classes, used for Bloc states* | -| [Flutter Lints](https://pub.dev/packages/flutter_lints) | ^2.0.1 | Stricter linting rules | -| [Path Provider](https://pub.dev/packages/path_provider) | ^2.0.11 | Get the save path for Hive | -| [Flutter Displaymode](https://pub.dev/packages/flutter_displaymode) | ^0.5.0 | Support high refresh rate displays | -| [Easy Localization](https://pub.dev/packages/easy_localization) | ^3.0.1 | Makes localization easy | -| [Hive](https://pub.dev/packages/hive) | ^2.2.3 | Platform independent storage. | -| [Url Launcher](https://pub.dev/packages/url_launcher) | ^6.1.7 | Open urls in Browser | -| [Ionicons](https://pub.dev/packages/ionicons) | ^0.2.2 | Modern icon library | +| Package | Version | Usage | +| ------------------------------------------------------------------- | ------- | ----------------------------------------------------- | +| [Durt](https://pub.dev/packages/durt) | ^0.1.6 | Duniter crypto lib | +| [Bloc](https://pub.dev/packages/bloc) | ^8.1.0 | State management | +| [Flutter Bloc](https://pub.dev/packages/flutter_bloc) | ^8.1.1 | State management | +| [Hydrated Bloc](https://pub.dev/packages/hydrated_bloc) | ^9.0.0 | Persists Bloc state with Hive | +| [Equatable](https://pub.dev/packages/equatable) | ^2.0.5 | Easily compare custom classes, used for Bloc states\* | +| [Flutter Lints](https://pub.dev/packages/flutter_lints) | ^2.0.1 | Stricter linting rules | +| [Path Provider](https://pub.dev/packages/path_provider) | ^2.0.11 | Get the save path for Hive | +| [Flutter Displaymode](https://pub.dev/packages/flutter_displaymode) | ^0.5.0 | Support high refresh rate displays | +| [Easy Localization](https://pub.dev/packages/easy_localization) | ^3.0.1 | Makes localization easy | +| [Hive](https://pub.dev/packages/hive) | ^2.2.3 | Platform independent storage. | +| [Url Launcher](https://pub.dev/packages/url_launcher) | ^6.1.7 | Open urls in Browser | +| [Ionicons](https://pub.dev/packages/ionicons) | ^0.2.2 | Modern icon library | ### Easy Localization @@ -144,33 +155,33 @@ to [ios/Runner/Info.plist](./ios/Runner/Info.plist) and update the following cod ## Screenshots -| Wallet | Terminal card | -|--------------------------------------------------------------------------------|-------------------------------------------------------------------------------| +| Wallet | Terminal card | +| ---------------------------------------------------------------- | ---------------------------------------------------------------------- | |  |  | ## Credits ### Translations -- ast: dixebral -- ca: calbasi -- de: FW -- eu: Anna Ayala Alcalá -- fr: vincentux, poka, Hugo and Maaltir -- gl: Vijitâtman -- it: Anna Ayala Alcalá -- nl: Maria Rosa Costa i Alandi -- pt: Carlos Neto +- ast: dixebral +- ca: calbasi +- de: FW +- eu: Anna Ayala Alcalá +- fr: vincentux, poka, Hugo and Maaltir +- gl: Vijitâtman +- it: Anna Ayala Alcalá +- nl: Maria Rosa Costa i Alandi +- pt: Carlos Neto Thanks! ### Others -- Ğ1 logos from duniter.org -- undraw intro images: https://undraw.co/license -- Chipcard https://commons.wikimedia.org/wiki/File:Chipcard.svg under the Creative Commons - Attribution-Share Alike 3.0 Unported license. -- [POS svg from wikimedia](https://commons.wikimedia.org/wiki/File:Card_Terminal_POS_Flat_Icon_Vector.svg) CC-BY-SA 4.0 +- Ğ1 logos from duniter.org +- undraw intro images: https://undraw.co/license +- Chipcard https://commons.wikimedia.org/wiki/File:Chipcard.svg under the Creative Commons + Attribution-Share Alike 3.0 Unported license. +- [POS svg from wikimedia](https://commons.wikimedia.org/wiki/File:Card_Terminal_POS_Flat_Icon_Vector.svg) CC-BY-SA 4.0 Thanks! diff --git a/pubspec.lock b/pubspec.lock index 8476889da6566a5ee701769911f18f89b9472fd2..b3e393b07bc9c9fbd6dce72f6d8613894e801c7a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -237,10 +237,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" connectivity_plus: dependency: transitive description: @@ -915,18 +915,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -1368,26 +1368,26 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1440,10 +1440,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" timeago: dependency: "direct main" description: @@ -1652,6 +1652,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" web_browser_detect: dependency: "direct main" description: @@ -1701,5 +1709,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.10.0" diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000000000000000000000000000000000000..91a10f7ae1906320d43aa4fa6cc293cde8120dbb --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,29 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ginkgo/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const GinkgoApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}