├── lib
├── router
│ ├── route_handlers.dart
│ └── routes.dart
├── pages
│ ├── home
│ │ ├── showcase_timeline.dart
│ │ └── home_page.dart
│ ├── message
│ │ └── message_page.dart
│ ├── bill
│ │ ├── test.json
│ │ ├── data.dart
│ │ └── bill_page.dart
│ ├── keep_account
│ │ └── keep_account_page.dart
│ ├── account_select
│ │ └── account_select_page.dart
│ ├── test
│ │ ├── Item.dart
│ │ ├── modal-screen.dart
│ │ ├── dbhelper.dart
│ │ ├── screens.dart
│ │ └── test_page.dart
│ ├── set
│ │ └── set_page.dart
│ ├── report
│ │ ├── indicator.dart
│ │ └── report_page.dart
│ ├── balance_and_payments
│ │ ├── indicator.dart
│ │ └── pages.balance_and_payments_page.dart
│ ├── mine
│ │ ├── mine_ad_widget.dart
│ │ └── mine_page.dart
│ ├── encourage
│ │ └── encourage_page.dart
│ ├── register
│ │ └── register_page.dart
│ ├── login
│ │ └── login_page.dart
│ └── budget
│ │ └── budget_page.dart
├── config
│ ├── color.dart
│ └── config.dart
├── utils
│ ├── tool_util.dart
│ ├── img_util.dart
│ ├── navigator_util.dart
│ ├── toast_util.dart
│ ├── date_util.dart
│ └── dio_util.dart
├── db
│ ├── db_provider.dart
│ ├── db_manager.dart
│ └── provider
│ │ └── user
│ │ └── user_list_db_provider.dart
├── main.dart
├── dao
│ └── user.dart
├── widgets
│ ├── panel_widget.dart
│ └── cell_widget.dart
└── navigator
│ └── tab_navigator.dart
├── ios
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.plist
├── Runner
│ ├── Runner-Bridging-Header.h
│ ├── Assets.xcassets
│ │ ├── LaunchImage.imageset
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ ├── README.md
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── WorkspaceSettings.xcsettings
│ │ └── IDEWorkspaceChecks.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── xcshareddata
│ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ └── project.pbxproj
└── .gitignore
├── ui
└── ui_01.jpg
├── asset
└── images
│ ├── empty.png
│ ├── logo.png
│ ├── zfbskm.jpg
│ ├── icon_vip.png
│ ├── ic_me_vip.png
│ ├── icon_aixin.png
│ ├── icon_fuli.png
│ ├── icon_gongju.png
│ ├── icon_jtcy.png
│ ├── icon_kefu.png
│ ├── icon_yusuan.png
│ ├── ic_me_service.png
│ ├── icon_biaoqian.png
│ ├── account_banner.jpg
│ ├── ic_me_yd_tab_ad.png
│ ├── ic_mine_message.png
│ ├── ic_mine_setting.png
│ ├── ic_skin_home_me.png
│ ├── ic_skin_home_bill.png
│ ├── ic_skin_home_chart.png
│ ├── ic_skin_home_finance.png
│ ├── ic_skin_home_property.png
│ ├── ic_vip_default_avatar.png
│ ├── ic_skin_home_me_pressed.png
│ ├── ic_skin_home_bill_pressed.png
│ ├── ic_skin_home_chart_pressed.png
│ ├── ic_skin_home_finance_pressed.png
│ └── ic_skin_home_property_pressed.png
├── android
├── gradle.properties
├── .gitignore
├── app
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ └── values
│ │ │ │ │ └── styles.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── flutter_pocket_book
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── settings.gradle
└── build.gradle
├── .metadata
├── .gitignore
├── README.md
├── LICENSE
├── test
└── widget_test.dart
├── pubspec.yaml
└── pubspec.lock
/lib/router/route_handlers.dart:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/pages/home/showcase_timeline.dart:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/config/color.dart:
--------------------------------------------------------------------------------
1 | class Color {
2 | static const bottonColor = 'F55351';
3 | }
4 |
--------------------------------------------------------------------------------
/ui/ui_01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ui/ui_01.jpg
--------------------------------------------------------------------------------
/lib/config/config.dart:
--------------------------------------------------------------------------------
1 | class Config {
2 | static const baseUrl = 'https://www.baidu.com';
3 | }
4 |
--------------------------------------------------------------------------------
/asset/images/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/empty.png
--------------------------------------------------------------------------------
/asset/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/logo.png
--------------------------------------------------------------------------------
/asset/images/zfbskm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/zfbskm.jpg
--------------------------------------------------------------------------------
/asset/images/icon_vip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/icon_vip.png
--------------------------------------------------------------------------------
/asset/images/ic_me_vip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_me_vip.png
--------------------------------------------------------------------------------
/asset/images/icon_aixin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/icon_aixin.png
--------------------------------------------------------------------------------
/asset/images/icon_fuli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/icon_fuli.png
--------------------------------------------------------------------------------
/asset/images/icon_gongju.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/icon_gongju.png
--------------------------------------------------------------------------------
/asset/images/icon_jtcy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/icon_jtcy.png
--------------------------------------------------------------------------------
/asset/images/icon_kefu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/icon_kefu.png
--------------------------------------------------------------------------------
/asset/images/icon_yusuan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/icon_yusuan.png
--------------------------------------------------------------------------------
/asset/images/ic_me_service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_me_service.png
--------------------------------------------------------------------------------
/asset/images/icon_biaoqian.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/icon_biaoqian.png
--------------------------------------------------------------------------------
/asset/images/account_banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/account_banner.jpg
--------------------------------------------------------------------------------
/asset/images/ic_me_yd_tab_ad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_me_yd_tab_ad.png
--------------------------------------------------------------------------------
/asset/images/ic_mine_message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_mine_message.png
--------------------------------------------------------------------------------
/asset/images/ic_mine_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_mine_setting.png
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_me.png
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_bill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_bill.png
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_chart.png
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_finance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_finance.png
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_property.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_property.png
--------------------------------------------------------------------------------
/asset/images/ic_vip_default_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_vip_default_avatar.png
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_me_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_me_pressed.png
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_bill_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_bill_pressed.png
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_chart_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_chart_pressed.png
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_finance_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_finance_pressed.png
--------------------------------------------------------------------------------
/asset/images/ic_skin_home_property_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/asset/images/ic_skin_home_property_pressed.png
--------------------------------------------------------------------------------
/lib/utils/tool_util.dart:
--------------------------------------------------------------------------------
1 | class Tool {
2 | static isEmpty(String str) {
3 | if (str == null || str == "") return true;
4 | return false;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/lib/utils/img_util.dart:
--------------------------------------------------------------------------------
1 | class Img {
2 | static getAssetsImg(String imgName) {
3 | assert(imgName != null);
4 | return "asset/images/" + imgName;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minimissile/flutter_pocket_book/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/flutter_pocket_book/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.flutter_pocket_book
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/utils/navigator_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/widgets.dart';
3 |
4 | class NavigatorUtil {
5 | /// 跳转到指定页面
6 | static push(BuildContext context, Widget page) {
7 | Navigator.push(context, MaterialPageRoute(builder: (context) => page));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/utils/toast_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:fluttertoast/fluttertoast.dart';
3 |
4 | class Toast {
5 | static show(String msg) {
6 | Fluttertoast.showToast(
7 | msg: msg,
8 | gravity: ToastGravity.CENTER,
9 | backgroundColor: Colors.black54,
10 | );
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 8af6b2f038c1172e61d418869363a28dffec3cb4
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lib/pages/message/message_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class MessagePage extends StatefulWidget {
4 | @override
5 | _MessagePageState createState() => _MessagePageState();
6 | }
7 |
8 | class _MessagePageState extends State {
9 | @override
10 | Widget build(BuildContext context) {
11 | return Scaffold(
12 | appBar: AppBar(
13 | title: Text('消息中心'),
14 | centerTitle: true,
15 | elevation: 0,
16 | ),
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/pages/bill/test.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "type": "信用卡",
4 | "name": "招商银行",
5 | "asset": 5000
6 | },
7 | {
8 | "type": "信用卡",
9 | "name": "农业银行",
10 | "asset": 5000
11 | },
12 | {
13 | "type": "投资账户",
14 | "name": "天天基金网",
15 | "asset": 5000
16 | },
17 | {
18 | "type": "投资账户",
19 | "name": "华泰证券",
20 | "asset": 5000
21 | },
22 | {
23 | "type": "信用卡",
24 | "name": "招商银行",
25 | "asset": 5000
26 | },
27 | {
28 | "type": "现金",
29 | "name": "现金",
30 | "asset": 5000
31 | }
32 | ]
--------------------------------------------------------------------------------
/lib/pages/keep_account/keep_account_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | /// 记账
4 | class KeepAccountPage extends StatefulWidget {
5 | @override
6 | _KeepAccountPageState createState() => _KeepAccountPageState();
7 | }
8 |
9 | class _KeepAccountPageState extends State {
10 | @override
11 | Widget build(BuildContext context) {
12 | return Scaffold(
13 | appBar: AppBar(
14 | title: Text('记账'),
15 | ),
16 | body: Container(
17 | child: Text('记账页面'),
18 | ),
19 | );
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/pages/bill/data.dart:
--------------------------------------------------------------------------------
1 | class AccountData {
2 | String type;
3 | String name;
4 | int asset;
5 |
6 | AccountData({this.type, this.name, this.asset});
7 |
8 | AccountData.fromJson(Map json) {
9 | type = json['type'];
10 | name = json['name'];
11 | asset = json['asset'];
12 | }
13 |
14 | Map toJson() {
15 | final Map data = new Map();
16 | data['type'] = this.type;
17 | data['name'] = this.name;
18 | data['asset'] = this.asset;
19 | return data;
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/lib/pages/account_select/account_select_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | // 选择账户
4 | class AccountSelectPage extends StatefulWidget {
5 | @override
6 | _AccountSelectPageState createState() => _AccountSelectPageState();
7 | }
8 |
9 | class _AccountSelectPageState extends State {
10 | @override
11 | Widget build(BuildContext context) {
12 | return Scaffold(
13 | appBar: AppBar(
14 | title: Text('选择账户类型'),
15 | ),
16 | body: ListView(
17 | children: [],
18 | ),
19 | );
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/utils/date_util.dart:
--------------------------------------------------------------------------------
1 | class DateUtil {
2 | /// 获取当月总天数
3 | static int getDaysNum(int year, int month) {
4 | if (month == 1 ||
5 | month == 3 ||
6 | month == 5 ||
7 | month == 7 ||
8 | month == 8 ||
9 | month == 10 ||
10 | month == 12) {
11 | return 31;
12 | } else if (month == 2) {
13 | if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
14 | //闰年 2月29
15 | return 29;
16 | } else {
17 | //平年 2月28
18 | return 28;
19 | }
20 | } else {
21 | return 30;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | include ':app'
6 |
7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
8 | def properties = new Properties()
9 |
10 | assert localPropertiesFile.exists()
11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12 |
13 | def flutterSdkPath = properties.getProperty("flutter.sdk")
14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
16 |
--------------------------------------------------------------------------------
/lib/pages/test/Item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class Item extends StatefulWidget {
4 | final String title;
5 |
6 | Item({this.title});
7 |
8 | @override
9 | _ItemState createState() => _ItemState();
10 | }
11 |
12 | class _ItemState extends State- {
13 | @override
14 | Widget build(BuildContext context) {
15 | return Container(
16 | child: Card(
17 | margin: EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
18 | child: Center(
19 | child: Text(widget.title),
20 | ),
21 | ),
22 | height: 100.0,
23 | );
24 | }
25 |
26 | @override
27 | void dispose() {
28 | // TODO: implement dispose
29 | super.dispose();
30 | }
31 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Symbolication related
37 | app.*.symbols
38 |
39 | # Obfuscation related
40 | app.*.map.json
41 |
42 | # Exceptions to above rules.
43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
44 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/lib/pages/set/set_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class SetPage extends StatefulWidget {
4 | @override
5 | _SetPageState createState() => _SetPageState();
6 | }
7 |
8 | class _SetPageState extends State {
9 | @override
10 | Widget build(BuildContext context) {
11 | return Scaffold(
12 | appBar: AppBar(
13 | title: Text('设置'),
14 | centerTitle: true,
15 | elevation: 0,
16 | ),
17 | body: ListView(
18 | children: [
19 | Container(
20 | color: Colors.white12,
21 | child: Padding(
22 | padding: EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
23 | child: Text(
24 | '记账设置',
25 | style: TextStyle(fontSize: 14.0, color: Colors.black54),
26 | ),
27 | ),
28 | )
29 | ],
30 | ),
31 | );
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 有钱记账
2 |
3 | > 换电脑后开发环境一直没搭成功,项目更新先搁置
4 |
5 | 基于flutter开发的全资产记账应用
6 |
7 |
8 | ## 期望
9 |
10 | > 一直想做一款全资产的记账软件,试用了市面上几十款应用,都离我的期待相差很远,刚好《网易有钱》现在不再维护了,它算是离我的预期最接近的一款了,所以决定在其基础之上继续完善,加入自己的想法,力争做出一款成熟的产品
11 |
12 | > 所谓的全资产管理,不单单局限于日常的收支统计,如今的投资理财多样化,基金、股票、现货、期货、外汇、银行理财、私募理财、虚拟货币投资、固定资产投资等等······五花八门,
13 | > 如何才能轻松的管理自己的资产,应该有不少人都有类似的困扰,这也是我想要挑战的难题
14 |
15 |
16 | ## 使用到的第三方库
17 |
18 | | 库 | 功能 |
19 | | ------------------------- | --------------- |
20 | | [fluro](https://pub.flutter-io.cn/packages/fluro) | **路由管理** |
21 | | [fluttertoast](https://pub.flutter-io.cn/packages/fluttertoast) | **吐司** |
22 | | [percent_indicator](https://pub.flutter-io.cn/packages/percent_indicator) | **进度条** |
23 | | [pull_to_refresh](https://pub.flutter-io.cn/packages/pull_to_refresh) | **下拉刷新** |
24 | | [sqflite](https://pub.flutter-io.cn/packages/sqflite) | **本地数据库** |
25 |
26 |
27 | ## 已实现的效果
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/lib/pages/report/indicator.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class Indicator extends StatelessWidget {
4 | final Color color;
5 | final String text;
6 | final bool isSquare;
7 | final double size;
8 | final Color textColor;
9 |
10 | const Indicator({
11 | Key key,
12 | this.color,
13 | this.text,
14 | this.isSquare,
15 | this.size = 16,
16 | this.textColor = const Color(0xff505050),
17 | }) : super(key: key);
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Row(
22 | children: [
23 | Container(
24 | width: size,
25 | height: size,
26 | decoration: BoxDecoration(
27 | shape: isSquare ? BoxShape.rectangle : BoxShape.circle,
28 | color: color,
29 | ),
30 | ),
31 | const SizedBox(
32 | width: 4,
33 | ),
34 | Text(
35 | text,
36 | style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: textColor),
37 | )
38 | ],
39 | );
40 | }
41 | }
--------------------------------------------------------------------------------
/lib/pages/balance_and_payments/indicator.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class Indicator extends StatelessWidget {
4 | final Color color;
5 | final String text;
6 | final bool isSquare;
7 | final double size;
8 | final Color textColor;
9 |
10 | const Indicator({
11 | Key key,
12 | this.color,
13 | this.text,
14 | this.isSquare,
15 | this.size = 16,
16 | this.textColor = const Color(0xff505050),
17 | }) : super(key: key);
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Row(
22 | children: [
23 | Container(
24 | width: size,
25 | height: size,
26 | decoration: BoxDecoration(
27 | shape: isSquare ? BoxShape.rectangle : BoxShape.circle,
28 | color: color,
29 | ),
30 | ),
31 | const SizedBox(
32 | width: 4,
33 | ),
34 | Text(
35 | text,
36 | style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: textColor),
37 | )
38 | ],
39 | );
40 | }
41 | }
--------------------------------------------------------------------------------
/lib/db/db_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:sqflite/sqflite.dart';
2 | import 'package:meta/meta.dart';
3 | import 'package:flutter_pocket_book/db/db_manager.dart';
4 |
5 | /// 数据库操作基类
6 | abstract class BaseDbProvider {
7 | bool isTableExits = false;
8 |
9 | tableSqlString();
10 |
11 | tableName();
12 |
13 | ///创建表sql语句
14 | tableBaseString(String name, String columnId) {
15 | return '''
16 | create table $name (
17 | $columnId integer primary key autoincrement,
18 | ''';
19 | }
20 |
21 | Future getDataBase() async {
22 | return await open();
23 | }
24 |
25 | ///super 函数对父类进行初始化
26 | @mustCallSuper
27 | prepare(name, String createSql) async {
28 | isTableExits = await DBManager.isTableExits(name);
29 | if (!isTableExits) {
30 | Database db = await DBManager.getCurrentDatabase();
31 | return await db.execute(createSql);
32 | }
33 | }
34 |
35 | @mustCallSuper
36 | open() async {
37 | if (!isTableExits) {
38 | await prepare(tableName(), tableSqlString());
39 | }
40 | return await DBManager.getCurrentDatabase();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 minimissile
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:fluro/fluro.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter/services.dart';
5 | import 'package:flutter_pocket_book/router/routes.dart';
6 |
7 | void main() {
8 |
9 | // 修改状态栏颜色
10 | SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
11 |
12 | runApp(MyApp());
13 | // 透明状态栏
14 | if (Platform.isAndroid) {
15 | SystemUiOverlayStyle systemUiOverlayStyle =
16 | SystemUiOverlayStyle(statusBarColor: Colors.transparent);
17 | SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
18 | }
19 | }
20 |
21 | class MyApp extends StatelessWidget {
22 | @override
23 | Widget build(BuildContext context) {
24 | Router router = Router();
25 | Routes.configureRoutes(router);
26 |
27 | return MaterialApp(
28 | title: '有钱记账',
29 | debugShowCheckedModeBanner: false,
30 | onGenerateRoute: router.generator,
31 | theme: ThemeData(
32 | primarySwatch: Colors.blue,
33 | visualDensity: VisualDensity.adaptivePlatformDensity,
34 | ),
35 | // home: TabNavigator()
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/dao/user.dart:
--------------------------------------------------------------------------------
1 | //import 'package:flutter_pocket_book/db/db_provider.dart';
2 | //import 'package:sqflite/sqflite.dart';
3 | //
4 | //class User {
5 | // final String id;
6 | // final String account;
7 | // final String password;
8 | //
9 | // User(User msg, {this.id, this.account, this.password});
10 | //
11 | // factory User.fromJson(Map json) {
12 | // return User(
13 | // id: json['id'],
14 | // account: json['account'],
15 | // password: json['password'],
16 | // );
17 | // }
18 | //}
19 | //
20 | //class UserDao extends BaseDbProvider {
21 | // // 表名
22 | // final String name = 'User';
23 | //
24 | // final String columnId = '_id';
25 | //
26 | // @override
27 | // tableName() {
28 | // return name;
29 | // }
30 | //
31 | // @override
32 | // tableSqlString() {
33 | // return tableBaseString(name, columnId) +
34 | // '''
35 | // id text not null,
36 | // account text,
37 | // password text)
38 | // ''';
39 | // }
40 | //
41 | // Future insert(User msg) async {
42 | // Database db = await getDataBase();
43 | // return await db.insert(name, User(msg));
44 | // }
45 | //}
46 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | // google()
5 | // jcenter()
6 | maven { url 'https://maven.aliyun.com/repository/google' }
7 | maven { url 'https://maven.aliyun.com/repository/jcenter' }
8 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
9 | }
10 |
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:3.5.0'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | // google()
20 | // jcenter()
21 | maven { url 'https://maven.aliyun.com/repository/google' }
22 | maven { url 'https://maven.aliyun.com/repository/jcenter' }
23 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
24 | }
25 | }
26 |
27 | rootProject.buildDir = '../build'
28 | subprojects {
29 | project.buildDir = "${rootProject.buildDir}/${project.name}"
30 | }
31 | subprojects {
32 | project.evaluationDependsOn(':app')
33 | }
34 |
35 | task clean(type: Delete) {
36 | delete rootProject.buildDir
37 | }
38 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:flutter_pocket_book/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/lib/db/db_manager.dart:
--------------------------------------------------------------------------------
1 | import 'package:sqflite/sqflite.dart';
2 | import 'package:path/path.dart';
3 | import 'dart:io';
4 |
5 | class DBManager {
6 | /// 数据库版本
7 | static const _VERSION = 1;
8 |
9 | /// 数据库名
10 | static const _NAME = "pocket_book.db";
11 |
12 | /// 数据库实例
13 | static Database _database;
14 |
15 | ///初始化
16 | static init() async {
17 | var databasesPath = await getDatabasesPath();
18 | String path = join(databasesPath, _NAME);
19 | if(Platform.isIOS) {
20 | path = databasesPath + '/' + _NAME;
21 | }
22 | _database = await openDatabase(path,
23 | version: _VERSION, onCreate: (Database db, int version) async {});
24 | }
25 |
26 | ///判断表是否存在
27 | static isTableExits(String tableName) async {
28 | await getCurrentDatabase();
29 | var res = await _database.rawQuery(
30 | "select * from Sqlite_master where type = 'table' and name = '$tableName'");
31 | return res != null && res.length > 0;
32 | }
33 |
34 | ///获取当前数据库对象
35 | static Future getCurrentDatabase() async {
36 | if (_database == null) {
37 | await init();
38 | }
39 | return _database;
40 | }
41 |
42 | ///关闭
43 | static close() {
44 | _database?.close();
45 | _database = null;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/lib/utils/dio_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | import '../config/config.dart';
5 |
6 | class DioHttp {
7 | Dio _client;
8 | BuildContext context;
9 |
10 | static DioHttp of(BuildContext context) {
11 | return DioHttp._internal(context);
12 | }
13 |
14 | DioHttp._internal(BuildContext context) {
15 | if (_client == null || context != this.context) {
16 | this.context = context;
17 | var options = BaseOptions(
18 | baseUrl: Config.baseUrl,
19 | connectTimeout: 1000 * 10,
20 | receiveTimeout: 1000 * 3,
21 | extra: {'context': context});
22 |
23 | var client = Dio(options);
24 | this._client = client;
25 | }
26 | }
27 |
28 | Future>> get(String path,
29 | [Map params, String token]) async {
30 | var options = Options(headers: {'Authorization': token});
31 | return await _client.get(path, queryParameters: params, options: options);
32 | }
33 |
34 | Future>> post(String path,
35 | [Map params, String token]) async {
36 | var options = Options(headers: {'Authorization': token});
37 | return await _client.post(path, data: params, options: options);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_pocket_book
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.example.flutter_pocket_book"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/lib/pages/mine/mine_ad_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_pocket_book/utils/img_util.dart';
4 |
5 | List adInfoMap = [
6 | {
7 | "imgUrl": "ic_me_yd_tab_ad.png",
8 | "title": "主题换肤",
9 | "desc": "主题随心换",
10 | },
11 | // {
12 | // "imgUrl": "ic_me_yd_tab_ad.png",
13 | // "title": "广告投放",
14 | // "desc": "广告",
15 | // },
16 | // {
17 | // "imgUrl": "ic_me_yd_tab_ad.png",
18 | // "title": "广告投放",
19 | // "desc": "广告",
20 | // },
21 | ];
22 |
23 | class MineAd extends StatefulWidget {
24 | @override
25 | _MineAdState createState() => _MineAdState();
26 | }
27 |
28 | class _MineAdState extends State {
29 | @override
30 | Widget build(BuildContext context) {
31 | return Container(
32 | color: Colors.red,
33 | padding: EdgeInsets.only(top: 28.0, bottom: 20.0),
34 | child: Row(
35 | mainAxisAlignment: MainAxisAlignment.start,
36 | crossAxisAlignment: CrossAxisAlignment.start,
37 | children: adBuilder(),
38 | ),
39 | );
40 | }
41 | }
42 |
43 | // 广告位 创建
44 | List adBuilder() {
45 | List result = new List();
46 | adInfoMap.forEach((item) {
47 | result.add(Expanded(
48 | flex: 1,
49 | child: Column(
50 | mainAxisAlignment: MainAxisAlignment.center,
51 | children: [
52 | Image.asset(
53 | Img.getAssetsImg(item["imgUrl"]),
54 | fit: BoxFit.cover,
55 | height: 35.0,
56 | width: 35.0,
57 | ),
58 | SizedBox(height: 8.0),
59 | Text(
60 | item["title"],
61 | style: TextStyle(
62 | fontSize: 13.0,
63 | color: Colors.black,
64 | ),
65 | ),
66 | SizedBox(height: 3.0),
67 | Text(
68 | item["desc"],
69 | style: TextStyle(
70 | fontSize: 10.0,
71 | color: Colors.grey,
72 | ),
73 | ),
74 | ],
75 | ),
76 | ));
77 | });
78 | return result.toList();
79 | }
80 |
--------------------------------------------------------------------------------
/lib/pages/test/modal-screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class SampleModalScreen extends ModalRoute {
4 | SampleModalScreen();
5 |
6 | @override
7 | Duration get transitionDuration => Duration(milliseconds: 500);
8 |
9 | @override
10 | bool get opaque => false;
11 |
12 | @override
13 | bool get barrierDismissible => false;
14 |
15 | @override
16 | Color get barrierColor => Colors.black.withOpacity(0.5);
17 |
18 | @override
19 | String get barrierLabel => null;
20 |
21 | @override
22 | bool get maintainState => true;
23 |
24 | @override
25 | Widget buildPage(
26 | BuildContext context,
27 | Animation animation,
28 | Animation secondaryAnimation,
29 | ) {
30 | // This makes sure that text and other content follows the material style
31 | return Material(
32 | type: MaterialType.transparency,
33 | // make sure that the overlay content is not cut off
34 | child: SafeArea(
35 | child: _buildOverlayContent(context),
36 | ),
37 | );
38 | }
39 |
40 | Widget _buildOverlayContent(BuildContext context) {
41 | return Container(
42 | height: MediaQuery.of(context).size.height * 0.3,
43 | width: MediaQuery.of(context).size.width * 0.3,
44 | margin: EdgeInsets.all(30.0),
45 | padding: EdgeInsets.symmetric(horizontal: 30.0),
46 | color: Colors.amber,
47 | child: Column(
48 | mainAxisAlignment: MainAxisAlignment.center,
49 | crossAxisAlignment: CrossAxisAlignment.center,
50 | children: [
51 | Text(
52 | "This is a modal screen",
53 | textAlign: TextAlign.center,
54 | style: TextStyle(
55 | color: Colors.black,
56 | fontSize: 26.0,
57 | ),
58 | ),
59 | Center(
60 | child: RaisedButton(
61 | color: Colors.blue,
62 | onPressed: () {
63 | Navigator.pop(context);
64 | },
65 | child: Text(
66 | "Return",
67 | style: TextStyle(color: Colors.white),
68 | ),
69 | ),
70 | ),
71 | ],
72 | ),
73 | );
74 | }
75 | }
--------------------------------------------------------------------------------
/lib/widgets/panel_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class PanelWidget extends StatelessWidget {
4 | const PanelWidget({
5 | Key key,
6 | }) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | TextStyle _accountTitleStyle = TextStyle(
11 | fontSize: 12.0,
12 | color: Colors.black45,
13 | );
14 |
15 | return Container(
16 | color: Colors.white,
17 | padding: EdgeInsets.symmetric(horizontal: 10.0),
18 | margin: EdgeInsets.only(bottom: 8.0),
19 | child: Column(
20 | children: [
21 | Container(
22 | height: 30.0,
23 | child: Row(
24 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
25 | children: [
26 | Text(
27 | '网络账户 (2)',
28 | style: _accountTitleStyle,
29 | ),
30 | Text(11111.toStringAsFixed(2), style: _accountTitleStyle),
31 | ],
32 | ),
33 | ),
34 | Column(
35 | children: [
36 | rowItem(),
37 | rowItem(),
38 | rowItem(showBorder: false),
39 | ],
40 | )
41 | ],
42 | ),
43 | );
44 | }
45 |
46 | Container rowItem({bool showBorder = true}) {
47 | print(showBorder);
48 | return Container(
49 | height: 56.0,
50 | decoration: BoxDecoration(
51 | border: Border(
52 | bottom: BorderSide(
53 | width: (showBorder == true) ? 0.33 : 0,
54 | color: (showBorder == true) ? Colors.black12 : Colors.transparent,
55 | ),
56 | ),
57 | ),
58 | child: Row(
59 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
60 | children: [
61 | Row(
62 | children: [
63 | Icon(
64 | Icons.account_balance_wallet,
65 | size: 20.0,
66 | ),
67 | SizedBox(
68 | width: 6.0,
69 | ),
70 | Text('微信钱包'),
71 | ],
72 | ),
73 | Text(
74 | 500.toStringAsFixed(2),
75 | style: TextStyle(fontSize: 16.0),
76 | )
77 | ],
78 | ),
79 | );
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/lib/pages/encourage/encourage_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_pocket_book/utils/img_util.dart';
3 | import 'package:flutter_pocket_book/widgets/cell_widget.dart';
4 | import 'package:share/share.dart';
5 |
6 | /// 爱的鼓励
7 | class EncouragePage extends StatefulWidget {
8 | @override
9 | _EncouragePageState createState() => _EncouragePageState();
10 | }
11 |
12 | class _EncouragePageState extends State {
13 | @override
14 | Widget build(BuildContext context) {
15 | return Scaffold(
16 | appBar: AppBar(
17 | elevation: 0,
18 | backgroundColor: Color(0xffFF5267),
19 | title: Text('爱的鼓励'),
20 | ),
21 | body: Container(
22 | color: Colors.white,
23 | child: Column(
24 | children: [
25 | Container(
26 | height: 165.0,
27 | child: Center(
28 | child: Column(
29 | children: [
30 | Container(
31 | width: 120.0,
32 | child: Image.asset(
33 | Img.getAssetsImg('logo.png'),
34 | ),
35 | ),
36 | Text(
37 | '有钱记账',
38 | style: TextStyle(fontSize: 18.0),
39 | )
40 | ],
41 | ),
42 | ),
43 | ),
44 | Container(
45 | height: 10.0,
46 | color: Color.fromARGB(255, 245, 245, 245),
47 | ),
48 | CellWidget(
49 | title: '分享给好友',
50 | value: '',
51 | onTap: () {
52 | Share.share('https://pub.flutter-io.cn/packages/share/install');
53 | },
54 | ),
55 | Container(
56 | margin: EdgeInsets.symmetric(vertical: 36.0),
57 | width: MediaQuery.of(context).size.width * 0.7,
58 | child: Image.asset(Img.getAssetsImg('zfbskm.jpg')),
59 | ),
60 | Center(
61 | child: Text('您的鼓励,我的动力',style: TextStyle(
62 | fontSize: 18.0,
63 | color: Colors.black54,
64 | ),),
65 | )
66 | ],
67 | ),
68 | ),
69 | );
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/lib/pages/register/register_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class RegisterPage extends StatefulWidget {
4 | @override
5 | _RegisterPageState createState() => _RegisterPageState();
6 | }
7 |
8 | class _RegisterPageState extends State {
9 | @override
10 | Widget build(BuildContext context) {
11 | return Scaffold(
12 | appBar: AppBar(
13 | title: Text('注册'),
14 | centerTitle: true,
15 | ),
16 | body: SafeArea(
17 | minimum: EdgeInsets.all(20.0),
18 | child: ListView(
19 | children: [
20 | TextField(
21 | decoration: InputDecoration(
22 | labelText: '账号',
23 | hintText: '请输入账号',
24 | ),
25 | ),
26 | TextField(
27 | obscureText: true,
28 | decoration: InputDecoration(
29 | labelText: '密码',
30 | hintText: '请输入密码',
31 | ),
32 | ),
33 | TextField(
34 | obscureText: true,
35 | decoration: InputDecoration(
36 | labelText: '确认密码',
37 | hintText: '请再次输入密码',
38 | ),
39 | ),
40 | Padding(
41 | padding: EdgeInsets.all(13.0),
42 | ),
43 | RaisedButton(
44 | color: Colors.blue,
45 | padding: EdgeInsets.symmetric(vertical: 13.0),
46 | onPressed: () {},
47 | child: Text(
48 | '注册',
49 | style: TextStyle(color: Colors.white, fontSize: 16.0),
50 | ),
51 | ),
52 | Padding(
53 | padding: EdgeInsets.all(8.0),
54 | ),
55 | Row(
56 | mainAxisAlignment: MainAxisAlignment.end,
57 | children: [
58 | Text('已有账号?'),
59 | FlatButton(
60 | padding: EdgeInsets.all(0.0),
61 | onPressed: () {
62 | Navigator.pushReplacementNamed(context, '/');
63 | },
64 | child: Text(
65 | '去登录',
66 | style: TextStyle(color: Colors.blue),
67 | ),
68 | )
69 | ],
70 | )
71 | ],
72 | ),
73 | ),
74 | );
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/lib/widgets/cell_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | /// cell
5 | class CellWidget extends StatelessWidget {
6 | final Function onTap;
7 |
8 | ///左边文字
9 | final String title;
10 |
11 | ///右边文字
12 | final String value;
13 |
14 | ///是否显示右边箭头
15 | final bool showLink;
16 |
17 | ///左边icon
18 | final Widget icon;
19 |
20 | ///iconName
21 | final String iconName;
22 |
23 | const CellWidget(
24 | {Key key,
25 | this.onTap,
26 | this.title,
27 | this.value,
28 | this.showLink = true,
29 | this.icon,
30 | this.iconName})
31 | : super(key: key);
32 |
33 | @override
34 | Widget build(BuildContext context) {
35 | return Padding(
36 | padding: EdgeInsets.symmetric(horizontal: 10.0),
37 | child: FlatButton(
38 | padding: EdgeInsets.all(0.0),
39 | onPressed: () {
40 | if (onTap != null) {
41 | onTap();
42 | }
43 | },
44 | child: Container(
45 | height: 50.0,
46 | decoration: BoxDecoration(
47 | border: Border(
48 | bottom: BorderSide(
49 | width: 0.33,
50 | color: Colors.black12,
51 | ),
52 | ),
53 | ),
54 | child: Row(
55 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
56 | children: [
57 | Row(
58 | children: [
59 | if (icon != null)
60 | Padding(
61 | padding: EdgeInsets.only(right: 10.0),
62 | child: icon,
63 | ),
64 | Text(
65 | title,
66 | style:
67 | TextStyle(fontWeight: FontWeight.w600, fontSize: 14.0),
68 | ),
69 | ],
70 | ),
71 | Row(
72 | crossAxisAlignment: CrossAxisAlignment.center,
73 | children: [
74 | Text(
75 | value,
76 | style: TextStyle(color: Colors.black54, fontSize: 14.0),
77 | ),
78 | Padding(
79 | padding: EdgeInsets.only(left: 3.0),
80 | ),
81 | if (showLink)
82 | Icon(
83 | Icons.keyboard_arrow_right,
84 | color: Colors.black54,
85 | ),
86 | ],
87 | )
88 | ],
89 | ),
90 | ),
91 | ),
92 | );
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/lib/pages/test/dbhelper.dart:
--------------------------------------------------------------------------------
1 | import 'package:path/path.dart';
2 | import 'package:sqflite/sqflite.dart';
3 |
4 | class DatabaseHelper {
5 | // 数据库名
6 | static final _databaseName = 'pocket_book.db';
7 |
8 | static final _databaseVersion = 1;
9 |
10 | static final table = 'user_info_table';
11 |
12 | static final columnID = 'id';
13 | static final columnName = 'name';
14 | static final columnAge = 'age';
15 |
16 | static Database _database;
17 |
18 | DatabaseHelper._privateConstructor();
19 |
20 | static final DatabaseHelper instance = DatabaseHelper._privateConstructor();
21 |
22 | Future get databse async {
23 | if (_database != null) return _database;
24 |
25 | _database = await _initDatabase();
26 | return _database;
27 | }
28 |
29 | _initDatabase() async {
30 | // Directory documentdirecoty = await getApplicationDocumentsDirectory();
31 | // String path = join(documentdirecoty.path, _databaseName);
32 |
33 | var databasesPath = await getDatabasesPath();
34 | String path = join(databasesPath, _databaseName);
35 |
36 | return await openDatabase(path,
37 | version: _databaseVersion, onCreate: _onCreate);
38 | }
39 |
40 | Future _onCreate(Database db, int version) async {
41 | await db.execute('''
42 | CREATE TABLE $table (
43 | $columnID INTEGER PRIMARY KEY,
44 | $columnName TEXT NOT NULL,
45 | $columnAge INTEGER NOT NULL
46 | )
47 | ''');
48 | }
49 |
50 | // 插入数据
51 | Future insert(Map row) async {
52 | Database db = await instance.databse;
53 | return await db.insert(table, row);
54 | }
55 |
56 | // 查询所有数据
57 | Future>> queryAll() async {
58 | Database db = await instance.databse;
59 | return await db.query(table);
60 | }
61 |
62 | // 条件查询
63 | // todo: 测试未通过
64 | Future>> querySpecific(int age) async {
65 | Database db = await instance.databse;
66 | var res = await db.query(table,
67 | columns: [columnID, columnName, columnAge],
68 | where: '$columnAge > ?',
69 | whereArgs: [age]);
70 | // var res = await db.rawQuery('SELECT * FROM my_table WHERE age >?',[age]);
71 | return res;
72 | }
73 |
74 | // 删除数据
75 | Future deleteData(int id) async {
76 | Database db = await instance.databse;
77 | var res = await db.delete(table, where: "id = ?", whereArgs: [id]);
78 | return res;
79 | }
80 |
81 | Future update(int id,Map msg) async {
82 | Database db = await instance.databse;
83 | var res = await db.update(table, msg, where: "id = ?", whereArgs: [id]);
84 | return res;
85 | }
86 |
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
9 |
13 |
20 |
24 |
28 |
33 |
37 |
38 |
39 |
40 |
41 |
42 |
44 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/lib/db/provider/user/user_list_db_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_pocket_book/db/db_provider.dart';
2 | import 'package:sqflite/sqflite.dart';
3 |
4 | class UserListDbProvider extends BaseDbProvider {
5 | // 用户列表(家庭多成员记账)
6 | final String name = 'UserList';
7 | final String columnId = '_id';
8 | final String columnFullName = "fullName";
9 | final String columnAccount = 'account';
10 | final String columnPassword = 'password';
11 |
12 | int id;
13 | String fullName;
14 | String account;
15 | String password;
16 |
17 | UserListDbProvider();
18 |
19 | Map toMap(String fullName, String account, String password) {
20 | Map map = {
21 | columnFullName: fullName,
22 | columnAccount: account,
23 | columnPassword: password
24 | };
25 | if (id != null) {
26 | map[columnId] = id;
27 | }
28 | return map;
29 | }
30 |
31 | UserListDbProvider.fromMap(Map map) {
32 | id = map[columnId];
33 | fullName = map[columnFullName];
34 | account = map[columnAccount];
35 | password = map[columnPassword];
36 | }
37 |
38 | @override
39 | tableSqlString() {
40 | return tableBaseString(name, columnId) +
41 | '''
42 | $columnFullName text not null,
43 | $columnAccount text not null,
44 | $columnPassword text not null)
45 | ''';
46 | }
47 |
48 | @override
49 | tableName() {
50 | return name;
51 | }
52 |
53 | Future _getProvider(Database db, String fullName) async {
54 | List