Skip to content

Commit

Permalink
Consolidate code changes in v2 branch and merge it to main branch (#19)
Browse files Browse the repository at this point in the history
Merge code changes from v2 to the main branch, details check PR description
  • Loading branch information
BigtoC committed May 23, 2022
1 parent 0a2ee73 commit 92a8e83
Show file tree
Hide file tree
Showing 145 changed files with 3,519 additions and 2,918 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ app.*.map.json
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

# secret keys
*.key
**/secrets/*.key
**/secrets/*.json
**/secrets/*.yaml
94 changes: 61 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,90 @@

A Flutter notes app with blockchain storage.
> The letter "**h**" stands for **him/her** or **happiness**.
> Notes about him/her, or notes about happiness
> Notes(NFTs) about him/her, or about happiness

## Usage guide

### Quick start
1. Download app from release page (Android only for now)
2. Open App, set your date

### Blockchain functions
> To use NFT functions, please setup blockchain connection services
1. Sign up an Alchemy account ([here](https://auth.alchemyapi.io/signup)) and create an Alchemy key ([tutorial](https://auth.alchemyapi.io/signup))
2. Click `IMPORT NFT` button in the home page to show NFTs
3. Create a Metamask wallet and connect to Ropsten testnet
4. Use [Pixura beta](https://ropsten-platform.pixura.io/) to publish your NFTs


## Development Stages

### Stage 1

> Basic notes mobile app developments
> Target finish before 2020-05-22
> Finished on 2020-05-08
- [x] Show how many days we've been together
- [x] Switch light/dark themes
- [x] Rich text editor
- [x] Take notes and local storage
- [x] Show notes in an appropriate way
- [x] Search notes
- [x] Set the love start date first for the first time open this app

### Stage 2

> Smart contracts and blockchain related developments
> No target due day
- [x] Make hand shake with the blockchain platform
- [x] Show some blockchain information
- [ ] Develop smart contract on AntFin blockchain system ([蚂蚁金服 - 蚂蚁区块链](https://tech.antfin.com/blockchain))
- [ ] Integrate with blockchain storage
- [ ] Mark and show important notes

### Stage 3

- [x] Set the love start date first for the first time open this app

### Stage 2 (Migration and clean up)
> New blockchain related developments
> Target finish before 2022-05-10
> Finished on 2022-05-06
- [x] {2.0} Migrate to Flutter 2 and latest Dart version
- [x] {2.0.5} Codes clean up and structure enhancements
- [X] {2.1} Switch to Ropsten (Ethereum testnet), and use Alchemy as a blockchain connection service
- [x] {2.2} Show more blockchain information
- [x] {2.3} Implement DDD Architecture ([reference](https://github.com/ResoCoder/flutter-ddd-firebase-course))

### Stage 3 (The Next Generation)
> Import and present ERC-721
> Target finish before 2022-05-27 (1000 days)
> Merge v2 to main branch and release new version
- [x] {3.0.1} Allow user import the API key, instead of read a secret file.
- [x] {3.1} Import and show NFTs in the home page
- [x] {3.2} Show details of an imported NFT from the home page
- [x] {3.3} Navigate to usage guide webpage from drawer
- [x] {3.4} Swipe right to delete a NFT

### Stage pre-4
> Housekeeping jobs before stage 4
- [x] {4.0.1} Upgrade to flutter 3 ([What’s new in Flutter 3](https://medium.com/flutter/whats-new-in-flutter-3-8c74a5bc32d0))
- [x] {4.0.2} Merge v2 to main branch and make release the latest version
- [ ] {4.0.3} GitHub Action for building release packages ([reference](https://github.com/marketplace/actions/release-changelog-builder))

### Stage 4
> More functions
- [ ] {4.1} Search NFTs
- [ ] {4.2} Mark one item as important and show the important item in home page

### Stage 5
> More enhancements (and some fun functions)
- [ ] Share notes text contents
- [ ] Share notes content in a picture
- [ ] Biometric authentications (Finger print, face unlock)
- [ ] More functions welcome pull requests and create issues
- [ ] Share notes content in a picture
- [ ] Biometric authentications (Finger print, face unlock)
- [ ] More functions welcome pull requests and create issues

## References

* Alchemy: [documents](https://docs.alchemy.com/alchemy/)
* App interface: [roshanrahman/flutter-notes-app](https://github.com/roshanrahman/flutter-notes-app)
* Rich text editor: [Zefyr Editor](https://zefyr-editor.gitbook.io/docs/quick-start)
* RSA Encryption: [flutter RSA 加解密](https://blog.csdn.net/rznice/article/details/104486712)
* Sign for handshake: [googleapis auth](https://github.com/dart-lang/googleapis_auth)
* More page route transitions: [关于 Flutter 页面路由过渡动画,你所需要知道的一切](https://juejin.im/post/5ceb6179f265da1bc23f55d0)
* Draggable buttons: [Flutter实战手势番外篇之可拖拽悬浮组件](https://juejin.im/post/5e4b9c74f265da57127e3f63)
* Flutter App example: [filiph/hn_app](https://github.com/filiph/hn_app)
* Flutter DDD Article: [Beginner’s guide to Flutter with DDD](https://medium.com/@ushimaru/beginners-guide-to-flutter-with-ddd-87d4c476c3cb)
* Flutter DDD Example: [Domain-Driven Design + Firebase Flutter Course](https://github.com/ResoCoder/flutter-ddd-firebase-course)
* More page route transitions: [关于 Flutter 页面路由过渡动画,你所需要知道的一切](https://juejin.im/post/5ceb6179f265da1bc23f55d0)

## Getting Started with Flutter

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
For help getting started with Flutter, view the
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
compileSdkVersion 32

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -39,8 +39,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.bigto.hnotes"
minSdkVersion 16
targetSdkVersion 29
minSdkVersion 26
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
6 changes: 1 addition & 5 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:name="${applicationName}"
android:label="hnotes"
android:icon="@mipmap/ic_launcher">
<activity
Expand All @@ -29,10 +29,6 @@
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable-mdpi/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions android/app/src/main/res/drawable-night/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions android/app/src/main/res/drawable-v21/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 4 additions & 10 deletions android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
18 changes: 18 additions & 0 deletions android/app/src/main/res/values-night-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowSplashScreenBackground">#212121</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
20 changes: 20 additions & 0 deletions android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
18 changes: 18 additions & 0 deletions android/app/src/main/res/values-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowSplashScreenBackground">#212121</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
6 changes: 4 additions & 2 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand All @@ -13,6 +15,6 @@
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@android:color/white</item>
<item name="android:windowBackground">@android:color/black</item>
</style>
</resources>
</resources>
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.21'
repositories {
google()
jcenter()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
Binary file removed assets/Images/aurora-kiss-bg.png
Binary file not shown.
Binary file removed assets/Images/deers-bg.jpg
Binary file not shown.
Binary file modified assets/Images/heart-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/logo/Ethereum-Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/logo/alchemy-logo-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/logo/alchemy-logo-blue-gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/logo/alchemy-logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file removed assets/Images/splash-bg.png
Binary file not shown.
Binary file removed assets/Images/sun-bg.jpg
Binary file not shown.
Binary file added assets/Images/sun-bg.png
Binary file added assets/Images/sun-splash.png
Empty file.
Loading

0 comments on commit 92a8e83

Please sign in to comment.