├── .idea ├── .gitignore ├── dictionaries │ └── luckysmg.xml ├── vcs.xml ├── libraries │ ├── Flutter_Plugins.xml │ ├── Dart_SDK.xml │ └── Dart_Packages.xml ├── modules.xml ├── linked_scroll_widgets.iml ├── misc.xml └── codeStyles │ └── Project.xml ├── example ├── ios │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ └── .gitignore ├── android │ ├── gradle.properties │ ├── .gitignore │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── java │ │ │ │ │ └── wjr │ │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── MainActivity.java │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── build.gradle ├── .metadata ├── README.md ├── .gitignore ├── test │ └── widget_test.dart ├── lib │ ├── pages │ │ ├── linked_opacity_page.dart │ │ ├── linked_offset_page.dart │ │ ├── linked_opacity_app_bar_page.dart │ │ ├── linked_opacity_navigation_bar_page.dart │ │ └── linked_size_page.dart │ └── main.dart ├── pubspec.yaml └── pubspec.lock ├── CHANGELOG.md ├── .gitattributes ├── gifImage ├── size.gif ├── offset.gif └── opacity.gif ├── test └── linked_scroll_widgets_test.dart ├── lib ├── linked_scroll_widgets.dart └── src │ ├── util.dart │ ├── linked_opacity_widget.dart │ ├── linked_offset_widget.dart │ ├── linked_opacity_app_bar.dart │ ├── linked_opacity_navigation_bar.dart │ └── linked_size_widget.dart ├── linked_scroll_widgets.iml ├── pubspec.yaml ├── .packages ├── pubspec.lock ├── README-CN.md ├── README.md └── LICENSE /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.1.0] - 2020.3.3 2 | ## [0.0.1] - 2020.3.2 3 | 4 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /gifImage/size.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/gifImage/size.gif -------------------------------------------------------------------------------- /gifImage/offset.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/gifImage/offset.gif -------------------------------------------------------------------------------- /gifImage/opacity.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/gifImage/opacity.gif -------------------------------------------------------------------------------- /.idea/dictionaries/luckysmg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luckysmg/linked_scroll_widgets/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/linked_scroll_widgets_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; 4 | 5 | void main() { 6 | test('adds one to input values', () {}); 7 | } 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/linked_scroll_widgets.dart: -------------------------------------------------------------------------------- 1 | library linked_scroll_widgets; 2 | 3 | export 'src/linked_offset_widget.dart'; 4 | export 'src/linked_opacity_app_bar.dart'; 5 | export 'src/linked_opacity_navigation_bar.dart'; 6 | export 'src/linked_opacity_widget.dart'; 7 | export 'src/linked_size_widget.dart'; 8 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/.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: 0b8abb4724aa590dd0f429683339b1e045a1594d 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/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. -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/wjr/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package wjr.com.example; 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity; 5 | import io.flutter.embedding.engine.FlutterEngine; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { 11 | GeneratedPluginRegistrant.registerWith(flutterEngine); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter application. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /.idea/linked_scroll_widgets.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /linked_scroll_widgets.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /example/lib/pages/linked_opacity_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; 4 | 5 | class LinkedOpacityPage extends StatefulWidget { 6 | @override 7 | _LinkedOpacityPageState createState() => _LinkedOpacityPageState(); 8 | } 9 | 10 | class _LinkedOpacityPageState extends State { 11 | ScrollController controller; 12 | 13 | @override 14 | void initState() { 15 | super.initState(); 16 | controller = ScrollController(); 17 | } 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: CupertinoNavigationBar( 23 | middle: LinkedOpacityWidget( 24 | child: Text("透明会变的哦"), 25 | scrollController: controller, 26 | ), 27 | ), 28 | body: ListView.builder( 29 | controller: controller, 30 | padding: EdgeInsets.only(), 31 | itemCount: 40, 32 | itemBuilder: (BuildContext context, int index) { 33 | return Padding( 34 | padding: const EdgeInsets.only(left: 20, top: 20), 35 | child: Text('$index', style: TextStyle(fontSize: 25)), 36 | ); 37 | }, 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /example/lib/pages/linked_offset_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; 4 | 5 | class LinkedOffsetPage extends StatefulWidget { 6 | @override 7 | _LinkedOffsetPageState createState() => _LinkedOffsetPageState(); 8 | } 9 | 10 | class _LinkedOffsetPageState extends State { 11 | ScrollController scrollController; 12 | 13 | @override 14 | void initState() { 15 | super.initState(); 16 | scrollController = ScrollController(); 17 | } 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: CupertinoNavigationBar( 23 | transitionBetweenRoutes: false, 24 | middle: LinkedOffsetWidget( 25 | child: Text("offset会变的哦"), 26 | scrollController: scrollController, 27 | ), 28 | ), 29 | body: ListView.builder( 30 | controller: scrollController, 31 | padding: EdgeInsets.only(), 32 | itemCount: 40, 33 | itemBuilder: (BuildContext context, int index) { 34 | return Padding( 35 | padding: const EdgeInsets.only(left: 20, top: 20), 36 | child: Text('$index', style: TextStyle(fontSize: 25)), 37 | ); 38 | }, 39 | ), 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /example/lib/pages/linked_opacity_app_bar_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; 4 | 5 | class LinkedOpacityAppBarPage extends StatefulWidget { 6 | @override 7 | _LinkedOpacityAppBarPageState createState() => 8 | _LinkedOpacityAppBarPageState(); 9 | } 10 | 11 | class _LinkedOpacityAppBarPageState extends State { 12 | ScrollController scrollController; 13 | 14 | @override 15 | void initState() { 16 | super.initState(); 17 | scrollController = ScrollController(); 18 | } 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | extendBodyBehindAppBar: true, 24 | appBar: LinkedOpacityAppBar( 25 | backgroundColor: Colors.deepOrange, 26 | scrollController: scrollController, 27 | toggleOffsetY: 200, 28 | title: 29 | Text("haha", style: TextStyle(fontSize: 20, color: Colors.black)), 30 | ), 31 | body: ListView.builder( 32 | controller: scrollController, 33 | padding: EdgeInsets.only(), 34 | itemCount: 40, 35 | itemBuilder: (BuildContext context, int index) { 36 | return Padding( 37 | padding: const EdgeInsets.only(left: 20, top: 20), 38 | child: Text('$index', style: TextStyle(fontSize: 25)), 39 | ); 40 | }, 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/lib/pages/linked_opacity_navigation_bar_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; 4 | 5 | class LinkedOpacityNavigationBarPage extends StatefulWidget { 6 | @override 7 | _LinkedOpacityNavigationBarPageState createState() => 8 | _LinkedOpacityNavigationBarPageState(); 9 | } 10 | 11 | class _LinkedOpacityNavigationBarPageState 12 | extends State { 13 | ScrollController scrollController; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | scrollController = ScrollController(); 19 | } 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Scaffold( 24 | extendBodyBehindAppBar: true, 25 | appBar: LinkedOpacityNavigationBar( 26 | transitionBetweenRoutes: false, 27 | scrollController: scrollController, 28 | backgroundColor: Colors.blueAccent, 29 | middle: Text("这个导航栏透明度会变哦"), 30 | ), 31 | body: ListView.builder( 32 | controller: scrollController, 33 | padding: EdgeInsets.only(), 34 | itemCount: 40, 35 | itemBuilder: (BuildContext context, int index) { 36 | return Padding( 37 | padding: const EdgeInsets.only(left: 20, top: 20), 38 | child: Text('$index', style: TextStyle(fontSize: 25)), 39 | ); 40 | }, 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/lib/pages/linked_size_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; 4 | 5 | class LinkedSizePage extends StatefulWidget { 6 | @override 7 | _LinkedSizePageState createState() => _LinkedSizePageState(); 8 | } 9 | 10 | class _LinkedSizePageState extends State { 11 | ScrollController scrollController; 12 | 13 | @override 14 | void initState() { 15 | super.initState(); 16 | scrollController = ScrollController(); 17 | } 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: CupertinoNavigationBar( 23 | middle: Container( 24 | decoration: BoxDecoration( 25 | color: Colors.deepOrange, 26 | borderRadius: BorderRadius.circular(6), 27 | ), 28 | child: LinkedSizeWidget( 29 | child: Text("size会变的哦"), 30 | finalWidth: 300, 31 | scrollController: scrollController, 32 | originalWidth: 100, 33 | ), 34 | ), 35 | ), 36 | body: ListView.builder( 37 | controller: scrollController, 38 | padding: EdgeInsets.only(), 39 | itemCount: 40, 40 | itemBuilder: (BuildContext context, int index) { 41 | return Padding( 42 | padding: const EdgeInsets.only(left: 20, top: 20), 43 | child: Text('$index', style: TextStyle(fontSize: 25)), 44 | ); 45 | }, 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: linked_scroll_widgets 2 | description: A Flutter package with widgets that will react the scrollController's current offset.It can work on opacity,offset,and size. 3 | version: 0.1.0 4 | homepage: https://github.com/luckysmg/linked_scroll_widgets 5 | 6 | environment: 7 | sdk: ">=2.1.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | # For information on the generic Dart part of this file, see the 18 | # following page: https://dart.dev/tools/pub/pubspec 19 | 20 | # The following section is specific to Flutter. 21 | flutter: 22 | 23 | # To add assets to your package, add an assets section, like this: 24 | # assets: 25 | # - images/a_dot_burr.jpeg 26 | # - images/a_dot_ham.jpeg 27 | # 28 | # For details regarding assets in packages, see 29 | # https://flutter.dev/assets-and-images/#from-packages 30 | # 31 | # An image asset can refer to one or more resolution-specific "variants", see 32 | # https://flutter.dev/assets-and-images/#resolution-aware. 33 | 34 | # To add custom fonts to your package, add a fonts section here, 35 | # in this "flutter" section. Each entry in this list should have a 36 | # "family" key with the font family name, and a "fonts" key with a 37 | # list giving the asset and other descriptors for the font. For 38 | # example: 39 | # fonts: 40 | # - family: Schyler 41 | # fonts: 42 | # - asset: fonts/Schyler-Regular.ttf 43 | # - asset: fonts/Schyler-Italic.ttf 44 | # style: italic 45 | # - family: Trajan Pro 46 | # fonts: 47 | # - asset: fonts/TrajanPro.ttf 48 | # - asset: fonts/TrajanPro_Bold.ttf 49 | # weight: 700 50 | # 51 | # For details regarding fonts in packages, see 52 | # https://flutter.dev/custom-fonts/#from-packages 53 | -------------------------------------------------------------------------------- /lib/src/util.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | 3 | import 'linked_opacity_widget.dart'; 4 | 5 | const double kDefaultToggleOffset = 150.0; 6 | 7 | class Util { 8 | static double getSafeOffset( 9 | ScrollController scrollController, double toggleOffset) { 10 | if (scrollController.offset > toggleOffset) { 11 | return toggleOffset; 12 | } else if (scrollController.offset < 0) { 13 | return 0; 14 | } 15 | return scrollController.offset; 16 | } 17 | 18 | static double computeSize(ScrollController scrollController, 19 | double toggleOffset, double originalValue, double finalValue) { 20 | var offset = getSafeOffset(scrollController, toggleOffset); 21 | var value = 22 | ((finalValue - originalValue) / toggleOffset) * offset + originalValue; 23 | return value; 24 | } 25 | 26 | static double computeTransitionOffset( 27 | ScrollController scrollController, 28 | double toggleOffsetY, 29 | double finalTransitionOffsetY, 30 | double originTransitionOffsetY) { 31 | var controllerOffset = Util.getSafeOffset(scrollController, toggleOffsetY); 32 | var transitionOffsetY = 33 | ((finalTransitionOffsetY - originTransitionOffsetY) / toggleOffsetY) * 34 | controllerOffset + 35 | originTransitionOffsetY; 36 | 37 | return transitionOffsetY; 38 | } 39 | 40 | static double computeOpacityWithOffset(ScrollController scrollController, 41 | double toggleOffsetY, InitOpacity initOpacity) { 42 | var offset = getSafeOffset(scrollController, toggleOffsetY); 43 | double opacity; 44 | if (initOpacity == InitOpacity.zero) { 45 | opacity = (1.0 / toggleOffsetY) * offset; 46 | } else if (initOpacity == InitOpacity.one) { 47 | opacity = -(1.0 / toggleOffsetY) * offset + 1; 48 | } 49 | return opacity; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /.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 | 28 | 29 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | applicationId "wjr.com.example" 36 | minSdkVersion 16 37 | targetSdkVersion 28 38 | versionCode flutterVersionCode.toInteger() 39 | versionName flutterVersionName 40 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 41 | } 42 | 43 | buildTypes { 44 | release { 45 | // Signing with the debug keys for now, so `flutter run --release` works. 46 | signingConfig signingConfigs.debug 47 | } 48 | } 49 | } 50 | 51 | flutter { 52 | source '../..' 53 | } 54 | 55 | dependencies { 56 | testImplementation 'junit:junit:4.12' 57 | androidTestImplementation 'androidx.test:runner:1.1.1' 58 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 59 | } 60 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'pages/linked_offset_page.dart'; 5 | import 'pages/linked_opacity_app_bar_page.dart'; 6 | import 'pages/linked_opacity_navigation_bar_page.dart'; 7 | import 'pages/linked_opacity_page.dart'; 8 | import 'pages/linked_size_page.dart'; 9 | 10 | void main() => runApp(MyApp()); 11 | 12 | class MyApp extends StatelessWidget { 13 | @override 14 | Widget build(BuildContext context) { 15 | return MaterialApp( 16 | title: 'Flutter Demo', 17 | theme: ThemeData( 18 | primarySwatch: Colors.blue, 19 | ), 20 | home: Page(), 21 | ); 22 | } 23 | } 24 | 25 | class Page extends StatefulWidget { 26 | @override 27 | _PageState createState() => _PageState(); 28 | } 29 | 30 | class _PageState extends State { 31 | @override 32 | Widget build(BuildContext context) { 33 | return Scaffold( 34 | appBar: CupertinoNavigationBar( 35 | middle: Text("Example"), 36 | ), 37 | body: ListView( 38 | children: [ 39 | _buildWidget("LinkedSizeWidget", () { 40 | Navigator.push(context, 41 | CupertinoPageRoute(builder: (context) => LinkedSizePage())); 42 | }), 43 | _buildWidget("LinkedOffsetWidget", () { 44 | Navigator.push(context, 45 | CupertinoPageRoute(builder: (context) => LinkedOffsetPage())); 46 | }), 47 | _buildWidget("LinkedOpacityWidget", () { 48 | Navigator.push(context, 49 | CupertinoPageRoute(builder: (context) => LinkedOpacityPage())); 50 | }), 51 | _buildWidget("LinkedOpacityAppBarPage", () { 52 | Navigator.push( 53 | context, 54 | CupertinoPageRoute( 55 | builder: (context) => LinkedOpacityAppBarPage())); 56 | }), 57 | _buildWidget("LinkedOpacityNavigationBar", () { 58 | Navigator.push( 59 | context, 60 | CupertinoPageRoute( 61 | builder: (context) => LinkedOpacityNavigationBarPage())); 62 | }), 63 | ], 64 | ), 65 | ); 66 | } 67 | 68 | Widget _buildWidget(String text, VoidCallback onTap) { 69 | return GestureDetector( 70 | onTap: onTap, 71 | child: Padding( 72 | padding: const EdgeInsets.fromLTRB(20, 10, 0, 10), 73 | child: Text(text, style: TextStyle(fontSize: 30)), 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/src/linked_opacity_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'util.dart'; 5 | 6 | ///初始状态的opacity 7 | ///init Opacity 8 | enum InitOpacity { 9 | ///1.0 10 | one, 11 | 12 | ///0.0 13 | zero 14 | } 15 | 16 | typedef OnOpacityChanged = Function(double opacity); 17 | 18 | /// 19 | /// A widget that its opacity value will be linked to a scrollController 20 | /// 21 | class LinkedOpacityWidget extends StatefulWidget { 22 | final Widget child; 23 | final ScrollController scrollController; 24 | final double toggleOffsetY; 25 | final InitOpacity initOpacity; 26 | final OnOpacityChanged onOpacityChanged; 27 | 28 | const LinkedOpacityWidget( 29 | {Key key, 30 | @required this.child, 31 | @required this.scrollController, 32 | this.toggleOffsetY = kDefaultToggleOffset, 33 | this.initOpacity = InitOpacity.zero, 34 | this.onOpacityChanged}) 35 | : super(key: key); 36 | 37 | @override 38 | _LinkedOpacityWidgetState createState() => _LinkedOpacityWidgetState(); 39 | } 40 | 41 | class _LinkedOpacityWidgetState extends State { 42 | var opacity; 43 | VoidCallback listener; 44 | 45 | @override 46 | void initState() { 47 | super.initState(); 48 | initOpacity(); 49 | listener = () { 50 | opacity = Util.computeOpacityWithOffset( 51 | widget.scrollController, widget.toggleOffsetY, widget.initOpacity); 52 | if (widget.onOpacityChanged != null) { 53 | widget.onOpacityChanged(opacity); 54 | } 55 | setState(() {}); 56 | }; 57 | 58 | widget.scrollController.addListener(listener); 59 | } 60 | 61 | @override 62 | void didUpdateWidget(LinkedOpacityWidget oldWidget) { 63 | super.didUpdateWidget(oldWidget); 64 | if (widget.initOpacity != oldWidget.initOpacity || 65 | widget.toggleOffsetY != oldWidget.toggleOffsetY) { 66 | initOpacity(); 67 | widget.scrollController.removeListener(listener); 68 | widget.scrollController.addListener(listener); 69 | } 70 | } 71 | 72 | @override 73 | Widget build(BuildContext context) { 74 | return AnimatedOpacity( 75 | opacity: opacity, 76 | duration: const Duration(), 77 | child: widget.child, 78 | ); 79 | } 80 | 81 | void initOpacity() { 82 | if (widget.initOpacity == InitOpacity.zero) { 83 | opacity = 0.0; 84 | } else { 85 | opacity = 1.0; 86 | } 87 | } 88 | 89 | @override 90 | void dispose() { 91 | super.dispose(); 92 | widget.scrollController.removeListener(listener); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /.packages: -------------------------------------------------------------------------------- 1 | # Generated by pub on 2020-03-03 15:07:20.620964. 2 | archive:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/archive-2.0.11/lib/ 3 | args:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.5.2/lib/ 4 | async:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.4.0/lib/ 5 | boolean_selector:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.5/lib/ 6 | charcode:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/ 7 | collection:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.14.11/lib/ 8 | convert:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.1.1/lib/ 9 | crypto:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.1.3/lib/ 10 | flutter:file:///Users/luckysmg/flutter/packages/flutter/lib/ 11 | flutter_test:file:///Users/luckysmg/flutter/packages/flutter_test/lib/ 12 | image:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.4/lib/ 13 | matcher:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.6/lib/ 14 | meta:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.1.8/lib/ 15 | path:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.6.4/lib/ 16 | pedantic:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.8.0+1/lib/ 17 | petitparser:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/petitparser-2.4.0/lib/ 18 | quiver:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.0.5/lib/ 19 | sky_engine:file:///Users/luckysmg/flutter/bin/cache/pkg/sky_engine/lib/ 20 | source_span:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.5.5/lib/ 21 | stack_trace:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.9.3/lib/ 22 | stream_channel:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.0.0/lib/ 23 | string_scanner:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.5/lib/ 24 | term_glyph:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.1.0/lib/ 25 | test_api:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.11/lib/ 26 | typed_data:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/ 27 | vector_math:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/ 28 | xml:file:///Users/luckysmg/flutter/.pub-cache/hosted/pub.dartlang.org/xml-3.5.0/lib/ 29 | linked_scroll_widgets:lib/ 30 | -------------------------------------------------------------------------------- /lib/src/linked_offset_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'util.dart'; 5 | 6 | typedef OnOffsetChanged = Function(double offset); 7 | 8 | /// 9 | /// A widget that its offsetY value will be linked to a scrollController 10 | /// 11 | class LinkedOffsetWidget extends StatefulWidget { 12 | final Widget child; 13 | final double originTransitionOffsetY; 14 | final double finalTransitionOffsetY; 15 | final double toggleOffsetY; 16 | final bool transformHitTests; 17 | final ScrollController scrollController; 18 | final OnOffsetChanged onOffsetChanged; 19 | 20 | const LinkedOffsetWidget({ 21 | Key key, 22 | @required this.child, 23 | @required this.scrollController, 24 | this.originTransitionOffsetY = 40.0, 25 | this.finalTransitionOffsetY = 0.0, 26 | this.toggleOffsetY = kDefaultToggleOffset, 27 | this.transformHitTests = true, 28 | this.onOffsetChanged, 29 | }) : super(key: key); 30 | 31 | @override 32 | _LinkedTransitionWidgetState createState() => _LinkedTransitionWidgetState(); 33 | } 34 | 35 | class _LinkedTransitionWidgetState extends State { 36 | Offset offset; 37 | var listener; 38 | 39 | @override 40 | void didUpdateWidget(LinkedOffsetWidget oldWidget) { 41 | super.didUpdateWidget(oldWidget); 42 | if (widget.transformHitTests != oldWidget.transformHitTests || 43 | widget.originTransitionOffsetY != oldWidget.originTransitionOffsetY || 44 | widget.finalTransitionOffsetY != oldWidget.finalTransitionOffsetY) { 45 | widget.scrollController.removeListener(listener); 46 | widget.scrollController.addListener(listener); 47 | } 48 | } 49 | 50 | @override 51 | void initState() { 52 | super.initState(); 53 | offset = Offset(0, widget.originTransitionOffsetY); 54 | listener = () { 55 | var transitionOffsetY = Util.computeTransitionOffset( 56 | widget.scrollController, 57 | widget.toggleOffsetY, 58 | widget.finalTransitionOffsetY, 59 | widget.originTransitionOffsetY); 60 | offset = Offset(0, transitionOffsetY); 61 | if (widget.onOffsetChanged != null) { 62 | widget.onOffsetChanged(transitionOffsetY); 63 | } 64 | setState(() {}); 65 | }; 66 | widget.scrollController.addListener(listener); 67 | } 68 | 69 | @override 70 | Widget build(BuildContext context) { 71 | return Transform.translate( 72 | transformHitTests: widget.transformHitTests, 73 | offset: offset, 74 | child: widget.child, 75 | ); 76 | } 77 | 78 | @override 79 | void dispose() { 80 | super.dispose(); 81 | widget.scrollController.removeListener(listener); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter application. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | linked_scroll_widgets: ^0.0.1 27 | 28 | dev_dependencies: 29 | flutter_test: 30 | sdk: flutter 31 | 32 | 33 | # For information on the generic Dart part of this file, see the 34 | # following page: https://dart.dev/tools/pub/pubspec 35 | 36 | # The following section is specific to Flutter. 37 | flutter: 38 | 39 | # The following line ensures that the Material Icons font is 40 | # included with your application, so that you can use the icons in 41 | # the material Icons class. 42 | uses-material-design: true 43 | 44 | # To add assets to your application, add an assets section, like this: 45 | # assets: 46 | # - images/a_dot_burr.jpeg 47 | # - images/a_dot_ham.jpeg 48 | 49 | # An image asset can refer to one or more resolution-specific "variants", see 50 | # https://flutter.dev/assets-and-images/#resolution-aware. 51 | 52 | # For details regarding adding assets from package dependencies, see 53 | # https://flutter.dev/assets-and-images/#from-packages 54 | 55 | # To add custom fonts to your application, add a fonts section here, 56 | # in this "flutter" section. Each entry in this list should have a 57 | # "family" key with the font family name, and a "fonts" key with a 58 | # list giving the asset and other descriptors for the font. For 59 | # example: 60 | # fonts: 61 | # - family: Schyler 62 | # fonts: 63 | # - asset: fonts/Schyler-Regular.ttf 64 | # - asset: fonts/Schyler-Italic.ttf 65 | # style: italic 66 | # - family: Trajan Pro 67 | # fonts: 68 | # - asset: fonts/TrajanPro.ttf 69 | # - asset: fonts/TrajanPro_Bold.ttf 70 | # weight: 700 71 | # 72 | # For details regarding fonts from package dependencies, 73 | # see https://flutter.dev/custom-fonts/#from-packages 74 | -------------------------------------------------------------------------------- /lib/src/linked_opacity_app_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../linked_scroll_widgets.dart'; 5 | import 'util.dart'; 6 | 7 | /// 8 | /// Because the appBar's opacity is often linked with scroll widgets to do some UI effects, 9 | /// so I make widget directly for you to use conveniently. 10 | /// 11 | ///因为根据滑动来设置appBar的透明度比较常见,索性直接做一个开箱即用的吧^_^ 12 | /// 13 | 14 | ///Material style appbar with linked opacity widget. 15 | ///if you want iOS style please use [LinkedOpacityNavigationBar] 16 | /// 这是谷歌风格的,如果想要苹果风格的移步 [LinkedOpacityNavigationBar] 17 | class LinkedOpacityAppBar extends StatelessWidget 18 | implements PreferredSizeWidget { 19 | final ScrollController scrollController; 20 | final double toggleOffsetY; 21 | final Widget title; 22 | final List actions; 23 | final Widget leading; 24 | final bool automaticallyImplyLeading; 25 | final Widget flexibleSpace; 26 | final Color backgroundColor; 27 | final double elevation; 28 | final bool primary; 29 | final PreferredSizeWidget bottom; 30 | final IconThemeData actionsIconTheme; 31 | final ShapeBorder shape; 32 | final double titleSpacing; 33 | final Brightness brightness; 34 | final bool centerTitle; 35 | final IconThemeData iconTheme; 36 | final InitOpacity initOpacity; 37 | final OnOpacityChanged onOpacityChanged; 38 | 39 | const LinkedOpacityAppBar({ 40 | Key key, 41 | @required this.scrollController, 42 | this.title, 43 | this.actions, 44 | this.toggleOffsetY = kDefaultToggleOffset, 45 | this.automaticallyImplyLeading = true, 46 | this.flexibleSpace, 47 | this.backgroundColor = Colors.white, 48 | this.elevation = 0.0, 49 | this.leading, 50 | this.primary = true, 51 | this.bottom, 52 | this.actionsIconTheme, 53 | this.shape, 54 | this.titleSpacing = NavigationToolbar.kMiddleSpacing, 55 | this.brightness, 56 | this.centerTitle, 57 | this.iconTheme, 58 | this.initOpacity = InitOpacity.zero, 59 | this.onOpacityChanged, 60 | }) : super(key: key); 61 | 62 | @override 63 | Widget build(BuildContext context) { 64 | return LinkedOpacityWidget( 65 | scrollController: scrollController, 66 | toggleOffsetY: toggleOffsetY, 67 | initOpacity: initOpacity, 68 | onOpacityChanged: onOpacityChanged, 69 | child: AppBar( 70 | elevation: elevation, 71 | leading: leading, 72 | primary: primary, 73 | bottom: bottom, 74 | brightness: brightness, 75 | shape: shape, 76 | centerTitle: centerTitle, 77 | iconTheme: iconTheme, 78 | titleSpacing: titleSpacing, 79 | actionsIconTheme: actionsIconTheme, 80 | backgroundColor: backgroundColor, 81 | flexibleSpace: flexibleSpace, 82 | title: title, 83 | actions: actions, 84 | automaticallyImplyLeading: automaticallyImplyLeading, 85 | ), 86 | ); 87 | } 88 | 89 | @override 90 | Size get preferredSize => const Size.fromHeight(kToolbarHeight); 91 | } 92 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /lib/src/linked_opacity_navigation_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'linked_opacity_app_bar.dart'; 5 | import 'linked_opacity_widget.dart'; 6 | import 'util.dart'; 7 | 8 | const Color _kDefaultNavBarBorderColor = Color(0x4D000000); 9 | 10 | const Border _kDefaultNavBarBorder = Border( 11 | bottom: BorderSide( 12 | color: _kDefaultNavBarBorderColor, 13 | width: 0.0, // One physical pixel. 14 | style: BorderStyle.solid, 15 | ), 16 | ); 17 | 18 | /// 19 | /// Because the appBar's opacity is often linked with scroll widgets to do some UI effects, 20 | /// so I make widget directly for you to use conveniently. 21 | /// 22 | ///因为根据滑动来设置appBar的透明度比较常见,索性直接做一个开箱即用的吧^_^ 23 | /// 24 | 25 | /// iOS style navigationBar with linked opacity widget 26 | ///if you want material style please use [LinkedOpacityAppBar] 27 | /// 这是苹果风格的,如果想要谷歌风格的移步 [LinkedOpacityAppBar] 28 | class LinkedOpacityNavigationBar extends StatelessWidget 29 | implements ObstructingPreferredSizeWidget { 30 | final ScrollController scrollController; 31 | final double toggleOffsetY; 32 | final InitOpacity initOpacity; 33 | final OnOpacityChanged onOpacityChanged; 34 | final Widget middle; 35 | final Widget leading; 36 | final Widget trailing; 37 | final Color backgroundColor; 38 | final bool automaticallyImplyLeading; 39 | final bool automaticallyImplyMiddle; 40 | final EdgeInsetsDirectional padding; 41 | final String previousPageTitle; 42 | final bool transitionBetweenRoutes; 43 | final Border border; 44 | 45 | const LinkedOpacityNavigationBar({ 46 | Key key, 47 | @required this.scrollController, 48 | this.toggleOffsetY = kDefaultToggleOffset, 49 | this.initOpacity = InitOpacity.zero, 50 | this.onOpacityChanged, 51 | this.middle, 52 | this.leading, 53 | this.trailing, 54 | this.backgroundColor, 55 | this.automaticallyImplyLeading = true, 56 | this.automaticallyImplyMiddle = true, 57 | this.padding, 58 | this.previousPageTitle, 59 | this.transitionBetweenRoutes = false, 60 | this.border = _kDefaultNavBarBorder, 61 | }) : super(key: key); 62 | 63 | @override 64 | Widget build(BuildContext context) { 65 | return LinkedOpacityWidget( 66 | scrollController: scrollController, 67 | toggleOffsetY: toggleOffsetY, 68 | onOpacityChanged: onOpacityChanged, 69 | initOpacity: initOpacity, 70 | child: CupertinoNavigationBar( 71 | trailing: trailing, 72 | leading: leading, 73 | middle: middle, 74 | backgroundColor: backgroundColor, 75 | automaticallyImplyLeading: automaticallyImplyLeading, 76 | automaticallyImplyMiddle: automaticallyImplyMiddle, 77 | padding: padding, 78 | previousPageTitle: previousPageTitle, 79 | transitionBetweenRoutes: transitionBetweenRoutes, 80 | border: border, 81 | ), 82 | ); 83 | } 84 | 85 | ///standard iOS navigationBar height 86 | @override 87 | Size get preferredSize => Size.fromHeight(44.0); 88 | 89 | @override 90 | bool shouldFullyObstruct(BuildContext context) { 91 | final Color backgroundColor = 92 | CupertinoDynamicColor.resolve(this.backgroundColor, context) ?? 93 | CupertinoTheme.of(context).barBackgroundColor; 94 | return backgroundColor.alpha == 0xFF; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/src/linked_size_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'util.dart'; 4 | 5 | typedef OnSizeChanged = Function(double height, double width); 6 | 7 | /// 8 | /// A widget that its width or height value will be linked to a scrollController 9 | /// 10 | class LinkedSizeWidget extends StatefulWidget { 11 | final Widget child; 12 | final ScrollController scrollController; 13 | final double toggleOffsetY; 14 | final double originalHeight; 15 | final double finalHeight; 16 | final double originalWidth; 17 | final double finalWidth; 18 | final Alignment alignment; 19 | final OnSizeChanged onSizeChanged; 20 | 21 | /// 如果你想控制高度,那么originalHeight,finalHeight都必须传入,宽度也是如此 22 | /// if you want to control height value,the [originalHeight] and [finalHeight] needs to be passed in, 23 | /// so does the width 24 | const LinkedSizeWidget({ 25 | Key key, 26 | @required this.scrollController, 27 | @required this.child, 28 | this.originalWidth, 29 | this.finalWidth, 30 | this.toggleOffsetY = kDefaultToggleOffset, 31 | this.originalHeight, 32 | this.finalHeight, 33 | this.alignment = Alignment.center, 34 | this.onSizeChanged, 35 | }) : super(key: key); 36 | 37 | @override 38 | _LinkedSizeWidgetState createState() => _LinkedSizeWidgetState(); 39 | } 40 | 41 | class _LinkedSizeWidgetState extends State 42 | with SingleTickerProviderStateMixin { 43 | var currentHeight; 44 | var currentWidth; 45 | var listener; 46 | 47 | @override 48 | void initState() { 49 | super.initState(); 50 | initSize(); 51 | listener = () { 52 | if (widget.originalWidth != null && widget.finalWidth != null) { 53 | currentWidth = Util.computeSize(widget.scrollController, 54 | widget.toggleOffsetY, widget.originalWidth, widget.finalWidth); 55 | } 56 | if (widget.originalHeight != null && widget.finalHeight != null) { 57 | currentHeight = Util.computeSize(widget.scrollController, 58 | widget.toggleOffsetY, widget.originalHeight, widget.finalHeight); 59 | } 60 | if (widget.onSizeChanged != null) { 61 | widget.onSizeChanged(currentHeight, currentWidth); 62 | } 63 | setState(() {}); 64 | }; 65 | widget.scrollController.addListener(listener); 66 | } 67 | 68 | @override 69 | Widget build(BuildContext context) { 70 | return Container( 71 | alignment: widget.alignment, 72 | height: currentHeight, 73 | width: currentWidth, 74 | child: widget.child, 75 | ); 76 | } 77 | 78 | @override 79 | void dispose() { 80 | super.dispose(); 81 | widget.scrollController.removeListener(listener); 82 | } 83 | 84 | @override 85 | void didUpdateWidget(LinkedSizeWidget oldWidget) { 86 | super.didUpdateWidget(oldWidget); 87 | if (oldWidget.originalHeight != widget.originalHeight || 88 | oldWidget.finalHeight != widget.finalHeight || 89 | oldWidget.originalWidth != widget.originalWidth || 90 | oldWidget.finalWidth != widget.finalWidth) { 91 | initSize(); 92 | widget.scrollController.removeListener(listener); 93 | widget.scrollController.addListener(listener); 94 | } 95 | } 96 | 97 | void initSize() { 98 | currentWidth = widget.originalWidth; 99 | currentHeight = widget.originalHeight; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | xmlns:android 11 | 12 | ^$ 13 | 14 | 15 | 16 |
17 |
18 | 19 | 20 | 21 | xmlns:.* 22 | 23 | ^$ 24 | 25 | 26 | BY_NAME 27 | 28 |
29 |
30 | 31 | 32 | 33 | .*:id 34 | 35 | http://schemas.android.com/apk/res/android 36 | 37 | 38 | 39 |
40 |
41 | 42 | 43 | 44 | .*:name 45 | 46 | http://schemas.android.com/apk/res/android 47 | 48 | 49 | 50 |
51 |
52 | 53 | 54 | 55 | name 56 | 57 | ^$ 58 | 59 | 60 | 61 |
62 |
63 | 64 | 65 | 66 | style 67 | 68 | ^$ 69 | 70 | 71 | 72 |
73 |
74 | 75 | 76 | 77 | .* 78 | 79 | ^$ 80 | 81 | 82 | BY_NAME 83 | 84 |
85 |
86 | 87 | 88 | 89 | .* 90 | 91 | http://schemas.android.com/apk/res/android 92 | 93 | 94 | ANDROID_ATTRIBUTE_ORDER 95 | 96 |
97 |
98 | 99 | 100 | 101 | .* 102 | 103 | .* 104 | 105 | 106 | BY_NAME 107 | 108 |
109 |
110 |
111 |
112 |
113 |
-------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.0" 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.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.3" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | image: 71 | dependency: transitive 72 | description: 73 | name: image 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "2.1.4" 77 | matcher: 78 | dependency: transitive 79 | description: 80 | name: matcher 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.12.6" 84 | meta: 85 | dependency: transitive 86 | description: 87 | name: meta 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.1.8" 91 | path: 92 | dependency: transitive 93 | description: 94 | name: path 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.6.4" 98 | pedantic: 99 | dependency: transitive 100 | description: 101 | name: pedantic 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.8.0+1" 105 | petitparser: 106 | dependency: transitive 107 | description: 108 | name: petitparser 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "2.4.0" 112 | quiver: 113 | dependency: transitive 114 | description: 115 | name: quiver 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "2.0.5" 119 | sky_engine: 120 | dependency: transitive 121 | description: flutter 122 | source: sdk 123 | version: "0.0.99" 124 | source_span: 125 | dependency: transitive 126 | description: 127 | name: source_span 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.5.5" 131 | stack_trace: 132 | dependency: transitive 133 | description: 134 | name: stack_trace 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.9.3" 138 | stream_channel: 139 | dependency: transitive 140 | description: 141 | name: stream_channel 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "2.0.0" 145 | string_scanner: 146 | dependency: transitive 147 | description: 148 | name: string_scanner 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.0.5" 152 | term_glyph: 153 | dependency: transitive 154 | description: 155 | name: term_glyph 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "1.1.0" 159 | test_api: 160 | dependency: transitive 161 | description: 162 | name: test_api 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "0.2.11" 166 | typed_data: 167 | dependency: transitive 168 | description: 169 | name: typed_data 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.1.6" 173 | vector_math: 174 | dependency: transitive 175 | description: 176 | name: vector_math 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "2.0.8" 180 | xml: 181 | dependency: transitive 182 | description: 183 | name: xml 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "3.5.0" 187 | sdks: 188 | dart: ">=2.4.0 <3.0.0" 189 | -------------------------------------------------------------------------------- /README-CN.md: -------------------------------------------------------------------------------- 1 | Language: [English](https://github.com/luckysmg/linked_scroll_widgets/blob/master/README.md) | [中文简体](https://github.com/luckysmg/linked_scroll_widgets/blob/master/README-CN.md) 2 | 3 | 4 | 5 | # linked_scroll_widgets 6 | 7 | 一个可以和滚动组件交互的一个widget库 8 | 9 | ## 别的不说,直接上例子 10 | 11 | - LinkedOpacityWidget: 12 | 13 | ![](https://github.com/luckysmg/linked_scroll_widgets/blob/master/gifImage/opacity.gif) 14 | ```dart 15 | class LinkedOpacityPage extends StatefulWidget { 16 | @override 17 | _LinkedOpacityPageState createState() => _LinkedOpacityPageState(); 18 | } 19 | 20 | class _LinkedOpacityPageState extends State { 21 | ScrollController controller; 22 | 23 | @override 24 | void initState() { 25 | super.initState(); 26 | controller = ScrollController(); 27 | } 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return Scaffold( 32 | appBar: CupertinoNavigationBar( 33 | middle: LinkedOpacityWidget( 34 | child: Text("透明会变的哦"), 35 | scrollController: controller, 36 | ), 37 | ), 38 | body: ListView.builder( 39 | controller: controller, 40 | padding: EdgeInsets.only(), 41 | itemCount: 40, 42 | itemBuilder: (BuildContext context, int index) { 43 | return Padding( 44 | padding: const EdgeInsets.only(left: 20, top: 20), 45 | child: Text('$index', style: TextStyle(fontSize: 25)), 46 | ); 47 | }, 48 | ), 49 | ); 50 | } 51 | } 52 | ``` 53 | 54 | - LinkedSizeWidget: 55 | 56 | ![](https://github.com/luckysmg/linked_scroll_widgets/blob/master/gifImage/size.gif) 57 | 58 | ```dart 59 | class LinkedSizePage extends StatefulWidget { 60 | @override 61 | _LinkedSizePageState createState() => _LinkedSizePageState(); 62 | } 63 | 64 | class _LinkedSizePageState extends State { 65 | ScrollController scrollController; 66 | 67 | @override 68 | void initState() { 69 | super.initState(); 70 | scrollController = ScrollController(); 71 | } 72 | 73 | @override 74 | Widget build(BuildContext context) { 75 | return Scaffold( 76 | appBar: CupertinoNavigationBar( 77 | middle: Container( 78 | decoration: BoxDecoration( 79 | color: Colors.deepOrange, 80 | borderRadius: BorderRadius.circular(6), 81 | ), 82 | child: LinkedSizeWidget( 83 | child: Text("size会变的哦"), 84 | finalWidth: 300, 85 | scrollController: scrollController, 86 | originalWidth: 100, 87 | ), 88 | ), 89 | ), 90 | body: ListView.builder( 91 | controller: scrollController, 92 | padding: EdgeInsets.only(), 93 | itemCount: 40, 94 | itemBuilder: (BuildContext context, int index) { 95 | return Padding( 96 | padding: const EdgeInsets.only(left: 20, top: 20), 97 | child: Text('$index', style: TextStyle(fontSize: 25)), 98 | ); 99 | }, 100 | ), 101 | ); 102 | } 103 | } 104 | ``` 105 | 106 | - LinkedOffsetWidget: 107 | 108 | ![](https://github.com/luckysmg/linked_scroll_widgets/blob/master/gifImage/offset.gif) 109 | 110 | ```dart 111 | class LinkedOffsetPage extends StatefulWidget { 112 | @override 113 | _LinkedOffsetPageState createState() => _LinkedOffsetPageState(); 114 | } 115 | 116 | class _LinkedOffsetPageState extends State { 117 | ScrollController scrollController; 118 | 119 | @override 120 | void initState() { 121 | super.initState(); 122 | scrollController = ScrollController(); 123 | } 124 | 125 | @override 126 | Widget build(BuildContext context) { 127 | return Scaffold( 128 | appBar: CupertinoNavigationBar( 129 | middle: LinkedOffsetWidget( 130 | child: Text("offset会变的哦"), 131 | scrollController: scrollController, 132 | ), 133 | ), 134 | body: ListView.builder( 135 | controller: scrollController, 136 | padding: EdgeInsets.only(), 137 | itemCount: 40, 138 | itemBuilder: (BuildContext context, int index) { 139 | return Padding( 140 | padding: const EdgeInsets.only(left: 20, top: 20), 141 | child: Text('$index', style: TextStyle(fontSize: 25)), 142 | ); 143 | }, 144 | ), 145 | ); 146 | } 147 | } 148 | 149 | ``` 150 | ## 由于透明度变换常常和AppBar关联,除了上述三个组件,索性还封装了两个组件,开箱即用 151 | - LinkedOpacityNavigationBar (iOS风格) 152 | - LinkedOpacityAppBar (material风格) 153 | 154 | ## 参数说明: 155 | - toggleOffsetY 156 | 首先此包中的组件都包含这个属性,那什么是toggleOffsetY? 157 | 这个是一个滚动的临界值,当你的滚动明组件(如listView)的滚动offset达到了这个值,你的相关联的UI效果也会达到边界值 158 | 159 | 这里以上面 LinkedOpacityPage 中的例子为例, 160 | 具体情况如下:当你listView处于初始位置(offsetY = 0)时,你是完全看不见导航栏上的字的,当滚动到临界值,也就是 161 | offsetY = toggleOffsetY 时,你导航栏上的字才能完全显示出来,也就是说这个一个对应的线性变化。 162 | 163 | 也就是说,当你滚动的offsetY = 0和 offsetY = toggleOffsetY时,分别达到两端的临界值. 164 | 165 | 一句话来说,如果你想要你的UI效果变化的快,就把 toggleOffsetY设定得越小即可(toggleOffsetY > 0). 166 | 167 | 168 | ## FAQ 169 | - 当我push一个新页面,这个页面的导航栏是用CupertinoNavigationBar制作的,里面可能包含LinkedOffsetWidget或者LinkedOpacityWidget,在页面动画过程中效果很奇怪怎么办: 170 | 解决方法:将CupertinoNavigationBar中的"transitionBetweenRoute" 参数设置为false即可 171 | 172 | 173 | # 我的其他作品: 174 | [jr_extension](https://pub.dev/packages/jr_extension) 175 | 176 | [flutter_swipe_action_cell](https://pub.dev/packages/flutter_swipe_action_cell) 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.0" 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.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.3" 60 | cupertino_icons: 61 | dependency: "direct main" 62 | description: 63 | name: cupertino_icons 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.1.3" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | image: 78 | dependency: transitive 79 | description: 80 | name: image 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "2.1.4" 84 | linked_scroll_widgets: 85 | dependency: "direct main" 86 | description: 87 | name: linked_scroll_widgets 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.0.1" 91 | matcher: 92 | dependency: transitive 93 | description: 94 | name: matcher 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.12.6" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.1.8" 105 | path: 106 | dependency: transitive 107 | description: 108 | name: path 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.6.4" 112 | pedantic: 113 | dependency: transitive 114 | description: 115 | name: pedantic 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "1.8.0+1" 119 | petitparser: 120 | dependency: transitive 121 | description: 122 | name: petitparser 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "2.4.0" 126 | quiver: 127 | dependency: transitive 128 | description: 129 | name: quiver 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "2.0.5" 133 | sky_engine: 134 | dependency: transitive 135 | description: flutter 136 | source: sdk 137 | version: "0.0.99" 138 | source_span: 139 | dependency: transitive 140 | description: 141 | name: source_span 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.5.5" 145 | stack_trace: 146 | dependency: transitive 147 | description: 148 | name: stack_trace 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.9.3" 152 | stream_channel: 153 | dependency: transitive 154 | description: 155 | name: stream_channel 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "2.0.0" 159 | string_scanner: 160 | dependency: transitive 161 | description: 162 | name: string_scanner 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.0.5" 166 | term_glyph: 167 | dependency: transitive 168 | description: 169 | name: term_glyph 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.1.0" 173 | test_api: 174 | dependency: transitive 175 | description: 176 | name: test_api 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "0.2.11" 180 | typed_data: 181 | dependency: transitive 182 | description: 183 | name: typed_data 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.1.6" 187 | vector_math: 188 | dependency: transitive 189 | description: 190 | name: vector_math 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "2.0.8" 194 | xml: 195 | dependency: transitive 196 | description: 197 | name: xml 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "3.5.0" 201 | sdks: 202 | dart: ">=2.4.0 <3.0.0" 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Language: [English](https://github.com/luckysmg/linked_scroll_widgets/blob/master/README.md) | [中文简体](https://github.com/luckysmg/linked_scroll_widgets/blob/master/README-CN.md) 2 | 3 | 4 | # linked_scroll_widgets 5 | 6 | A lib full of widgets that can react to the scrollController's offset change,to custom your UI effect. 7 | 8 | ## Get started with an simple example: 9 | 10 | - LinkedOpacityWidget: 11 | 12 | ![](https://github.com/luckysmg/linked_scroll_widgets/blob/master/gifImage/opacity.gif) 13 | ```dart 14 | class LinkedOpacityPage extends StatefulWidget { 15 | @override 16 | _LinkedOpacityPageState createState() => _LinkedOpacityPageState(); 17 | } 18 | 19 | class _LinkedOpacityPageState extends State { 20 | ScrollController controller; 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | controller = ScrollController(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Scaffold( 31 | appBar: CupertinoNavigationBar( 32 | middle: LinkedOpacityWidget( 33 | child: Text("透明会变的哦"), 34 | scrollController: controller, 35 | ), 36 | ), 37 | body: ListView.builder( 38 | controller: controller, 39 | padding: EdgeInsets.only(), 40 | itemCount: 40, 41 | itemBuilder: (BuildContext context, int index) { 42 | return Padding( 43 | padding: const EdgeInsets.only(left: 20, top: 20), 44 | child: Text('$index', style: TextStyle(fontSize: 25)), 45 | ); 46 | }, 47 | ), 48 | ); 49 | } 50 | } 51 | ``` 52 | 53 | - LinkedSizeWidget: 54 | 55 | ![](https://github.com/luckysmg/linked_scroll_widgets/blob/master/gifImage/size.gif) 56 | 57 | ```dart 58 | class LinkedSizePage extends StatefulWidget { 59 | @override 60 | _LinkedSizePageState createState() => _LinkedSizePageState(); 61 | } 62 | 63 | class _LinkedSizePageState extends State { 64 | ScrollController scrollController; 65 | 66 | @override 67 | void initState() { 68 | super.initState(); 69 | scrollController = ScrollController(); 70 | } 71 | 72 | @override 73 | Widget build(BuildContext context) { 74 | return Scaffold( 75 | appBar: CupertinoNavigationBar( 76 | middle: Container( 77 | decoration: BoxDecoration( 78 | color: Colors.deepOrange, 79 | borderRadius: BorderRadius.circular(6), 80 | ), 81 | child: LinkedSizeWidget( 82 | child: Text("size会变的哦"), 83 | finalWidth: 300, 84 | scrollController: scrollController, 85 | originalWidth: 100, 86 | ), 87 | ), 88 | ), 89 | body: ListView.builder( 90 | controller: scrollController, 91 | padding: EdgeInsets.only(), 92 | itemCount: 40, 93 | itemBuilder: (BuildContext context, int index) { 94 | return Padding( 95 | padding: const EdgeInsets.only(left: 20, top: 20), 96 | child: Text('$index', style: TextStyle(fontSize: 25)), 97 | ); 98 | }, 99 | ), 100 | ); 101 | } 102 | } 103 | ``` 104 | 105 | - LinkedOffsetWidget: 106 | 107 | ![](https://github.com/luckysmg/linked_scroll_widgets/blob/master/gifImage/offset.gif) 108 | 109 | ```dart 110 | class LinkedOffsetPage extends StatefulWidget { 111 | @override 112 | _LinkedOffsetPageState createState() => _LinkedOffsetPageState(); 113 | } 114 | 115 | class _LinkedOffsetPageState extends State { 116 | ScrollController scrollController; 117 | 118 | @override 119 | void initState() { 120 | super.initState(); 121 | scrollController = ScrollController(); 122 | } 123 | 124 | @override 125 | Widget build(BuildContext context) { 126 | return Scaffold( 127 | appBar: CupertinoNavigationBar( 128 | middle: LinkedOffsetWidget( 129 | child: Text("offset会变的哦"), 130 | scrollController: scrollController, 131 | ), 132 | ), 133 | body: ListView.builder( 134 | controller: scrollController, 135 | padding: EdgeInsets.only(), 136 | itemCount: 40, 137 | itemBuilder: (BuildContext context, int index) { 138 | return Padding( 139 | padding: const EdgeInsets.only(left: 20, top: 20), 140 | child: Text('$index', style: TextStyle(fontSize: 25)), 141 | ); 142 | }, 143 | ), 144 | ); 145 | } 146 | } 147 | 148 | ``` 149 | 150 | 151 | ## Because the appBar's opacity is often linked with scroll widgets to do some UI effects, so I make widget directly for you to use conveniently. 152 | - LinkedOpacityNavigationBar (iOS style) 153 | - LinkedOpacityAppBar (material style) 154 | 155 | ## parameter guide: 156 | - toggleOffsetY 157 | First,the widgets in this lib have this parameter,so you may think that what is toggleOffsetY? 158 | Let me take an example using the example page call LinkedOpacityPage (just above ,the first GIF) 159 | When the offsetY of your listView is 0(initialOffset) you can't see the title text on top navigationBar 160 | and, when the offsetY = toggleOffset Y ,the title text is visible completely,it a linear change. 161 | In other words,when offsetY = 0 ,the opacity = 0,and when offset = toggleOffset,the opacity = 1.0; 162 | All in all,the faster you want to change your UI effect,the smaller toggleOffsetY you should set; 163 | 164 | ## FAQ 165 | - When I push a page ,which has a LinkedOffsetWidget or LinkedOpacityWidget in the CupertinoNavigationBar,the effect is strange 166 | 167 | Solution:Set parameter "transitionBetweenRoute" to false. 168 | 169 | 170 | 171 | ## My other packages: 172 | [jr_extension](https://pub.dev/packages/jr_extension) 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_Packages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /example/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 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 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 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 18 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 19 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXCopyFilesBuildPhase section */ 23 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 24 | isa = PBXCopyFilesBuildPhase; 25 | buildActionMask = 2147483647; 26 | dstPath = ""; 27 | dstSubfolderSpec = 10; 28 | files = ( 29 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 30 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 31 | ); 32 | name = "Embed Frameworks"; 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXCopyFilesBuildPhase section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 39 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 40 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 41 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 42 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 43 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 46 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 47 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 48 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 52 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 61 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 9740EEB11CF90186004384FC /* Flutter */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 3B80C3931E831B6300D905FE /* App.framework */, 72 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 73 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 74 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 75 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 76 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 77 | ); 78 | name = Flutter; 79 | sourceTree = ""; 80 | }; 81 | 97C146E51CF9000F007C117D = { 82 | isa = PBXGroup; 83 | children = ( 84 | 9740EEB11CF90186004384FC /* Flutter */, 85 | 97C146F01CF9000F007C117D /* Runner */, 86 | 97C146EF1CF9000F007C117D /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 97C146EF1CF9000F007C117D /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 97C146EE1CF9000F007C117D /* Runner.app */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | 97C146F01CF9000F007C117D /* Runner */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 102 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 103 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 104 | 97C147021CF9000F007C117D /* Info.plist */, 105 | 97C146F11CF9000F007C117D /* Supporting Files */, 106 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 107 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 108 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 109 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 110 | ); 111 | path = Runner; 112 | sourceTree = ""; 113 | }; 114 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | /* End PBXGroup section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | 97C146ED1CF9000F007C117D /* Runner */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 127 | buildPhases = ( 128 | 9740EEB61CF901F6004384FC /* Run Script */, 129 | 97C146EA1CF9000F007C117D /* Sources */, 130 | 97C146EB1CF9000F007C117D /* Frameworks */, 131 | 97C146EC1CF9000F007C117D /* Resources */, 132 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 133 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 134 | ); 135 | buildRules = ( 136 | ); 137 | dependencies = ( 138 | ); 139 | name = Runner; 140 | productName = Runner; 141 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 142 | productType = "com.apple.product-type.application"; 143 | }; 144 | /* End PBXNativeTarget section */ 145 | 146 | /* Begin PBXProject section */ 147 | 97C146E61CF9000F007C117D /* Project object */ = { 148 | isa = PBXProject; 149 | attributes = { 150 | LastUpgradeCheck = 1020; 151 | ORGANIZATIONNAME = "The Chromium Authors"; 152 | TargetAttributes = { 153 | 97C146ED1CF9000F007C117D = { 154 | CreatedOnToolsVersion = 7.3.1; 155 | LastSwiftMigration = 1100; 156 | }; 157 | }; 158 | }; 159 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 160 | compatibilityVersion = "Xcode 3.2"; 161 | developmentRegion = en; 162 | hasScannedForEncodings = 0; 163 | knownRegions = ( 164 | en, 165 | Base, 166 | ); 167 | mainGroup = 97C146E51CF9000F007C117D; 168 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 169 | projectDirPath = ""; 170 | projectRoot = ""; 171 | targets = ( 172 | 97C146ED1CF9000F007C117D /* Runner */, 173 | ); 174 | }; 175 | /* End PBXProject section */ 176 | 177 | /* Begin PBXResourcesBuildPhase section */ 178 | 97C146EC1CF9000F007C117D /* Resources */ = { 179 | isa = PBXResourcesBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 183 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 184 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 185 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXShellScriptBuildPhase section */ 192 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 193 | isa = PBXShellScriptBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | ); 197 | inputPaths = ( 198 | ); 199 | name = "Thin Binary"; 200 | outputPaths = ( 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | shellPath = /bin/sh; 204 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 205 | }; 206 | 9740EEB61CF901F6004384FC /* Run Script */ = { 207 | isa = PBXShellScriptBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | inputPaths = ( 212 | ); 213 | name = "Run Script"; 214 | outputPaths = ( 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | shellPath = /bin/sh; 218 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 219 | }; 220 | /* End PBXShellScriptBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | 97C146EA1CF9000F007C117D /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 228 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXVariantGroup section */ 235 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 236 | isa = PBXVariantGroup; 237 | children = ( 238 | 97C146FB1CF9000F007C117D /* Base */, 239 | ); 240 | name = Main.storyboard; 241 | sourceTree = ""; 242 | }; 243 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | 97C147001CF9000F007C117D /* Base */, 247 | ); 248 | name = LaunchScreen.storyboard; 249 | sourceTree = ""; 250 | }; 251 | /* End PBXVariantGroup section */ 252 | 253 | /* Begin XCBuildConfiguration section */ 254 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 255 | isa = XCBuildConfiguration; 256 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 257 | buildSettings = { 258 | ALWAYS_SEARCH_USER_PATHS = NO; 259 | CLANG_ANALYZER_NONNULL = YES; 260 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 261 | CLANG_CXX_LIBRARY = "libc++"; 262 | CLANG_ENABLE_MODULES = YES; 263 | CLANG_ENABLE_OBJC_ARC = YES; 264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_COMMA = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 275 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 276 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 278 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 279 | CLANG_WARN_STRICT_PROTOTYPES = YES; 280 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 286 | ENABLE_NS_ASSERTIONS = NO; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | GCC_C_LANGUAGE_STANDARD = gnu99; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 297 | MTL_ENABLE_DEBUG_INFO = NO; 298 | SDKROOT = iphoneos; 299 | SUPPORTED_PLATFORMS = iphoneos; 300 | TARGETED_DEVICE_FAMILY = "1,2"; 301 | VALIDATE_PRODUCT = YES; 302 | }; 303 | name = Profile; 304 | }; 305 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 306 | isa = XCBuildConfiguration; 307 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | CLANG_ENABLE_MODULES = YES; 311 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 312 | ENABLE_BITCODE = NO; 313 | FRAMEWORK_SEARCH_PATHS = ( 314 | "$(inherited)", 315 | "$(PROJECT_DIR)/Flutter", 316 | ); 317 | INFOPLIST_FILE = Runner/Info.plist; 318 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 319 | LIBRARY_SEARCH_PATHS = ( 320 | "$(inherited)", 321 | "$(PROJECT_DIR)/Flutter", 322 | ); 323 | PRODUCT_BUNDLE_IDENTIFIER = wjr.com.example; 324 | PRODUCT_NAME = "$(TARGET_NAME)"; 325 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 326 | SWIFT_VERSION = 5.0; 327 | VERSIONING_SYSTEM = "apple-generic"; 328 | }; 329 | name = Profile; 330 | }; 331 | 97C147031CF9000F007C117D /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 334 | buildSettings = { 335 | ALWAYS_SEARCH_USER_PATHS = NO; 336 | CLANG_ANALYZER_NONNULL = YES; 337 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 338 | CLANG_CXX_LIBRARY = "libc++"; 339 | CLANG_ENABLE_MODULES = YES; 340 | CLANG_ENABLE_OBJC_ARC = YES; 341 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_COMMA = YES; 344 | CLANG_WARN_CONSTANT_CONVERSION = YES; 345 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 356 | CLANG_WARN_STRICT_PROTOTYPES = YES; 357 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 358 | CLANG_WARN_UNREACHABLE_CODE = YES; 359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 361 | COPY_PHASE_STRIP = NO; 362 | DEBUG_INFORMATION_FORMAT = dwarf; 363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 364 | ENABLE_TESTABILITY = YES; 365 | GCC_C_LANGUAGE_STANDARD = gnu99; 366 | GCC_DYNAMIC_NO_PIC = NO; 367 | GCC_NO_COMMON_BLOCKS = YES; 368 | GCC_OPTIMIZATION_LEVEL = 0; 369 | GCC_PREPROCESSOR_DEFINITIONS = ( 370 | "DEBUG=1", 371 | "$(inherited)", 372 | ); 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 380 | MTL_ENABLE_DEBUG_INFO = YES; 381 | ONLY_ACTIVE_ARCH = YES; 382 | SDKROOT = iphoneos; 383 | TARGETED_DEVICE_FAMILY = "1,2"; 384 | }; 385 | name = Debug; 386 | }; 387 | 97C147041CF9000F007C117D /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_ANALYZER_NONNULL = YES; 393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 394 | CLANG_CXX_LIBRARY = "libc++"; 395 | CLANG_ENABLE_MODULES = YES; 396 | CLANG_ENABLE_OBJC_ARC = YES; 397 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 398 | CLANG_WARN_BOOL_CONVERSION = YES; 399 | CLANG_WARN_COMMA = YES; 400 | CLANG_WARN_CONSTANT_CONVERSION = YES; 401 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 403 | CLANG_WARN_EMPTY_BODY = YES; 404 | CLANG_WARN_ENUM_CONVERSION = YES; 405 | CLANG_WARN_INFINITE_RECURSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 408 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 409 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 411 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 412 | CLANG_WARN_STRICT_PROTOTYPES = YES; 413 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 414 | CLANG_WARN_UNREACHABLE_CODE = YES; 415 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 416 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 417 | COPY_PHASE_STRIP = NO; 418 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 419 | ENABLE_NS_ASSERTIONS = NO; 420 | ENABLE_STRICT_OBJC_MSGSEND = YES; 421 | GCC_C_LANGUAGE_STANDARD = gnu99; 422 | GCC_NO_COMMON_BLOCKS = YES; 423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 425 | GCC_WARN_UNDECLARED_SELECTOR = YES; 426 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 427 | GCC_WARN_UNUSED_FUNCTION = YES; 428 | GCC_WARN_UNUSED_VARIABLE = YES; 429 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 430 | MTL_ENABLE_DEBUG_INFO = NO; 431 | SDKROOT = iphoneos; 432 | SUPPORTED_PLATFORMS = iphoneos; 433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 434 | TARGETED_DEVICE_FAMILY = "1,2"; 435 | VALIDATE_PRODUCT = YES; 436 | }; 437 | name = Release; 438 | }; 439 | 97C147061CF9000F007C117D /* Debug */ = { 440 | isa = XCBuildConfiguration; 441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | CLANG_ENABLE_MODULES = YES; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | ENABLE_BITCODE = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | INFOPLIST_FILE = Runner/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | LIBRARY_SEARCH_PATHS = ( 454 | "$(inherited)", 455 | "$(PROJECT_DIR)/Flutter", 456 | ); 457 | PRODUCT_BUNDLE_IDENTIFIER = wjr.com.example; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 461 | SWIFT_VERSION = 5.0; 462 | VERSIONING_SYSTEM = "apple-generic"; 463 | }; 464 | name = Debug; 465 | }; 466 | 97C147071CF9000F007C117D /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 469 | buildSettings = { 470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 | CLANG_ENABLE_MODULES = YES; 472 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 473 | ENABLE_BITCODE = NO; 474 | FRAMEWORK_SEARCH_PATHS = ( 475 | "$(inherited)", 476 | "$(PROJECT_DIR)/Flutter", 477 | ); 478 | INFOPLIST_FILE = Runner/Info.plist; 479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 480 | LIBRARY_SEARCH_PATHS = ( 481 | "$(inherited)", 482 | "$(PROJECT_DIR)/Flutter", 483 | ); 484 | PRODUCT_BUNDLE_IDENTIFIER = wjr.com.example; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 487 | SWIFT_VERSION = 5.0; 488 | VERSIONING_SYSTEM = "apple-generic"; 489 | }; 490 | name = Release; 491 | }; 492 | /* End XCBuildConfiguration section */ 493 | 494 | /* Begin XCConfigurationList section */ 495 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 97C147031CF9000F007C117D /* Debug */, 499 | 97C147041CF9000F007C117D /* Release */, 500 | 249021D3217E4FDB00AE95B9 /* Profile */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 97C147061CF9000F007C117D /* Debug */, 509 | 97C147071CF9000F007C117D /* Release */, 510 | 249021D4217E4FDB00AE95B9 /* Profile */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | }; 517 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 518 | } 519 | --------------------------------------------------------------------------------