├── android ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── app │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── logo.png │ │ │ │ ├── yotaku.png │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── values │ │ │ │ └── styles.xml │ │ │ └── drawable │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── launch_background.xml │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── java │ │ │ └── cn │ │ │ │ └── yotaku │ │ │ │ └── light │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── .gitignore ├── settings.gradle ├── build.gradle ├── gradlew.bat └── gradlew ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── AppDelegate.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 │ ├── main.m │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcworkspace │ └── contents.xcworkspacedata ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ └── project.pbxproj └── .gitignore ├── assets ├── font │ └── HYQH.ttf ├── images │ └── logo.png ├── background │ ├── bg1.png │ ├── bg10.png │ ├── bg11.png │ ├── bg2.png │ ├── bg3.png │ ├── bg4.png │ ├── bg5.png │ ├── bg6.png │ ├── bg7.jpg │ ├── bg8.png │ └── bg9.png └── styles.json ├── .gitignore ├── lib ├── models │ ├── section.dart │ ├── chapter.dart │ ├── book.dart │ ├── pagination.dart │ └── style.dart ├── main.dart ├── pages │ ├── home.dart │ ├── app.dart │ ├── search.dart │ ├── shelf.dart │ ├── reader │ │ └── reader.dart │ └── import_local.dart ├── utils │ ├── constants.dart │ ├── paging.dart │ ├── initial.dart │ ├── utils.dart │ ├── book_decoder.dart │ └── light_engine.dart ├── widgets │ ├── link_text_span.dart │ ├── text_indicator.dart │ ├── drawer.dart │ ├── file_item.dart │ ├── book_item.dart │ └── custom_page_route.dart └── services │ ├── system.dart │ ├── book.dart │ └── file.dart ├── .metadata ├── light.iml ├── README-zh.md ├── light_android.iml ├── README.md ├── test ├── unit_test.dart └── styles.dart ├── pubspec.yaml └── pubspec.lock /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /assets/font/HYQH.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/font/HYQH.ttf -------------------------------------------------------------------------------- /assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/images/logo.png -------------------------------------------------------------------------------- /assets/background/bg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg1.png -------------------------------------------------------------------------------- /assets/background/bg10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg10.png -------------------------------------------------------------------------------- /assets/background/bg11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg11.png -------------------------------------------------------------------------------- /assets/background/bg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg2.png -------------------------------------------------------------------------------- /assets/background/bg3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg3.png -------------------------------------------------------------------------------- /assets/background/bg4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg4.png -------------------------------------------------------------------------------- /assets/background/bg5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg5.png -------------------------------------------------------------------------------- /assets/background/bg6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg6.png -------------------------------------------------------------------------------- /assets/background/bg7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg7.jpg -------------------------------------------------------------------------------- /assets/background/bg8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg8.png -------------------------------------------------------------------------------- /assets/background/bg9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/assets/background/bg9.png -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/android/app/src/main/res/mipmap-xhdpi/logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/yotaku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/android/app/src/main/res/mipmap-xhdpi/yotaku.png -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/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/creatint/light/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/creatint/light/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/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/creatint/light/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/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/creatint/light/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | .idea 4 | .vscode/ 5 | 6 | .packages 7 | .pub/ 8 | 9 | build/ 10 | 11 | .flutter-plugins 12 | 13 | *.log 14 | 15 | test/styles.json 16 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatint/light/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/creatint/light/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/models/section.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart' show required; 2 | 3 | class Section { 4 | Section({@required this.title, @required this.content}); 5 | 6 | final String title; 7 | final String content; 8 | } 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'pages/app.dart'; 3 | import 'utils/initial.dart'; 4 | 5 | void main() async { 6 | /// initialize the app 7 | await initial(); 8 | 9 | /// run the app 10 | runApp(new App()); 11 | } 12 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /.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: 12bbaba9ae044d0ea77da4dd5e4db15eed403f09 8 | channel: beta 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /lib/models/chapter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart' show required; 2 | 3 | class Chapter { 4 | Chapter({@required this.title, @required this.offset, @required this.length}); 5 | 6 | final String title; 7 | final int offset; 8 | final int length; 9 | 10 | Chapter.fromJson(Map value) 11 | : title = value['title'] as String, 12 | offset = value['offset'] as int, 13 | length = value['length'] as int; 14 | } 15 | -------------------------------------------------------------------------------- /android/app/src/main/java/cn/yotaku/light/MainActivity.java: -------------------------------------------------------------------------------- 1 | package cn.yotaku.light; 2 | 3 | import android.os.Bundle; 4 | 5 | import io.flutter.app.FlutterActivity; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | GeneratedPluginRegistrant.registerWith(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 7 | [GeneratedPluginRegistrant registerWithRegistry:self]; 8 | // Override point for customization after application launch. 9 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_launcher_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 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.0.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /lib/pages/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../widgets/drawer.dart'; 3 | import 'shelf.dart'; 4 | 5 | class Home extends StatefulWidget { 6 | @override 7 | _HomeState createState() => new _HomeState(); 8 | } 9 | 10 | class _HomeState extends State { 11 | final GlobalKey scaffoldKey = new GlobalKey(); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return new Scaffold( 16 | key: scaffoldKey, 17 | drawer: new MyDrawer(), 18 | body: new Shelf( 19 | scaffoldKey: scaffoldKey, 20 | )); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | -------------------------------------------------------------------------------- /light.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/pages/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'home.dart'; 3 | import 'import_local.dart'; 4 | import 'search.dart'; 5 | 6 | class App extends StatefulWidget { 7 | @override 8 | _AppState createState() => new _AppState(); 9 | } 10 | 11 | class _AppState extends State { 12 | 13 | /// initial app 14 | @override 15 | void initState() { 16 | super.initState(); 17 | 18 | } 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return new MaterialApp( 23 | home: new Home(), 24 | routes: { 25 | 'importLocal': (BuildContext context) => new ImportLocal(), 26 | 'search': (BuildContext context) => new Search(), 27 | }, 28 | ); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 8 | 11 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib/utils/constants.dart: -------------------------------------------------------------------------------- 1 | const test_key = 'test'; 2 | /// the directory name of thie app 3 | const app_path = 'Yotaku'; 4 | 5 | /// the key used to store books in prefs 6 | const books_key = 'books'; 7 | 8 | /// the key used to store progress of reading 9 | const books_progress = 'bookProgress'; 10 | 11 | /// the key used to store styles 12 | const styles_key = 'styles'; 13 | 14 | /// id of selected style 15 | const style_current_id = 'styleCurrentId'; 16 | 17 | /// text styles 18 | const font_size = 'fontSize'; 19 | const font_weight = 'fontWeight'; 20 | const line_height = 'lineHeight'; 21 | const font_family = 'fontFamily'; 22 | const text_direction = 'textDirection'; 23 | const text_align = 'textAlign'; 24 | 25 | /// the suffix used to store paging data 26 | const paging_data_suffix = '_paging'; 27 | 28 | 29 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | UIRequiredDeviceCapabilities 24 | 25 | arm64 26 | 27 | MinimumOSVersion 28 | 8.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /lib/widgets/link_text_span.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/gestures.dart'; 3 | import 'package:url_launcher/url_launcher.dart'; 4 | 5 | class LinkTextSpan extends TextSpan { 6 | 7 | // Beware! 8 | // 9 | // This class is only safe because the TapGestureRecognizer is not 10 | // given a deadline and therefore never allocates any resources. 11 | // 12 | // In any other situation -- setting a deadline, using any of the less trivial 13 | // recognizers, etc -- you would have to manage the gesture recognizer's 14 | // lifetime and call dispose() when the TextSpan was no longer being rendered. 15 | // 16 | // Since TextSpan itself is @immutable, this means that you would have to 17 | // manage the recognizer from outside the TextSpan, e.g. in the State of a 18 | // stateful widget that then hands the recognizer to the TextSpan. 19 | 20 | LinkTextSpan({ TextStyle style, String url, String text }) : super( 21 | style: style, 22 | text: text ?? url, 23 | recognizer: new TapGestureRecognizer()..onTap = () { 24 | launch(url); 25 | } 26 | ); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/search.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Search extends StatefulWidget { 4 | @override 5 | _SearchState createState() => _SearchState(); 6 | } 7 | 8 | class _SearchState extends State { 9 | final TextEditingController controller = new TextEditingController(); 10 | 11 | void handleSubmit(String text) { 12 | print('handleSubmit'); 13 | } 14 | 15 | void handleChange(String text) { 16 | print('handleChange'); 17 | } 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return new Scaffold( 22 | appBar: new AppBar( 23 | title: new TextField( 24 | controller: controller, 25 | style: new TextStyle(color: Colors.white70, fontSize: 18.0), 26 | onSubmitted: handleSubmit, 27 | onChanged: handleChange, 28 | decoration: new InputDecoration( 29 | hintText: 'Search books', 30 | hintStyle: new TextStyle(color: Colors.white30), 31 | border: InputBorder.none 32 | ), 33 | ), 34 | ), 35 | body: new Center( 36 | child: new Text('search'), 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /README-zh.md: -------------------------------------------------------------------------------- 1 | # 📖 Light 2 | 3 | ![Light logo](https://user-images.githubusercontent.com/17924777/39092072-762deace-4636-11e8-8acd-447a03c7556e.png) 4 | 5 | Light是一个用Flutter构建的轻小说阅读器,欢迎star fork,期待你的建议。( •̀ ω •́ )✧ 6 | 7 | ## 功能 8 | 9 | - [x] 本地资源导入 10 | - [ ] EPub解析 11 | - [ ] Utf-8解析 12 | - [ ] Gb2312解析 13 | - [ ] Latin-1解析 14 | - [ ] 文字样式设置 15 | - [ ] 背景、颜色设置 16 | - [ ] 白天、黑夜模式 17 | - [ ] 书架搜索 18 | - [ ] 在线资源 19 | - [ ] 在线搜索 20 | - [ ] Wifi导入 21 | - [ ] 广告功能 22 | - [ ] 用户系统 23 | - [ ] 好友聊天 24 | - [ ] 资源分享 25 | - [ ] 有声阅读 26 | - [ ] 云端同步 27 | 28 | ## 安装 29 | ``` 30 | git clone https://github.com/creatint/light 31 | flutter packages get 32 | flutter run 33 | flutter build apk --release 34 | ``` 35 | 本项目基于Flutter构建,了解Flutter请访问[flutter.io](https://flutter.io/)。 36 | 37 | ## Flutter API 38 | [Flutter API docs](https://docs.flutter.io/) 39 | 40 | [Flutter中文文档](https://docs.flutter.kim/) 41 | 42 | ## 联系我 43 | Email:creatint@163.com 44 | 45 | QQ:565864175 46 | 47 | 编程交流群:[![编程技术交流](https://pub.idqqimg.com/wpa/images/group.png)](//shang.qq.com/wpa/qunwpa?idkey=b34e5d3956950dc053efdd7aef63ef75151c01cfff48a951c8fc53d6349b454a) 48 | 49 | 二次元交流群:[![Yotaku](https://pub.idqqimg.com/wpa/images/group.png)](//shang.qq.com/wpa/qunwpa?idkey=2fea46b70c9a73fcbfedd08ee64ed9d6d8c554baa63dc2402082226675e825e7) 50 | 51 | 52 | ## 许可证 53 | 采用GPL-3.0许可证,查看详情[LICENSE](https://github.com/creatint/light/blob/master/LICENSE) file. 54 | -------------------------------------------------------------------------------- /light_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/widgets/text_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TextIndicator extends StatefulWidget { 4 | @override 5 | _TextIndicatorState createState() => new _TextIndicatorState(); 6 | } 7 | 8 | class _TextIndicatorState extends State 9 | with TickerProviderStateMixin { 10 | Animation animation; 11 | AnimationController controller; 12 | 13 | Widget childBuilder(int value) { 14 | String text = '加载中'; 15 | for (int i = 0; i < value; i++) { 16 | text += '.'; 17 | } 18 | return new Text(text, 19 | style: new TextStyle(color: Colors.white70, fontSize: 20.0)); 20 | } 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | controller = new AnimationController( 26 | vsync: this, duration: const Duration(seconds: 2)); 27 | animation = new StepTween(begin: 0, end: 4).animate(controller) 28 | .. addStatusListener((status){ 29 | if (status == AnimationStatus.completed) { 30 | controller.reset(); 31 | controller.forward(); 32 | } 33 | }); 34 | controller.forward(); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return new AnimatedBuilder( 40 | animation: animation, 41 | builder: (BuildContext context, _) { 42 | return childBuilder(animation.value); 43 | }); 44 | } 45 | 46 | @override 47 | void dispose() { 48 | controller.dispose(); 49 | super.dispose(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 📖 Light 2 | 3 | ![Light logo](https://user-images.githubusercontent.com/17924777/39092072-762deace-4636-11e8-8acd-447a03c7556e.png) 4 | 5 | Light is a light novel e-reader build with Flutter, welcome star and fork, expect your advices 。( •̀ ω •́ )✧ 6 | 7 | [中文版](README-zh.md) 8 | 9 | ## Features 10 | 11 | - [x] Import local books 12 | - [ ] Suport utf-8 13 | - [ ] Suport latin-1 14 | - [ ] Suport ePub 15 | - [ ] Suport gb2312 16 | - [ ] Text style 17 | - [ ] Multi themes 18 | - [ ] Day mode, night mode 19 | - [ ] Search in shelf 20 | - [ ] Online search 21 | - [ ] Import books by wifi 22 | - [ ] Advertisement 23 | - [ ] Friends chat 24 | - [ ] Share books 25 | - [ ] Text to speech 26 | - [ ] User system 27 | - [ ] Cloud 28 | 29 | ## Usage 30 | ``` 31 | git clone https://github.com/creatint/light 32 | flutter packages get 33 | flutter run 34 | flutter build apk --release 35 | ``` 36 | For help getting started with Flutter, view our online 37 | [documentation](https://flutter.io/). 38 | 39 | ## Flutter API 40 | [Flutter API docs](https://docs.flutter.io/) 41 | 42 | [Flutter中文文档](https://docs.flutter.kim/) 43 | 44 | 45 | ## Contact 46 | Email: creatint@163.com 47 | 48 | QQ: 565864175 49 | 50 | QQ Group for coding: [![](https://pub.idqqimg.com/wpa/images/group.png)](//shang.qq.com/wpa/qunwpa?idkey=b34e5d3956950dc053efdd7aef63ef75151c01cfff48a951c8fc53d6349b454a) 51 | 52 | QQ Group for ACGN: [![Yotaku](https://pub.idqqimg.com/wpa/images/group.png)](//shang.qq.com/wpa/qunwpa?idkey=2fea46b70c9a73fcbfedd08ee64ed9d6d8c554baa63dc2402082226675e825e7) 53 | 54 | ## License 55 | Light is available under the GPL-3.0 license. See the [LICENSE](https://github.com/creatint/light/blob/master/LICENSE) file. 56 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 27 19 | 20 | lintOptions { 21 | disable 'InvalidPackage' 22 | } 23 | 24 | defaultConfig { 25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 26 | applicationId "cn.yotaku.light" 27 | minSdkVersion 16 28 | targetSdkVersion 27 29 | versionCode 1 30 | versionName "0.0.3" 31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 32 | } 33 | 34 | buildTypes { 35 | release { 36 | // TODO: Add your own signing config for the release build. 37 | // Signing with the debug keys for now, so `flutter run --release` works. 38 | signingConfig signingConfigs.debug 39 | } 40 | } 41 | } 42 | 43 | flutter { 44 | source '../..' 45 | } 46 | 47 | dependencies { 48 | testImplementation 'junit:junit:4.12' 49 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 51 | } 52 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | light 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | arm64 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/unit_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:convert'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:shared_preferences/shared_preferences.dart'; 6 | import 'package:light/utils/constants.dart'; 7 | import 'package:light/models/style.dart'; 8 | import 'package:light/services/system.dart'; 9 | import 'styles.dart'; 10 | 11 | void main() { 12 | group('Style', () { 13 | const MethodChannel channel = const MethodChannel( 14 | 'plugins.flutter.io/shared_preferences', 15 | ); 16 | 17 | const Map kTestValues = const { 18 | 'flutter.$test_key': null, 19 | }; 20 | 21 | final List log = []; 22 | SharedPreferences preferences; 23 | SystemService service; 24 | List