├── .gitignore ├── .idea ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── kotlinc.xml ├── libraries │ ├── Dart_Packages.xml │ ├── Dart_SDK.xml │ ├── Flutter_Plugins.xml │ └── KotlinJavaRuntime.xml ├── misc.xml ├── modules.xml ├── runConfigurations │ └── main_dart.xml └── workspace.xml ├── .metadata ├── README.md ├── Screenshot ├── Screenshot_2018-07-09-09-33-55-835_app.efs.flutterapp.png ├── Screenshot_2018-07-09-09-34-15-080_app.efs.flutterapp.png └── Screenshot_2018-07-09-09-34-32-553_app.efs.flutterapp.png ├── android ├── .gitignore ├── .idea │ ├── caches │ │ └── build_file_checksums.ser │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ └── runConfigurations.xml ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── app │ │ │ └── efs │ │ │ └── flutterapp │ │ │ ├── DetailsActivity.kt │ │ │ └── MainActivity.java │ │ └── res │ │ ├── drawable │ │ ├── ic_launcher.png │ │ ├── icon_splash.jpg │ │ └── launch_background.xml │ │ ├── layout │ │ └── activity_details.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── icon_return_top.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── icon_return_top.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── icon_return_top.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── color.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── flutter_app.iml ├── flutter_app_android.iml ├── flutter_plugin ├── .gitignore ├── .idea │ ├── libraries │ │ ├── Dart_SDK.xml │ │ └── Flutter_for_Android.xml │ ├── modules.xml │ ├── runConfigurations │ │ └── example_lib_main_dart.xml │ └── workspace.xml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── flutter │ │ │ └── plugins │ │ │ └── GeneratedPluginRegistrant.java │ ├── build.gradle │ ├── gradle.properties │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ └── app │ │ └── efs │ │ └── flutterplugin │ │ ├── FlutterPlugin.kt │ │ └── RouterPlugin.kt ├── flutter_plugin_android.iml ├── ios │ ├── .gitignore │ ├── Assets │ │ └── .gitkeep │ ├── Classes │ │ ├── FlutterPlugin.h │ │ └── FlutterPlugin.m │ └── flutter_plugin.podspec ├── lib │ ├── flutter_plugin.dart │ └── router_plugin.dart └── pubspec.yaml ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── 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-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── main.m ├── lib ├── DetailsActivity.dart ├── FirstActivity.dart ├── HomeActivity.dart ├── TabScreen.dart ├── entity.dart ├── generated │ └── i18n.dart ├── image │ └── icon_splash.jpg ├── main.dart └── values.dart ├── pubspec.lock ├── pubspec.yaml ├── res └── values │ └── strings_en.arb └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | *.iml 11 | .gradle 12 | /local.properties 13 | /.idea 14 | /captures 15 | .externalNativeBuild 16 | 17 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_Packages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/KotlinJavaRuntime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations/main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 117 | 118 | 119 | 120 | dependencies 121 | titleImage 122 | fetchList 123 | print 124 | 125 | 126 | 127 | 128 | 129 | $PROJECT_DIR$/flutter_plugin 130 | 131 | 132 | 133 | 161 | 162 | 163 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 265 | 266 | 267 | 268 | 281 | 282 | 283 | 284 | 286 | 287 | 303 | 308 | 309 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 1530523085278 320 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 368 | 369 | 370 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 694 | 695 | 696 | 697 | 698 | 699 | Detection 700 | 701 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 717 | 718 | 719 | 720 | 721 | 722 | 1.8 723 | 724 | 729 | 730 | 731 | 732 | 733 | 734 | flutter_app_android 735 | 736 | 741 | 742 | 743 | 744 | 745 | 746 | KotlinJavaRuntime 747 | 748 | 753 | 754 | 755 | 756 | 757 | 758 | -------------------------------------------------------------------------------- /.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: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b 8 | channel: beta 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FlutterAndKotlinDemo 2 | Demo developed with flutter kotlin and java 3 | 4 | --- 5 | 使用Flutter开发的一个demo,对于纯flutter的开发,我更倾向于使用flutter与原生混合使用的方式(目前2018年07月09日来说这种方式对于老项目,硬件相关的项目友好)。 6 | 7 | Demo中演示了Flutter的使用,和如何在Flutter中调用Java、Kotlin Activity的问题,调用方式是通过`MethodChannel`不熟悉的可以[看这里](http://doc.flutter-dev.cn/platform-channels/),`MethodChannel`可以完成Native端和Flutter的相互调用,可以完成。至于使用kotlin调用Flutter Widget(单独的一个界面)可以仿照项目中调用activity的方式扩展插件。 8 | 9 | 由于目前flutter还没有办法直接加载html代码。所以直接在详情页调用了webview插件,可以看到flutter的界面右上角有个debug字样,原生activity则没有 10 | 11 | ---- 12 | 使用flutter module方式: 13 | 14 | 这种方式应该是官方比较推荐的方式,通过Flutter module中的flutter模块,本质上还是通过MethodChannel进行调用的。 15 | 16 | 具体是通过一个`FlutterView`来达到目的的,`FlutterView`可以看做是Android端的一个View,只不过里面包含的是Flutter的内容 17 | ``` 18 | fab.setOnClickListener(new View.OnClickListener() { 19 | @Override 20 | public void onClick(View view) { 21 | View flutterView = Flutter.createView( 22 | MainActivity.this, 23 | getLifecycle(), 24 | "route1" 25 | ); 26 | FrameLayout.LayoutParams layout = new FrameLayout.LayoutParams(600, 800); 27 | layout.leftMargin = 100; 28 | layout.topMargin = 200; 29 | addContentView(flutterView, layout); 30 | } 31 | }); 32 | ``` 33 | 详细的使用方式可以[看这里](https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps) 34 | 35 | 36 | 这个调用是异步的,目前看,Native端调用Flutter层效果并不是很理想。个人测试没有直接调用activity效果好 37 | 38 | 39 | 这个方案目前处于preview阶段,等beta版出现之后在看看具体效果。 40 | 41 | --- 42 | 43 | 下面分别是首页、Flutter的详情页、原生Activity 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Screenshot/Screenshot_2018-07-09-09-33-55-835_app.efs.flutterapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/Screenshot/Screenshot_2018-07-09-09-33-55-835_app.efs.flutterapp.png -------------------------------------------------------------------------------- /Screenshot/Screenshot_2018-07-09-09-34-15-080_app.efs.flutterapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/Screenshot/Screenshot_2018-07-09-09-34-15-080_app.efs.flutterapp.png -------------------------------------------------------------------------------- /Screenshot/Screenshot_2018-07-09-09-34-32-553_app.efs.flutterapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/Screenshot/Screenshot_2018-07-09-09-34-32-553_app.efs.flutterapp.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 | -------------------------------------------------------------------------------- /android/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /android/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /android/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | -------------------------------------------------------------------------------- /android/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /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 plugin: 'kotlin-android' 16 | apply plugin: 'kotlin-android-extensions' 17 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 18 | 19 | android { 20 | compileSdkVersion 27 21 | lintOptions { 22 | disable 'InvalidPackage' 23 | } 24 | defaultConfig { 25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 26 | applicationId "app.efs.flutterapp" 27 | minSdkVersion 16 28 | targetSdkVersion 27 29 | versionCode 1 30 | versionName "1.0" 31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 32 | } 33 | buildTypes { 34 | release { 35 | // TODO: Add your own signing config for the release build. 36 | // Signing with the debug keys for now, so `flutter run --release` works. 37 | signingConfig signingConfigs.debug 38 | } 39 | } 40 | } 41 | 42 | flutter { 43 | source '../..' 44 | } 45 | 46 | dependencies { 47 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 48 | implementation 'com.android.support:appcompat-v7:27.1.1' 49 | } 50 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /android/app/src/main/java/app/efs/flutterapp/DetailsActivity.kt: -------------------------------------------------------------------------------- 1 | package app.efs.flutterapp 2 | 3 | import android.os.Build 4 | import android.os.Bundle 5 | import android.support.v7.app.AppCompatActivity 6 | import android.view.View 7 | import android.webkit.WebChromeClient 8 | import android.webkit.WebSettings 9 | import android.webkit.WebView 10 | import android.webkit.WebViewClient 11 | import kotlinx.android.synthetic.main.activity_details.* 12 | 13 | /** 14 | * Created by ZhaoShulin on 2018/7/7 下午2:40. 15 | *
16 | * Desc: 17 | *
18 | */ 19 | class DetailsActivity : AppCompatActivity() { 20 | 21 | private val title by lazy { 22 | intent.getStringExtra("title") 23 | } 24 | private val slgn by lazy { 25 | intent.getStringExtra("slug") 26 | } 27 | 28 | fun getDetailWebUrl(slug: String): String { 29 | return "https://zhuanlan.zhihu.com/p/$slug" 30 | } 31 | 32 | override fun onCreate(savedInstanceState: Bundle?) { 33 | super.onCreate(savedInstanceState) 34 | setContentView(R.layout.activity_details) 35 | initToolsBar() 36 | web_view.apply { 37 | isVerticalScrollBarEnabled = false 38 | isHorizontalScrollBarEnabled = false 39 | webViewClient = WebViewClient() 40 | webChromeClient = object : WebChromeClient() { 41 | override fun onProgressChanged(view: WebView?, newProgress: Int) { 42 | if (newProgress == 100) { 43 | pb_webview.visibility = View.GONE 44 | } else { 45 | pb_webview.visibility = View.VISIBLE 46 | pb_webview.progress = newProgress 47 | } 48 | } 49 | } 50 | settings.javaScriptEnabled = true 51 | settings.blockNetworkImage = false 52 | settings.loadsImagesAutomatically = true 53 | settings.domStorageEnabled = true 54 | settings.allowFileAccess = true 55 | settings.defaultTextEncodingName = "UTF-8" 56 | settings.cacheMode = WebSettings.LOAD_NO_CACHE 57 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 58 | settings.mixedContentMode = android.webkit.WebSettings.MIXED_CONTENT_ALWAYS_ALLOW 59 | } 60 | } 61 | web_view.loadUrl(getDetailWebUrl(slgn)) 62 | } 63 | 64 | private fun initToolsBar() { 65 | setSupportActionBar(toolbar) 66 | supportActionBar?.title = title 67 | toolbar.setNavigationOnClickListener { onBackPressed() } 68 | } 69 | } -------------------------------------------------------------------------------- /android/app/src/main/java/app/efs/flutterapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package app.efs.flutterapp; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/icon_splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/drawable/icon_splash.jpg -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/activity_details.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | 23 | 24 | 28 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/icon_return_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/mipmap-hdpi/icon_return_top.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/icon_return_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/mipmap-xhdpi/icon_return_top.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/icon_return_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/mipmap-xxhdpi/icon_return_top.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #2096f3 4 | #0d62a5 5 | #18cece 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 17 | 18 | 24 | 25 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.1.51' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.0.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jul 07 20:19:23 CST 2018 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.8-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /flutter_app.iml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /flutter_app_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /flutter_plugin/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | pubspec.lock 7 | 8 | build/ 9 | -------------------------------------------------------------------------------- /flutter_plugin/.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /flutter_plugin/.idea/libraries/Flutter_for_Android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /flutter_plugin/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /flutter_plugin/.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /flutter_plugin/.idea/workspace.xml: -------------------------------------------------------------------------------- 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 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /flutter_plugin/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /flutter_plugin/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /flutter_plugin/README.md: -------------------------------------------------------------------------------- 1 | # flutter_plugin 2 | 3 | A new Flutter plugin. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](https://flutter.io/). 9 | 10 | For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code). -------------------------------------------------------------------------------- /flutter_plugin/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /flutter_plugin/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import io.flutter.plugin.common.PluginRegistry; 4 | import app.efs.flutterplugin.RouterPlugin; 5 | 6 | /** 7 | * Generated file. Do not edit. 8 | */ 9 | public final class GeneratedPluginRegistrant { 10 | public static void registerWith(PluginRegistry registry) { 11 | if (alreadyRegisteredWith(registry)) { 12 | return; 13 | } 14 | RouterPlugin.registerWith(registry.registrarFor("app.efs.flutterplugin.RouterPlugin")); 15 | } 16 | 17 | private static boolean alreadyRegisteredWith(PluginRegistry registry) { 18 | final String key = GeneratedPluginRegistrant.class.getCanonicalName(); 19 | if (registry.hasPlugin(key)) { 20 | return true; 21 | } 22 | registry.registrarFor(key); 23 | return false; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /flutter_plugin/android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'app.efs.flutterplugin' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.1.51' 6 | repositories { 7 | google() 8 | jcenter() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.0.1' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'kotlin-android' 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | sourceSets { 31 | main.java.srcDirs += 'src/main/kotlin' 32 | } 33 | defaultConfig { 34 | minSdkVersion 16 35 | } 36 | lintOptions { 37 | disable 'InvalidPackage' 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 43 | implementation 'com.google.code.gson:gson:2.8.5' 44 | } 45 | -------------------------------------------------------------------------------- /flutter_plugin/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /flutter_plugin/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'flutter_plugin' 2 | -------------------------------------------------------------------------------- /flutter_plugin/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /flutter_plugin/android/src/main/kotlin/app/efs/flutterplugin/FlutterPlugin.kt: -------------------------------------------------------------------------------- 1 | package app.efs.flutterplugin 2 | 3 | import io.flutter.plugin.common.MethodChannel 4 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 5 | import io.flutter.plugin.common.MethodChannel.Result 6 | import io.flutter.plugin.common.MethodCall 7 | import io.flutter.plugin.common.PluginRegistry.Registrar 8 | 9 | class FlutterPlugin(): MethodCallHandler { 10 | companion object { 11 | @JvmStatic 12 | fun registerWith(registrar: Registrar): Unit { 13 | val channel = MethodChannel(registrar.messenger(), "flutter_plugin") 14 | channel.setMethodCallHandler(FlutterPlugin()) 15 | } 16 | } 17 | 18 | override fun onMethodCall(call: MethodCall, result: Result): Unit { 19 | if (call.method.equals("getPlatformVersion")) { 20 | result.success("Android ${android.os.Build.VERSION.RELEASE}") 21 | } else { 22 | result.notImplemented() 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /flutter_plugin/android/src/main/kotlin/app/efs/flutterplugin/RouterPlugin.kt: -------------------------------------------------------------------------------- 1 | package app.efs.flutterplugin 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.os.Parcelable 7 | import android.util.Log 8 | import com.google.gson.Gson 9 | import io.flutter.plugin.common.MethodChannel 10 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 11 | import io.flutter.plugin.common.MethodChannel.Result 12 | import io.flutter.plugin.common.MethodCall 13 | import io.flutter.plugin.common.PluginRegistry 14 | import io.flutter.plugin.common.PluginRegistry.Registrar 15 | 16 | class RouterPlugin private constructor(private val registrar: Registrar) : MethodCallHandler, PluginRegistry.ActivityResultListener { 17 | 18 | companion object { 19 | 20 | @JvmStatic 21 | private val TAG = RouterPlugin::class.java.simpleName 22 | 23 | @JvmStatic 24 | fun registerWith(registrar: Registrar) { 25 | val instance = RouterPlugin(registrar) 26 | val channel = MethodChannel(registrar.messenger(), "router_plugin") 27 | registrar.addActivityResultListener(instance) 28 | channel.setMethodCallHandler(instance) 29 | } 30 | 31 | } 32 | 33 | private var methodCall: MethodCall? = null 34 | private var pendingResult: Result? = null 35 | private var requestCode: Int = 0 36 | 37 | override fun onMethodCall(call: MethodCall, result: Result) { 38 | if (this.pendingResult != null) { 39 | Log.e(TAG, "RouterPlugin is already active.") 40 | return 41 | } 42 | val activity = registrar.activity() 43 | if (activity == null) { 44 | Log.e(TAG, "RouterPlugin requires a foreground activity.") 45 | return 46 | } 47 | this.methodCall = call 48 | this.pendingResult = result 49 | val activityClassName = if (!call.hasArgument("activity")) null else call.argument("activity") 50 | if (activityClassName.isNullOrEmpty()) { 51 | Log.e(TAG, "RouterPlugin requires a activity class name.") 52 | return 53 | } 54 | val arguments = if (!call.hasArgument("arguments")) null else call.argument?>("arguments") 55 | when (call.method) { 56 | "startActivity" -> { 57 | activity.startActivity(getActivityIntent(activity, activityClassName!!, arguments)) 58 | result.success(null) 59 | this.methodCall = null 60 | this.pendingResult = null 61 | } 62 | "startActivityForResult" -> { 63 | val requestCode = if (!call.hasArgument("requestCode")) -1 else call.argument("requestCode") 64 | if (requestCode == -1) { 65 | Log.e(TAG, "RequestCode cannot be null") 66 | return 67 | } 68 | this.requestCode = requestCode 69 | activity.startActivityForResult(getActivityIntent(activity, activityClassName!!, arguments), requestCode) 70 | } 71 | } 72 | } 73 | 74 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean { 75 | if (requestCode == this.requestCode) { 76 | if (resultCode == Activity.RESULT_OK) { 77 | val ret: MutableMap = mutableMapOf() 78 | data?.extras?.keySet()?.forEach { 79 | ret[it] = data.extras[it] 80 | } 81 | println("---------->信息:$ret") 82 | this.pendingResult?.success(if (ret.isEmpty()) null else ret) 83 | } 84 | this.methodCall = null 85 | this.pendingResult = null 86 | this.requestCode = 0 87 | return true 88 | } 89 | return false 90 | } 91 | 92 | private fun getActivityIntent(context: Context, activityClassName: String, params: Map? = null): Intent { 93 | val intent = Intent(context, Class.forName(activityClassName)) 94 | with(intent) { 95 | params?.apply { 96 | for (entry in this.entries) { 97 | val key = entry.key 98 | when (entry.value) { 99 | is Char -> putExtra(key, entry.value as Char) 100 | is Short -> putExtra(key, entry.value as Short) 101 | is Int -> putExtra(key, entry.value as Int) 102 | is Long -> putExtra(key, entry.value as Long) 103 | is Float -> putExtra(key, entry.value as Float) 104 | is Double -> putExtra(key, entry.value as Double) 105 | is Boolean -> putExtra(key, entry.value as Boolean) 106 | is String -> putExtra(key, entry.value as String) 107 | is CharArray -> putExtra(key, entry.value as CharArray) 108 | is ShortArray -> putExtra(key, entry.value as ShortArray) 109 | is IntArray -> putExtra(key, entry.value as IntArray) 110 | is LongArray -> putExtra(key, entry.value as LongArray) 111 | is FloatArray -> putExtra(key, entry.value as FloatArray) 112 | is DoubleArray -> putExtra(key, entry.value as DoubleArray) 113 | is BooleanArray -> putExtra(key, entry.value as BooleanArray) 114 | is Parcelable -> putExtra(key, entry.value as Parcelable) 115 | else -> putExtra(key, Gson().toJson(entry.value as String)) //复杂类型会被转换成JSON-String 116 | } 117 | 118 | } 119 | } 120 | 121 | 122 | } 123 | return intent 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /flutter_plugin/flutter_plugin_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /flutter_plugin/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/Generated.xcconfig 37 | -------------------------------------------------------------------------------- /flutter_plugin/ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/flutter_plugin/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /flutter_plugin/ios/Classes/FlutterPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface FlutterPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /flutter_plugin/ios/Classes/FlutterPlugin.m: -------------------------------------------------------------------------------- 1 | #import "FlutterPlugin.h" 2 | 3 | @implementation FlutterPlugin 4 | + (void)registerWithRegistrar:(NSObject*)registrar { 5 | FlutterMethodChannel* channel = [FlutterMethodChannel 6 | methodChannelWithName:@"flutter_plugin" 7 | binaryMessenger:[registrar messenger]]; 8 | FlutterPlugin* instance = [[FlutterPlugin alloc] init]; 9 | [registrar addMethodCallDelegate:instance channel:channel]; 10 | } 11 | 12 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 13 | if ([@"getPlatformVersion" isEqualToString:call.method]) { 14 | result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]); 15 | } else { 16 | result(FlutterMethodNotImplemented); 17 | } 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /flutter_plugin/ios/flutter_plugin.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'flutter_plugin' 6 | s.version = '0.0.1' 7 | s.summary = 'A new Flutter plugin.' 8 | s.description = <<-DESC 9 | A new Flutter plugin. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Your Company' => 'email@example.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | 19 | s.ios.deployment_target = '8.0' 20 | end 21 | 22 | -------------------------------------------------------------------------------- /flutter_plugin/lib/flutter_plugin.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/services.dart'; 4 | 5 | class FlutterPlugin { 6 | static const MethodChannel _channel = 7 | const MethodChannel('flutter_plugin'); 8 | 9 | static Future get platformVersion async { 10 | final String version = await _channel.invokeMethod('getPlatformVersion'); 11 | return version; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter_plugin/lib/router_plugin.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/services.dart'; 4 | 5 | class RouterPlugin { 6 | 7 | static const MethodChannel _channel = 8 | const MethodChannel('router_plugin'); 9 | 10 | static void startActivity(String activityClassName, 11 | [Map arguments]) => 12 | _channel.invokeMethod("startActivity", { 13 | "activity": activityClassName, 14 | "arguments": arguments 15 | }); 16 | 17 | static Future startActivityForResult(String activityClassName, int requestCode, 18 | [Map arguments]) => 19 | _channel.invokeMethod("startActivityForResult", { 20 | "activity": activityClassName, 21 | "requestCode": requestCode, 22 | "arguments": arguments 23 | }); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /flutter_plugin/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_plugin 2 | description: A new Flutter plugin. 3 | version: 0.0.1 4 | author: 5 | homepage: 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | 11 | # For information on the generic Dart part of this file, see the 12 | # following page: https://www.dartlang.org/tools/pub/pubspec 13 | 14 | # The following section is specific to Flutter. 15 | flutter: 16 | plugin: 17 | androidPackage: app.efs.flutterplugin 18 | # pluginClass: FlutterPlugin 19 | pluginClass: RouterPlugin 20 | # To add assets to your plugin package, add an assets section, like this: 21 | # assets: 22 | # - images/a_dot_burr.jpeg 23 | # - images/a_dot_ham.jpeg 24 | # 25 | # For details regarding assets in packages, see 26 | # https://flutter.io/assets-and-images/#from-packages 27 | # 28 | # An image asset can refer to one or more resolution-specific "variants", see 29 | # https://flutter.io/assets-and-images/#resolution-aware. 30 | 31 | # To add custom fonts to your plugin package, add a fonts section here, 32 | # in this "flutter" section. Each entry in this list should have a 33 | # "family" key with the font family name, and a "fonts" key with a 34 | # list giving the asset and other descriptors for the font. For 35 | # example: 36 | # fonts: 37 | # - family: Schyler 38 | # fonts: 39 | # - asset: fonts/Schyler-Regular.ttf 40 | # - asset: fonts/Schyler-Italic.ttf 41 | # style: italic 42 | # - family: Trajan Pro 43 | # fonts: 44 | # - asset: fonts/TrajanPro.ttf 45 | # - asset: fonts/TrajanPro_Bold.ttf 46 | # weight: 700 47 | # 48 | # For details regarding fonts in packages, see 49 | # https://flutter.io/custom-fonts/#from-packages 50 | -------------------------------------------------------------------------------- /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 | .symlinks/ 46 | -------------------------------------------------------------------------------- /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 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 2147483647; 30 | dstPath = ""; 31 | dstSubfolderSpec = 10; 32 | files = ( 33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 35 | ); 36 | name = "Embed Frameworks"; 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 44 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 67 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | /* End PBXFrameworksBuildPhase section */ 72 | 73 | /* Begin PBXGroup section */ 74 | 9740EEB11CF90186004384FC /* Flutter */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 78 | 3B80C3931E831B6300D905FE /* App.framework */, 79 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 80 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 81 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 82 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 83 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 84 | ); 85 | name = Flutter; 86 | sourceTree = ""; 87 | }; 88 | 97C146E51CF9000F007C117D = { 89 | isa = PBXGroup; 90 | children = ( 91 | 9740EEB11CF90186004384FC /* Flutter */, 92 | 97C146F01CF9000F007C117D /* Runner */, 93 | 97C146EF1CF9000F007C117D /* Products */, 94 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | 97C146EF1CF9000F007C117D /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 97C146EE1CF9000F007C117D /* Runner.app */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | 97C146F01CF9000F007C117D /* Runner */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 110 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 111 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 112 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 113 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 114 | 97C147021CF9000F007C117D /* Info.plist */, 115 | 97C146F11CF9000F007C117D /* Supporting Files */, 116 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 117 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 118 | ); 119 | path = Runner; 120 | sourceTree = ""; 121 | }; 122 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 97C146F21CF9000F007C117D /* main.m */, 126 | ); 127 | name = "Supporting Files"; 128 | sourceTree = ""; 129 | }; 130 | /* End PBXGroup section */ 131 | 132 | /* Begin PBXNativeTarget section */ 133 | 97C146ED1CF9000F007C117D /* Runner */ = { 134 | isa = PBXNativeTarget; 135 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 136 | buildPhases = ( 137 | 9740EEB61CF901F6004384FC /* Run Script */, 138 | 97C146EA1CF9000F007C117D /* Sources */, 139 | 97C146EB1CF9000F007C117D /* Frameworks */, 140 | 97C146EC1CF9000F007C117D /* Resources */, 141 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 142 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = Runner; 149 | productName = Runner; 150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 97C146E61CF9000F007C117D /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 0910; 160 | ORGANIZATIONNAME = "The Chromium Authors"; 161 | TargetAttributes = { 162 | 97C146ED1CF9000F007C117D = { 163 | CreatedOnToolsVersion = 7.3.1; 164 | }; 165 | }; 166 | }; 167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 168 | compatibilityVersion = "Xcode 3.2"; 169 | developmentRegion = English; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | Base, 174 | ); 175 | mainGroup = 97C146E51CF9000F007C117D; 176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | 97C146ED1CF9000F007C117D /* Runner */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | 97C146EC1CF9000F007C117D /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 191 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 193 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 194 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 195 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 196 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | /* End PBXResourcesBuildPhase section */ 201 | 202 | /* Begin PBXShellScriptBuildPhase section */ 203 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 204 | isa = PBXShellScriptBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | inputPaths = ( 209 | ); 210 | name = "Thin Binary"; 211 | outputPaths = ( 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | shellPath = /bin/sh; 215 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 216 | }; 217 | 9740EEB61CF901F6004384FC /* Run Script */ = { 218 | isa = PBXShellScriptBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | ); 222 | inputPaths = ( 223 | ); 224 | name = "Run Script"; 225 | outputPaths = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | shellPath = /bin/sh; 229 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 230 | }; 231 | /* End PBXShellScriptBuildPhase section */ 232 | 233 | /* Begin PBXSourcesBuildPhase section */ 234 | 97C146EA1CF9000F007C117D /* Sources */ = { 235 | isa = PBXSourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 239 | 97C146F31CF9000F007C117D /* main.m in Sources */, 240 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | /* End PBXSourcesBuildPhase section */ 245 | 246 | /* Begin PBXVariantGroup section */ 247 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 97C146FB1CF9000F007C117D /* Base */, 251 | ); 252 | name = Main.storyboard; 253 | sourceTree = ""; 254 | }; 255 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | 97C147001CF9000F007C117D /* Base */, 259 | ); 260 | name = LaunchScreen.storyboard; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXVariantGroup section */ 264 | 265 | /* Begin XCBuildConfiguration section */ 266 | 97C147031CF9000F007C117D /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 269 | buildSettings = { 270 | ALWAYS_SEARCH_USER_PATHS = NO; 271 | CLANG_ANALYZER_NONNULL = YES; 272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 273 | CLANG_CXX_LIBRARY = "libc++"; 274 | CLANG_ENABLE_MODULES = YES; 275 | CLANG_ENABLE_OBJC_ARC = YES; 276 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 277 | CLANG_WARN_BOOL_CONVERSION = YES; 278 | CLANG_WARN_COMMA = YES; 279 | CLANG_WARN_CONSTANT_CONVERSION = YES; 280 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 281 | CLANG_WARN_EMPTY_BODY = YES; 282 | CLANG_WARN_ENUM_CONVERSION = YES; 283 | CLANG_WARN_INFINITE_RECURSION = YES; 284 | CLANG_WARN_INT_CONVERSION = YES; 285 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 286 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 287 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 288 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 289 | CLANG_WARN_STRICT_PROTOTYPES = YES; 290 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 291 | CLANG_WARN_UNREACHABLE_CODE = YES; 292 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 293 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 294 | COPY_PHASE_STRIP = NO; 295 | DEBUG_INFORMATION_FORMAT = dwarf; 296 | ENABLE_STRICT_OBJC_MSGSEND = YES; 297 | ENABLE_TESTABILITY = YES; 298 | GCC_C_LANGUAGE_STANDARD = gnu99; 299 | GCC_DYNAMIC_NO_PIC = NO; 300 | GCC_NO_COMMON_BLOCKS = YES; 301 | GCC_OPTIMIZATION_LEVEL = 0; 302 | GCC_PREPROCESSOR_DEFINITIONS = ( 303 | "DEBUG=1", 304 | "$(inherited)", 305 | ); 306 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 307 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 308 | GCC_WARN_UNDECLARED_SELECTOR = YES; 309 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 310 | GCC_WARN_UNUSED_FUNCTION = YES; 311 | GCC_WARN_UNUSED_VARIABLE = YES; 312 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 313 | MTL_ENABLE_DEBUG_INFO = YES; 314 | ONLY_ACTIVE_ARCH = YES; 315 | SDKROOT = iphoneos; 316 | TARGETED_DEVICE_FAMILY = "1,2"; 317 | }; 318 | name = Debug; 319 | }; 320 | 97C147041CF9000F007C117D /* Release */ = { 321 | isa = XCBuildConfiguration; 322 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | CLANG_ANALYZER_NONNULL = YES; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_MODULES = YES; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_COMMA = YES; 333 | CLANG_WARN_CONSTANT_CONVERSION = YES; 334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 335 | CLANG_WARN_EMPTY_BODY = YES; 336 | CLANG_WARN_ENUM_CONVERSION = YES; 337 | CLANG_WARN_INFINITE_RECURSION = YES; 338 | CLANG_WARN_INT_CONVERSION = YES; 339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 343 | CLANG_WARN_STRICT_PROTOTYPES = YES; 344 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 350 | ENABLE_NS_ASSERTIONS = NO; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_NO_COMMON_BLOCKS = YES; 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 361 | MTL_ENABLE_DEBUG_INFO = NO; 362 | SDKROOT = iphoneos; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | VALIDATE_PRODUCT = YES; 365 | }; 366 | name = Release; 367 | }; 368 | 97C147061CF9000F007C117D /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 371 | buildSettings = { 372 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 373 | CURRENT_PROJECT_VERSION = 1; 374 | ENABLE_BITCODE = NO; 375 | FRAMEWORK_SEARCH_PATHS = ( 376 | "$(inherited)", 377 | "$(PROJECT_DIR)/Flutter", 378 | ); 379 | INFOPLIST_FILE = Runner/Info.plist; 380 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 381 | LIBRARY_SEARCH_PATHS = ( 382 | "$(inherited)", 383 | "$(PROJECT_DIR)/Flutter", 384 | ); 385 | PRODUCT_BUNDLE_IDENTIFIER = app.efs.flutterApp; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | VERSIONING_SYSTEM = "apple-generic"; 388 | }; 389 | name = Debug; 390 | }; 391 | 97C147071CF9000F007C117D /* Release */ = { 392 | isa = XCBuildConfiguration; 393 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 394 | buildSettings = { 395 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 396 | CURRENT_PROJECT_VERSION = 1; 397 | ENABLE_BITCODE = NO; 398 | FRAMEWORK_SEARCH_PATHS = ( 399 | "$(inherited)", 400 | "$(PROJECT_DIR)/Flutter", 401 | ); 402 | INFOPLIST_FILE = Runner/Info.plist; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 404 | LIBRARY_SEARCH_PATHS = ( 405 | "$(inherited)", 406 | "$(PROJECT_DIR)/Flutter", 407 | ); 408 | PRODUCT_BUNDLE_IDENTIFIER = app.efs.flutterApp; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | VERSIONING_SYSTEM = "apple-generic"; 411 | }; 412 | name = Release; 413 | }; 414 | /* End XCBuildConfiguration section */ 415 | 416 | /* Begin XCConfigurationList section */ 417 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 418 | isa = XCConfigurationList; 419 | buildConfigurations = ( 420 | 97C147031CF9000F007C117D /* Debug */, 421 | 97C147041CF9000F007C117D /* Release */, 422 | ); 423 | defaultConfigurationIsVisible = 0; 424 | defaultConfigurationName = Release; 425 | }; 426 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 427 | isa = XCConfigurationList; 428 | buildConfigurations = ( 429 | 97C147061CF9000F007C117D /* Debug */, 430 | 97C147071CF9000F007C117D /* Release */, 431 | ); 432 | defaultConfigurationIsVisible = 0; 433 | defaultConfigurationName = Release; 434 | }; 435 | /* End XCConfigurationList section */ 436 | }; 437 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 438 | } 439 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /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/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/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/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_app 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 | 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/DetailsActivity.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'entity.dart'; 3 | import 'dart:async'; 4 | import 'package:http/http.dart' as http; 5 | import 'values.dart'; 6 | import 'dart:convert'; 7 | import 'package:transparent_image/transparent_image.dart'; 8 | import 'package:temp_flutter_webview_plugin/flutter_webview_plugin.dart'; 9 | 10 | class DetailsActivity extends StatelessWidget { 11 | final String slug; 12 | final String title; 13 | final String titleImage; 14 | 15 | DetailsActivity(this.slug, this.title, this.titleImage); 16 | Widget boxAdapter(BuildContext context) { 17 | return new FutureBuilder( 18 | future: fetchDetail(slug), 19 | builder: (context, snapshot) { 20 | if (snapshot.hasData) { 21 | return new Center( 22 | child: new Padding( 23 | padding: new EdgeInsets.all(8.0), 24 | child: new RichText( 25 | text: new TextSpan( 26 | text: snapshot.data.content, 27 | style: DefaultTextStyle.of(context).style)), 28 | ), 29 | ); 30 | } else if (snapshot.hasError) { 31 | return new Center(child: new Text('${snapshot.error}')); 32 | } 33 | return new Center(child: new CircularProgressIndicator()); 34 | }); 35 | } 36 | 37 | Widget boxAdapterWebView(BuildContext context) { 38 | return new FutureBuilder( 39 | future: fetchDetail(slug), 40 | builder: (context, snapshot) { 41 | if (snapshot.hasData) { 42 | return new WebviewScaffold( 43 | url: new Uri.dataFromString(snapshot.data.content, 44 | mimeType: 'text/html') 45 | .toString()); 46 | } else if (snapshot.hasError) { 47 | return new Center(child: new Text('${snapshot.error}')); 48 | } 49 | return new Center(child: new CircularProgressIndicator()); 50 | }); 51 | } 52 | 53 | Future fetchDetail(slug) async { 54 | var res = await http.get(getDetailUrl(slug)); 55 | return DetailEntity.fromJson(json.decode(res.body)); 56 | } 57 | 58 | @override 59 | Widget build(BuildContext context) { 60 | 61 | 62 | 63 | return new Scaffold( 64 | body: new CustomScrollView( 65 | slivers: [ 66 | new SliverAppBar( 67 | pinned: true, 68 | expandedHeight: 180.0, 69 | flexibleSpace: new FlexibleSpaceBar( 70 | title: new Text( 71 | title, 72 | maxLines: 1, 73 | style: new TextStyle(fontSize: 15.0), 74 | ), 75 | background: new FadeInImage.memoryNetwork( 76 | placeholder: kTransparentImage, 77 | image: titleImage, 78 | height: 180.0, 79 | fit: BoxFit.cover, 80 | ), 81 | ), 82 | ), 83 | new SliverToBoxAdapter( 84 | // child: new WebviewScaffold(url: getDetailUrl(slug)) 85 | child: boxAdapter(context), 86 | ) 87 | ], 88 | )); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /lib/FirstActivity.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'values.dart'; 3 | import 'HomeActivity.dart'; 4 | 5 | class FirstActivity extends StatefulWidget { 6 | @override 7 | State createState() { 8 | return new FirstActivityState(); 9 | } 10 | } 11 | 12 | class FirstActivityState extends State 13 | with SingleTickerProviderStateMixin { 14 | // 动画 15 | Animation animation; 16 | 17 | // 动画管理器 18 | AnimationController controller; 19 | 20 | var animationStateListener; 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | //初始化动画管理器 26 | controller = new AnimationController( 27 | duration: const Duration(milliseconds: 3000), vsync: this); 28 | //初始化动画 29 | animation = new Tween(begin: 0.0, end: 1.0).animate(controller) 30 | ..addStatusListener((status) { 31 | if (status == AnimationStatus.completed) { 32 | //跳转 33 | Navigator.of(context).pushAndRemoveUntil( 34 | new MaterialPageRoute(builder: (context) => new HomeActivity()), 35 | (route) => route == null); 36 | } 37 | }); 38 | controller.forward(); 39 | } 40 | 41 | @override 42 | void dispose() { 43 | controller.dispose(); 44 | super.dispose(); 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | return new FadeTransition( 50 | opacity: animation, 51 | child: new Image.asset( 52 | SplashImage, 53 | fit: BoxFit.cover, 54 | )); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/HomeActivity.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'values.dart'; 3 | import 'TabScreen.dart'; 4 | 5 | class HomeActivity extends StatefulWidget { 6 | @override 7 | State createState() { 8 | return new _HomeState(); 9 | } 10 | } 11 | 12 | class _HomeState extends State with TickerProviderStateMixin { 13 | TabController controller; 14 | int tabIndex = 0; 15 | 16 | // var tabListener; 17 | 18 | @override 19 | void initState() { 20 | super.initState(); 21 | controller = new TabController(length: getTabLength(tabIndex), vsync: this); 22 | // tabListener = () {}; 23 | // controller.addListener(tabListener); 24 | } 25 | 26 | //侧边Drawer 27 | Widget drawer() { 28 | return new Column( 29 | children: [ 30 | new Container( 31 | color: Colors.blue, 32 | height: 160.0, 33 | child: new Center( 34 | child: new Text( 35 | HomeTitle, 36 | style: new TextStyle(color: Colors.white), 37 | )), 38 | ), 39 | new Expanded( 40 | child: new ListView.builder( 41 | itemCount: drawerTabs.length, 42 | itemBuilder: (context, index) => 43 | drawerListItem(context, index))) 44 | ], 45 | ); 46 | } 47 | 48 | /// Drawer ListView Item 49 | /// 如果只是简单的Item ListTitle是个不错的选择 50 | /// 点击之后有个SnackBar提示然后重新初始化Tab管理器 51 | /// 因为目前为止Tab管理器的length不能动态设置 52 | /// 关闭抽屉 Navigator.pop(context); 53 | Widget drawerListItem(context, index) { 54 | var text = drawerTabs[index]; 55 | return new ListTile( 56 | leading: new Icon(Icons.android), 57 | title: new Text(text, 58 | style: new TextStyle( 59 | color: tabIndex == index ? Colors.blue : Colors.black)), 60 | onTap: () { 61 | Navigator.pop(context); 62 | Scaffold 63 | .of(context) 64 | .showSnackBar(new SnackBar(content: new Text("开始加载$text"))); 65 | setState(() { 66 | // controller.removeListener(tabListener); 67 | controller = 68 | new TabController(length: getTabLength(index), vsync: this); 69 | // controller.addListener(tabListener); 70 | 71 | tabIndex = index; 72 | }); 73 | }, 74 | ); 75 | } 76 | 77 | @override 78 | void dispose() { 79 | controller.dispose(); 80 | super.dispose(); 81 | } 82 | 83 | //一个list 84 | List getList(index) { 85 | return getTabTitle(index).map((text) => new Tab(text: text)).toList(); 86 | } 87 | 88 | List getBodyView(index) { 89 | List tabList = getTabTitle(index); 90 | List tabViews = []; 91 | for (int i = 0; i < tabList.length; i++) { 92 | tabViews.add(new TabScreen(getTabSuffix(index, i))); 93 | } 94 | return tabViews; 95 | } 96 | 97 | @override 98 | Widget build(BuildContext context) { 99 | return new Scaffold( 100 | drawer: new Drawer( 101 | child: drawer(), 102 | ), 103 | appBar: new AppBar( 104 | title: new Text(drawerTabs[tabIndex]), 105 | bottom: new TabBar( 106 | tabs: getList(tabIndex), 107 | isScrollable: true, 108 | controller: controller, 109 | ), 110 | ), 111 | body: new TabBarView( 112 | children: getBodyView(tabIndex), controller: controller), 113 | ); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /lib/TabScreen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | 4 | import 'package:flutter/material.dart'; 5 | import 'package:http/http.dart' as http; 6 | import 'package:transparent_image/transparent_image.dart'; 7 | import 'package:temp_flutter_webview_plugin/flutter_webview_plugin.dart'; 8 | import 'entity.dart'; 9 | import 'values.dart'; 10 | import 'package:flutter_plugin/router_plugin.dart'; 11 | 12 | //类似于list_view的item 初始化之后不再改变所以使用less 13 | // ignore: non_abstract_class_inherits_abstract_member_one 14 | class TabScreen extends StatelessWidget { 15 | String suffix; 16 | 17 | //构造函数,表示第一个值传给suffix 18 | TabScreen(this.suffix); 19 | 20 | //使用inkwell点击效果 21 | Widget listItem(BuildContext context, int index, ListEntity info) { 22 | print(info.toString()); 23 | //卡片布局 24 | return new Card( 25 | child: new InkWell( 26 | onTap: () { 27 | //跳转页面 28 | // RouterPlugin.startActivity( 29 | // "app.efs.flutterapp.DetailsActivity"); 30 | if (index % 2 == 0) { 31 | Navigator.push( 32 | context, 33 | new MaterialPageRoute( 34 | builder: (context) => new WebviewScaffold( 35 | url: getDetailWebUrl(info.slug), 36 | appBar: new AppBar( 37 | title: new Text(info.title), 38 | ), 39 | ))); 40 | } else { 41 | Map map = { 42 | "title": info.title, 43 | "slug": info.slug.toString(), 44 | }; 45 | RouterPlugin.startActivity("app.efs.flutterapp.DetailsActivity", map); 46 | } 47 | }, 48 | //列表布局 49 | child: new Column( 50 | children: [ 51 | //图片内存 52 | new FadeInImage.memoryNetwork( 53 | placeholder: kTransparentImage, 54 | image: 55 | (info.titleImage).isEmpty ? defaultImageUrl : info.titleImage, 56 | height: 180.0, 57 | width: 1000.0, 58 | fit: BoxFit.cover), 59 | new Padding( 60 | //padding 61 | padding: new EdgeInsets.all(8.0), 62 | child: new Text(info.title), 63 | ) 64 | ], 65 | ), 66 | )); 67 | } 68 | 69 | /// 这里使用`FutureBuilder` 70 | /// 不得不说`Flutter`封装使用的非常方便,简单的就能实现不同情况下显示不同`widget` 71 | /// 默认是返回一个`loading`加载框,出现错误只是简单的显示一个`Text` 72 | /// 数据之后使用`ListView.Builder`构建出样式 73 | @override 74 | Widget build(BuildContext context) { 75 | return new Center( 76 | child: new FutureBuilder>( 77 | future: fetchList(suffix), 78 | builder: (context, snapshot) { 79 | if (snapshot.hasData) { 80 | return new ListView.builder( 81 | itemCount: snapshot.data.length, 82 | itemBuilder: (context, index) => 83 | listItem(context, index, snapshot.data[index])); 84 | } else if (snapshot.hasError) { 85 | return new Center(child: new Text('${snapshot.error}')); 86 | } 87 | return CircularProgressIndicator(); 88 | }), 89 | ); 90 | } 91 | 92 | Future> fetchList(String suffix) async { 93 | var response = await http.get(getListUrl(suffix)); 94 | return ListEntity.fromJson(json.decode(response.body)); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/entity.dart: -------------------------------------------------------------------------------- 1 | class ListEntity { 2 | String title; 3 | String titleImage; 4 | int slug; 5 | AuthorEntity authorEntity; 6 | 7 | ListEntity(this.title, this.titleImage, this.slug, this.authorEntity); 8 | 9 | // static List fromJson(List covariant) { 10 | //// List children = new List(); 11 | //// covariant.forEach((string){ 12 | //// ListEntity entity = new ListEntity(string['title'], string['titleImage'], 13 | //// string['slug'], new AuthorEntity.fromJson(string['author'])); 14 | //// children.add(entity); 15 | //// }); 16 | // 17 | // return covariant.map((string) => new ListEntity(title: string['title'], 18 | // titleImage: string['titleImage'], 19 | // slug: string['slug'], 20 | // author: new AuthorEntity.fromJson(string['author']))) 21 | // .toList(); 22 | // 23 | //// return children; 24 | // } 25 | static List fromJson(List json) { 26 | return json 27 | .map((string) => new ListEntity(string['title'], string['titleImage'], 28 | string['slug'], new AuthorEntity.fromJson(string['author']))) 29 | .toList(); 30 | } 31 | 32 | @override 33 | String toString() { 34 | return 'ListEntity{title: $title, titleImage: $titleImage, slug: $slug, authorEntity: $authorEntity}'; 35 | } 36 | } 37 | 38 | class AuthorEntity { 39 | String profileUrl; 40 | String bio; 41 | String name; 42 | 43 | AuthorEntity(this.profileUrl, this.bio, this.name); 44 | 45 | factory AuthorEntity.fromJson(Map json) { 46 | return new AuthorEntity( 47 | json['profileUrl'], 48 | json['bio'], 49 | json['name'], 50 | ); 51 | } 52 | } 53 | 54 | class DetailEntity { 55 | final String titleImage; 56 | final String title; 57 | final String content; 58 | AuthorEntity author; 59 | 60 | DetailEntity(this.titleImage, this.title, this.content, this.author); 61 | 62 | static DetailEntity fromJson(Map json) { 63 | return new DetailEntity(json['titleImage'], json['title'], json['content'], 64 | new AuthorEntity.fromJson(json['author'])); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/generated/i18n.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:async'; 3 | 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:flutter/material.dart'; 6 | // ignore_for_file: non_constant_identifier_names 7 | // ignore_for_file: camel_case_types 8 | // ignore_for_file: prefer_single_quotes 9 | 10 | //This file is automatically generated. DO NOT EDIT, all your changes would be lost. 11 | 12 | class S implements WidgetsLocalizations { 13 | const S(); 14 | 15 | static const GeneratedLocalizationsDelegate delegate = 16 | const GeneratedLocalizationsDelegate(); 17 | 18 | static S of(BuildContext context) => 19 | Localizations.of(context, WidgetsLocalizations); 20 | 21 | @override 22 | TextDirection get textDirection => TextDirection.ltr; 23 | 24 | } 25 | 26 | class en extends S { 27 | const en(); 28 | } 29 | 30 | 31 | class GeneratedLocalizationsDelegate extends LocalizationsDelegate { 32 | const GeneratedLocalizationsDelegate(); 33 | 34 | List get supportedLocales { 35 | return const [ 36 | 37 | const Locale("en", ""), 38 | 39 | ]; 40 | } 41 | 42 | LocaleResolutionCallback resolution({Locale fallback}) { 43 | return (Locale locale, Iterable supported) { 44 | final Locale languageLocale = new Locale(locale.languageCode, ""); 45 | if (supported.contains(locale)) 46 | return locale; 47 | else if (supported.contains(languageLocale)) 48 | return languageLocale; 49 | else { 50 | final Locale fallbackLocale = fallback ?? supported.first; 51 | return fallbackLocale; 52 | } 53 | }; 54 | } 55 | 56 | @override 57 | Future load(Locale locale) { 58 | final String lang = getLang(locale); 59 | switch (lang) { 60 | 61 | case "en": 62 | return new SynchronousFuture(const en()); 63 | 64 | default: 65 | return new SynchronousFuture(const S()); 66 | } 67 | } 68 | 69 | @override 70 | bool isSupported(Locale locale) => supportedLocales.contains(locale); 71 | 72 | @override 73 | bool shouldReload(GeneratedLocalizationsDelegate old) => false; 74 | } 75 | 76 | String getLang(Locale l) => l.countryCode != null && l.countryCode.isEmpty 77 | ? l.languageCode 78 | : l.toString(); 79 | -------------------------------------------------------------------------------- /lib/image/icon_splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appdev/FlutterAndKotlinDemo/7f8aeaad1d28e910e0db8048229341cb1de45227/lib/image/icon_splash.jpg -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'FirstActivity.dart'; 3 | import 'HomeActivity.dart'; 4 | //带动画的启动页 5 | //void main() => runApp(new MaterialApp(home: new FirstActivity())); 6 | void main() => runApp(new MaterialApp(home: new HomeActivity())); 7 | -------------------------------------------------------------------------------- /lib/values.dart: -------------------------------------------------------------------------------- 1 | const SplashImage = 'lib/image/icon_splash.jpg'; 2 | const defaultImageUrl = 3 | 'https://pic4.zhimg.com/88e8a28edd4f97e8bb57077a1a91ac03_r.jpg'; 4 | const HomeTitle = '知乎专栏Flutter版'; 5 | 6 | const drawerTabs = [ 7 | '知乎', 8 | '影视', 9 | '音乐', 10 | '开发', 11 | '读书写作', 12 | '科技生活', 13 | ]; 14 | const zhihuTabs = [ 15 | '知乎电子书', 16 | '知乎日报', 17 | '知识青年', 18 | '知乎日爆', 19 | ]; 20 | const zhihuTabsSuffix = [ 21 | 'Weekly', 22 | 'daily', 23 | 'zhihumkt', 24 | 'booom', 25 | ]; 26 | const movieTabs = [ 27 | 'MovieDaily', 28 | '太空堡垒', 29 | '木易影评', 30 | '48帧', 31 | 'RealFantasy', 32 | '知影', 33 | '日剧乱谈', 34 | '登爷的资料库', 35 | ]; 36 | const movieTabsSuffix = [ 37 | 'MovieDaily', 38 | 'Battlestar', 39 | 'happymuyi', 40 | '48zhen', 41 | 'nordenbox', 42 | 'zhimovie', 43 | 'rijuluantan', 44 | 'nordenbox', 45 | ]; 46 | const musicTabs = [ 47 | '乱弹琴', 48 | '古典音乐', 49 | '那些年听过的歌', 50 | '弦语者', 51 | '大豆,音乐', 52 | '狂喜之诗', 53 | ]; 54 | const musicTabsSuffix = [ 55 | 'DKLearnsPop', 56 | 'classicalmusic', 57 | '1song', 58 | 'violinist', 59 | 'adamsuen', 60 | 'klexraxmusic', 61 | ]; 62 | const developTabs = [ 63 | 'AndroidWeekly', 64 | '开发技术前线', 65 | 'Android科学院', 66 | 'C++', 67 | '前端外刊评论', 68 | '程序员的自我修养', 69 | ]; 70 | const developTabsSuffix = [ 71 | 'android-weekly', 72 | 'tech-frontier', 73 | 'andlib', 74 | 'nihaoCPP', 75 | 'FrontendMagazine', 76 | 'netjob', 77 | ]; 78 | const bookTabs = [ 79 | '西流堂', 80 | '文明之光', 81 | '读书有疑', 82 | '异教徒告解室', 83 | '张佳玮写字的地方', 84 | '黄健说', 85 | '听甘德霜讲故事', 86 | '人丑就该多读书', 87 | ]; 88 | const bookTabsSuffix = [ 89 | 'xiliutang', 90 | 'wujun', 91 | 'doubtsinreading', 92 | 'maboyong', 93 | 'zhangjiawei', 94 | 'huangjian', 95 | 'tgdsjgs', 96 | 'uglypeoplefuckbooks', 97 | ]; 98 | const internetTabs = [ 99 | 'apple', 100 | 'MacTalk', 101 | '体验之美', 102 | '最美应用', 103 | '数据冰山', 104 | '小道消息', 105 | 'Rio说', 106 | ]; 107 | const internetTabsSuffix = [ 108 | 'Apple', 109 | 'mactalk', 110 | 'design', 111 | 'zuimei', 112 | 'hemingke', 113 | 'WebNotes', 114 | 'riobard', 115 | ]; 116 | 117 | getTabLength(index) { 118 | switch (index) { 119 | case 0: 120 | return zhihuTabs.length; 121 | case 1: 122 | return movieTabs.length; 123 | case 2: 124 | return musicTabs.length; 125 | case 3: 126 | return developTabs.length; 127 | case 4: 128 | return bookTabs.length; 129 | case 5: 130 | return internetTabs.length; 131 | } 132 | } 133 | 134 | // ignore: missing_return 135 | String getTabSuffix(drawerIndex, tabIndex) { 136 | switch (drawerIndex) { 137 | case 0: 138 | return zhihuTabsSuffix[tabIndex]; 139 | case 1: 140 | return movieTabsSuffix[tabIndex]; 141 | case 2: 142 | return musicTabsSuffix[tabIndex]; 143 | case 3: 144 | return developTabsSuffix[tabIndex]; 145 | case 4: 146 | return bookTabsSuffix[tabIndex]; 147 | case 5: 148 | return internetTabsSuffix[tabIndex]; 149 | } 150 | } 151 | 152 | // ignore: missing_return 153 | List getTabTitle(index) { 154 | switch (index) { 155 | case 0: 156 | return zhihuTabs; 157 | case 1: 158 | return movieTabs; 159 | case 2: 160 | return musicTabs; 161 | case 3: 162 | return developTabs; 163 | case 4: 164 | return bookTabs; 165 | case 5: 166 | return internetTabs; 167 | } 168 | } 169 | 170 | String getListUrl(suffix) { 171 | return 'https://zhuanlan.zhihu.com/api/columns/$suffix/posts'; 172 | } 173 | 174 | String getDetailUrl(slug) { 175 | return 'https://zhuanlan.zhihu.com/api/posts/$slug'; 176 | } 177 | 178 | String getDetailWebUrl(slug) { 179 | return 'https://zhuanlan.zhihu.com/p/$slug'; 180 | } 181 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile 3 | packages: 4 | analyzer: 5 | dependency: transitive 6 | description: 7 | name: analyzer 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.31.2-alpha.2" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.4.3" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.0.7" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.3" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.1" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.6" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.0.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.0.3" 60 | csslib: 61 | dependency: transitive 62 | description: 63 | name: csslib 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.14.4" 67 | cupertino_icons: 68 | dependency: "direct main" 69 | description: 70 | name: cupertino_icons 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.1.2" 74 | flutter: 75 | dependency: "direct main" 76 | description: flutter 77 | source: sdk 78 | version: "0.0.0" 79 | flutter_plugin: 80 | dependency: "direct main" 81 | description: 82 | path: flutter_plugin 83 | relative: true 84 | source: path 85 | version: "0.0.1" 86 | flutter_test: 87 | dependency: "direct dev" 88 | description: flutter 89 | source: sdk 90 | version: "0.0.0" 91 | front_end: 92 | dependency: transitive 93 | description: 94 | name: front_end 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.1.0-alpha.12" 98 | glob: 99 | dependency: transitive 100 | description: 101 | name: glob 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.1.5" 105 | html: 106 | dependency: transitive 107 | description: 108 | name: html 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "0.13.3" 112 | http: 113 | dependency: transitive 114 | description: 115 | name: http 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "0.11.3+16" 119 | http_multi_server: 120 | dependency: transitive 121 | description: 122 | name: http_multi_server 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "2.0.4" 126 | http_parser: 127 | dependency: transitive 128 | description: 129 | name: http_parser 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "3.1.2" 133 | io: 134 | dependency: transitive 135 | description: 136 | name: io 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "0.3.2+1" 140 | js: 141 | dependency: transitive 142 | description: 143 | name: js 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "0.6.1" 147 | kernel: 148 | dependency: transitive 149 | description: 150 | name: kernel 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.3.0-alpha.12" 154 | logging: 155 | dependency: transitive 156 | description: 157 | name: logging 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "0.11.3+1" 161 | matcher: 162 | dependency: transitive 163 | description: 164 | name: matcher 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "0.12.2+1" 168 | meta: 169 | dependency: transitive 170 | description: 171 | name: meta 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "1.1.5" 175 | mime: 176 | dependency: transitive 177 | description: 178 | name: mime 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "0.9.6" 182 | multi_server_socket: 183 | dependency: transitive 184 | description: 185 | name: multi_server_socket 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "1.0.1" 189 | node_preamble: 190 | dependency: transitive 191 | description: 192 | name: node_preamble 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "1.4.1" 196 | package_config: 197 | dependency: transitive 198 | description: 199 | name: package_config 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "1.0.3" 203 | package_resolver: 204 | dependency: transitive 205 | description: 206 | name: package_resolver 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "1.0.2" 210 | path: 211 | dependency: transitive 212 | description: 213 | name: path 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "1.5.1" 217 | plugin: 218 | dependency: transitive 219 | description: 220 | name: plugin 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "0.2.0+2" 224 | pool: 225 | dependency: transitive 226 | description: 227 | name: pool 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "1.3.4" 231 | pub_semver: 232 | dependency: transitive 233 | description: 234 | name: pub_semver 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "1.4.1" 238 | quiver: 239 | dependency: transitive 240 | description: 241 | name: quiver 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "0.29.0+1" 245 | shelf: 246 | dependency: transitive 247 | description: 248 | name: shelf 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "0.7.3" 252 | shelf_packages_handler: 253 | dependency: transitive 254 | description: 255 | name: shelf_packages_handler 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "1.0.3" 259 | shelf_static: 260 | dependency: transitive 261 | description: 262 | name: shelf_static 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "0.2.7" 266 | shelf_web_socket: 267 | dependency: transitive 268 | description: 269 | name: shelf_web_socket 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "0.2.2" 273 | sky_engine: 274 | dependency: transitive 275 | description: flutter 276 | source: sdk 277 | version: "0.0.99" 278 | source_map_stack_trace: 279 | dependency: transitive 280 | description: 281 | name: source_map_stack_trace 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "1.1.4" 285 | source_maps: 286 | dependency: transitive 287 | description: 288 | name: source_maps 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "0.10.5" 292 | source_span: 293 | dependency: transitive 294 | description: 295 | name: source_span 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "1.4.0" 299 | stack_trace: 300 | dependency: transitive 301 | description: 302 | name: stack_trace 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "1.9.2" 306 | stream_channel: 307 | dependency: transitive 308 | description: 309 | name: stream_channel 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "1.6.6" 313 | string_scanner: 314 | dependency: transitive 315 | description: 316 | name: string_scanner 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "1.0.2" 320 | temp_flutter_webview_plugin: 321 | dependency: "direct main" 322 | description: 323 | name: temp_flutter_webview_plugin 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "0.1.6" 327 | term_glyph: 328 | dependency: transitive 329 | description: 330 | name: term_glyph 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "1.0.0" 334 | test: 335 | dependency: transitive 336 | description: 337 | name: test 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "0.12.37" 341 | transparent_image: 342 | dependency: "direct main" 343 | description: 344 | name: transparent_image 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "0.1.0" 348 | typed_data: 349 | dependency: transitive 350 | description: 351 | name: typed_data 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "1.1.5" 355 | utf: 356 | dependency: transitive 357 | description: 358 | name: utf 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "0.9.0+4" 362 | vector_math: 363 | dependency: transitive 364 | description: 365 | name: vector_math 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "2.0.6" 369 | watcher: 370 | dependency: transitive 371 | description: 372 | name: watcher 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "0.9.7+7" 376 | web_socket_channel: 377 | dependency: transitive 378 | description: 379 | name: web_socket_channel 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "1.0.7" 383 | yaml: 384 | dependency: transitive 385 | description: 386 | name: yaml 387 | url: "https://pub.dartlang.org" 388 | source: hosted 389 | version: "2.1.13" 390 | sdks: 391 | dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.58.0.flutter-f981f09760" 392 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_app 2 | description: A new Flutter application. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | 8 | # The following adds the Cupertino Icons font to your application. 9 | # Use with the CupertinoIcons class for iOS style icons. 10 | cupertino_icons: ^0.1.2 11 | transparent_image: "^0.1.0" 12 | temp_flutter_webview_plugin: "^0.1.6" 13 | flutter_plugin: 14 | path: flutter_plugin 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | 20 | 21 | # For information on the generic Dart part of this file, see the 22 | # following page: https://www.dartlang.org/tools/pub/pubspec 23 | 24 | # The following section is specific to Flutter. 25 | flutter: 26 | 27 | # The following line ensures that the Material Icons font is 28 | # included with your application, so that you can use the icons in 29 | # the material Icons class. 30 | uses-material-design: true 31 | assets: 32 | - lib/image/icon_splash.jpg 33 | # To add assets to your application, add an assets section, like this: 34 | # assets: 35 | # - images/a_dot_burr.jpeg 36 | # - images/a_dot_ham.jpeg 37 | 38 | # An image asset can refer to one or more resolution-specific "variants", see 39 | # https://flutter.io/assets-and-images/#resolution-aware. 40 | 41 | # For details regarding adding assets from package dependencies, see 42 | # https://flutter.io/assets-and-images/#from-packages 43 | 44 | # To add custom fonts to your application, add a fonts section here, 45 | # in this "flutter" section. Each entry in this list should have a 46 | # "family" key with the font family name, and a "fonts" key with a 47 | # list giving the asset and other descriptors for the font. For 48 | # example: 49 | # fonts: 50 | # - family: Schyler 51 | # fonts: 52 | # - asset: fonts/Schyler-Regular.ttf 53 | # - asset: fonts/Schyler-Italic.ttf 54 | # style: italic 55 | # - family: Trajan Pro 56 | # fonts: 57 | # - asset: fonts/TrajanPro.ttf 58 | # - asset: fonts/TrajanPro_Bold.ttf 59 | # weight: 700 60 | # 61 | # For details regarding fonts from package dependencies, 62 | # see https://flutter.io/custom-fonts/#from-packages 63 | -------------------------------------------------------------------------------- /res/values/strings_en.arb: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter 3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to 4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties 5 | // are correct. 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | import 'package:flutter_app/main.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(new MyApp()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | --------------------------------------------------------------------------------