├── .gitignore ├── .metadata ├── 1.png ├── 2.gif ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_app │ │ │ │ └── MainActivity.java │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── 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 │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── main.m ├── lib ├── horizontal_numberpicker.dart ├── horizontal_numberpicker_wrapper.dart └── main.dart ├── pubspec.lock ├── pubspec.yaml └── test └── widget_test.dart /.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 | -------------------------------------------------------------------------------- /.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: 9f5ff2306bb3e30b2b98eee79cd231b1336f41f4 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/1.png -------------------------------------------------------------------------------- /2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/2.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 功能 2 | 3 | 水平滚动的数字选择标尺。支持: 4 | 5 | - 选取整数、小数。不同的步进。 6 | - 自定义刻度样式。 7 | - 自定义数字显示的格式、单位。 8 | - 惯性滚动。手指离开后自动对齐。 9 | 10 | 为了使用的灵活性,控件被拆分为两部分,分别是: 11 | 12 | - HorizontalNumberPicker:标尺。 13 | - HorizontalNumberPickerWrapper:对HorizontalNumberPicker进行简单包装,添加顶部的选中值显示和两边的半透明遮罩。 14 | 15 | > 控件的代码比较简单,若有无法调整的样式,建议直接修改源码。 16 | 17 | # 效果 18 | 19 | ![](1.png) 20 | 21 | ![](2.gif) 22 | 23 | # HorizontalNumberPicker 24 | 25 | 标尺。 26 | 27 | ```dart 28 | HorizontalNumberPicker({ 29 | Key key, 30 | this.initialValue = 500, //初始值 31 | this.minValue = 100, //最小可选值 32 | this.maxValue = 900, //最大可选值 33 | this.step = 1, //步进 34 | this.widgetWidth = 200, //标尺宽度 35 | this.widgetHeight = 60, //标尺高度 36 | this.subGridCountPerGrid = 10, //每个大格中的小格数 37 | this.subGridWidth = 8, //每个小格的宽度 38 | @required this.onSelectedChanged, //选中值改变回调 39 | this.scaleTransformer, //自定义标尺下的文字显示格式 40 | this.scaleColor = const Color(0xFFE9E9E9), //刻度颜色 41 | this.indicatorColor = const Color(0xFF3995FF), //指示器颜色 42 | this.scaleTextColor = const Color(0xFF8E99A0), //刻度下的文字颜色 43 | }) : super(key: key) { 44 | ... 45 | } 46 | ``` 47 | 48 | # HorizontalNumberPickerWrapper 49 | 50 | 对HorizontalNumberPicker进行简单包装,添加顶部的选中值显示和两边的半透明遮罩。 51 | 52 | ```dart 53 | HorizontalNumberPickerWrapper({ 54 | Key key, 55 | this.initialValue = 500, 56 | this.minValue = 100, 57 | this.maxValue = 900, 58 | this.step = 1, 59 | this.unit = "", //顶部title的单位 60 | this.widgetWidth = 200, 61 | this.subGridCountPerGrid = 10, 62 | this.subGridWidth = 8, 63 | @required this.onSelectedChanged, 64 | this.titleTransformer, //自定义title的显示格式 65 | this.scaleTransformer, 66 | this.titleTextColor = const Color(0xFF3995FF), //title文字的颜色 67 | this.scaleColor = const Color(0xFFE9E9E9), 68 | this.indicatorColor = const Color(0xFF3995FF), 69 | this.scaleTextColor = const Color(0xFF8E99A0), 70 | }) : super(key: key) { 71 | ... 72 | } 73 | ``` 74 | 75 | # 使用示例 76 | 77 | ```dart 78 | import 'package:flutter/material.dart'; 79 | import 'package:intl/intl.dart'; 80 | 81 | import 'horizontal_numberpicker_wrapper.dart'; 82 | 83 | void main() => runApp(MyApp()); 84 | 85 | class MyApp extends StatelessWidget { 86 | @override 87 | Widget build(BuildContext context) { 88 | return MaterialApp( 89 | home: MyHomePage(), 90 | ); 91 | } 92 | } 93 | 94 | class MyHomePage extends StatefulWidget { 95 | MyHomePage({Key key}) : super(key: key); 96 | 97 | @override 98 | _MyHomePageState createState() => _MyHomePageState(); 99 | } 100 | 101 | class _MyHomePageState extends State { 102 | NumberFormat _numberFormat = NumberFormat(',000'); 103 | 104 | @override 105 | Widget build(BuildContext context) { 106 | return Scaffold( 107 | backgroundColor: Colors.white, 108 | body: SingleChildScrollView( 109 | scrollDirection: Axis.vertical, 110 | child: Container( 111 | width: double.infinity, 112 | margin: EdgeInsets.symmetric(vertical: 40), 113 | child: Column( 114 | mainAxisSize: MainAxisSize.min, 115 | crossAxisAlignment: CrossAxisAlignment.center, 116 | children: [ 117 | HorizontalNumberPickerWrapper( 118 | initialValue: 160, 119 | minValue: 100, 120 | maxValue: 200, 121 | step: 1, 122 | unit: 'CM', 123 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 124 | subGridCountPerGrid: 10, 125 | subGridWidth: 8, 126 | onSelectedChanged: (value) { 127 | print(value); 128 | }, 129 | ), 130 | Container(height: 10), 131 | HorizontalNumberPickerWrapper( 132 | initialValue: 600, 133 | minValue: 100, 134 | maxValue: 1500, 135 | step: 1, 136 | unit: 'KG', 137 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 138 | subGridCountPerGrid: 10, 139 | subGridWidth: 8, 140 | onSelectedChanged: (value) { 141 | print(value / 10); 142 | }, 143 | titleTransformer: (value) { 144 | return formatIntegerStr(value / 10); 145 | }, 146 | scaleTransformer: (value) { 147 | return formatIntegerStr(value / 10); 148 | }, 149 | ), 150 | Container(height: 10), 151 | HorizontalNumberPickerWrapper( 152 | initialValue: 100, 153 | minValue: 0, 154 | maxValue: 300, 155 | step: 1, 156 | unit: 'mmHg', 157 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 158 | subGridCountPerGrid: 2, 159 | subGridWidth: 20, 160 | onSelectedChanged: (value) { 161 | print(value); 162 | }, 163 | ), 164 | Container(height: 10), 165 | HorizontalNumberPickerWrapper( 166 | initialValue: 80, 167 | minValue: 10, 168 | maxValue: 250, 169 | step: 1, 170 | unit: 'mmol/L', 171 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 172 | subGridCountPerGrid: 2, 173 | subGridWidth: 20, 174 | onSelectedChanged: (value) { 175 | print(value / 10); 176 | }, 177 | titleTransformer: (value) { 178 | return formatIntegerStr(value / 10); 179 | }, 180 | scaleTransformer: (value) { 181 | return formatIntegerStr(value / 10); 182 | }, 183 | ), 184 | Container(height: 10), 185 | HorizontalNumberPickerWrapper( 186 | initialValue: 6000, 187 | minValue: 1000, 188 | maxValue: 21000, 189 | step: 1000, 190 | unit: '步', 191 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 192 | subGridCountPerGrid: 2, 193 | subGridWidth: 20, 194 | onSelectedChanged: (value) { 195 | print(value); 196 | }, 197 | titleTransformer: (value) { 198 | return _numberFormat.format(value); 199 | }, 200 | scaleTransformer: (value) { 201 | return '${value ~/ 1000}k'; 202 | }, 203 | ), 204 | ], 205 | ), 206 | ), 207 | ), // This trailing comma makes auto-formatting nicer for build methods. 208 | ); 209 | } 210 | } 211 | 212 | ///去掉整数后的小数点和0 213 | ///1.0 -> "1" 214 | ///1.2 -> "1.2" 215 | String formatIntegerStr(num number) { 216 | int intNumber = number.truncate(); 217 | 218 | //是整数 219 | if (intNumber == number) { 220 | return intNumber.toString(); 221 | } else { 222 | return number.toString(); 223 | } 224 | } 225 | ``` 226 | 227 | # 源码 228 | 229 | https://github.com/al4fun/HorizontalNumberPicker 230 | 231 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /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 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.flutter_app" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'androidx.test:runner:1.1.1' 60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 61 | } 62 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/flutter_app/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.flutter_app; 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 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 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 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 17 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 18 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 19 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 20 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXCopyFilesBuildPhase section */ 24 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 25 | isa = PBXCopyFilesBuildPhase; 26 | buildActionMask = 2147483647; 27 | dstPath = ""; 28 | dstSubfolderSpec = 10; 29 | files = ( 30 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 31 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 32 | ); 33 | name = "Embed Frameworks"; 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXCopyFilesBuildPhase section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 40 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 41 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 42 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 43 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 44 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 47 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 48 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 49 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 51 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 52 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 53 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 54 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 63 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXFrameworksBuildPhase section */ 68 | 69 | /* Begin PBXGroup section */ 70 | 9740EEB11CF90186004384FC /* Flutter */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 3B80C3931E831B6300D905FE /* App.framework */, 74 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 75 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 76 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 77 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 78 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 79 | ); 80 | name = Flutter; 81 | sourceTree = ""; 82 | }; 83 | 97C146E51CF9000F007C117D = { 84 | isa = PBXGroup; 85 | children = ( 86 | 9740EEB11CF90186004384FC /* Flutter */, 87 | 97C146F01CF9000F007C117D /* Runner */, 88 | 97C146EF1CF9000F007C117D /* Products */, 89 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 90 | ); 91 | sourceTree = ""; 92 | }; 93 | 97C146EF1CF9000F007C117D /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 97C146EE1CF9000F007C117D /* Runner.app */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 97C146F01CF9000F007C117D /* Runner */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 105 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 106 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 107 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 108 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 109 | 97C147021CF9000F007C117D /* Info.plist */, 110 | 97C146F11CF9000F007C117D /* Supporting Files */, 111 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 112 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 113 | ); 114 | path = Runner; 115 | sourceTree = ""; 116 | }; 117 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 97C146F21CF9000F007C117D /* main.m */, 121 | ); 122 | name = "Supporting Files"; 123 | sourceTree = ""; 124 | }; 125 | /* End PBXGroup section */ 126 | 127 | /* Begin PBXNativeTarget section */ 128 | 97C146ED1CF9000F007C117D /* Runner */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 131 | buildPhases = ( 132 | 9740EEB61CF901F6004384FC /* Run Script */, 133 | 97C146EA1CF9000F007C117D /* Sources */, 134 | 97C146EB1CF9000F007C117D /* Frameworks */, 135 | 97C146EC1CF9000F007C117D /* Resources */, 136 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 137 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 138 | ); 139 | buildRules = ( 140 | ); 141 | dependencies = ( 142 | ); 143 | name = Runner; 144 | productName = Runner; 145 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 146 | productType = "com.apple.product-type.application"; 147 | }; 148 | /* End PBXNativeTarget section */ 149 | 150 | /* Begin PBXProject section */ 151 | 97C146E61CF9000F007C117D /* Project object */ = { 152 | isa = PBXProject; 153 | attributes = { 154 | LastUpgradeCheck = 1020; 155 | ORGANIZATIONNAME = "The Chromium Authors"; 156 | TargetAttributes = { 157 | 97C146ED1CF9000F007C117D = { 158 | CreatedOnToolsVersion = 7.3.1; 159 | }; 160 | }; 161 | }; 162 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 163 | compatibilityVersion = "Xcode 3.2"; 164 | developmentRegion = en; 165 | hasScannedForEncodings = 0; 166 | knownRegions = ( 167 | en, 168 | Base, 169 | ); 170 | mainGroup = 97C146E51CF9000F007C117D; 171 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 172 | projectDirPath = ""; 173 | projectRoot = ""; 174 | targets = ( 175 | 97C146ED1CF9000F007C117D /* Runner */, 176 | ); 177 | }; 178 | /* End PBXProject section */ 179 | 180 | /* Begin PBXResourcesBuildPhase section */ 181 | 97C146EC1CF9000F007C117D /* Resources */ = { 182 | isa = PBXResourcesBuildPhase; 183 | buildActionMask = 2147483647; 184 | files = ( 185 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 186 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 187 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 188 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | /* End PBXResourcesBuildPhase section */ 193 | 194 | /* Begin PBXShellScriptBuildPhase section */ 195 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 196 | isa = PBXShellScriptBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | ); 200 | inputPaths = ( 201 | ); 202 | name = "Thin Binary"; 203 | outputPaths = ( 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | shellPath = /bin/sh; 207 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 208 | }; 209 | 9740EEB61CF901F6004384FC /* Run Script */ = { 210 | isa = PBXShellScriptBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | ); 214 | inputPaths = ( 215 | ); 216 | name = "Run Script"; 217 | outputPaths = ( 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | shellPath = /bin/sh; 221 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 222 | }; 223 | /* End PBXShellScriptBuildPhase section */ 224 | 225 | /* Begin PBXSourcesBuildPhase section */ 226 | 97C146EA1CF9000F007C117D /* Sources */ = { 227 | isa = PBXSourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 231 | 97C146F31CF9000F007C117D /* main.m in Sources */, 232 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXSourcesBuildPhase section */ 237 | 238 | /* Begin PBXVariantGroup section */ 239 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 240 | isa = PBXVariantGroup; 241 | children = ( 242 | 97C146FB1CF9000F007C117D /* Base */, 243 | ); 244 | name = Main.storyboard; 245 | sourceTree = ""; 246 | }; 247 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 97C147001CF9000F007C117D /* Base */, 251 | ); 252 | name = LaunchScreen.storyboard; 253 | sourceTree = ""; 254 | }; 255 | /* End PBXVariantGroup section */ 256 | 257 | /* Begin XCBuildConfiguration section */ 258 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 259 | isa = XCBuildConfiguration; 260 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 261 | buildSettings = { 262 | ALWAYS_SEARCH_USER_PATHS = NO; 263 | CLANG_ANALYZER_NONNULL = YES; 264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 265 | CLANG_CXX_LIBRARY = "libc++"; 266 | CLANG_ENABLE_MODULES = YES; 267 | CLANG_ENABLE_OBJC_ARC = YES; 268 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 269 | CLANG_WARN_BOOL_CONVERSION = YES; 270 | CLANG_WARN_COMMA = YES; 271 | CLANG_WARN_CONSTANT_CONVERSION = YES; 272 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 273 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 274 | CLANG_WARN_EMPTY_BODY = YES; 275 | CLANG_WARN_ENUM_CONVERSION = YES; 276 | CLANG_WARN_INFINITE_RECURSION = YES; 277 | CLANG_WARN_INT_CONVERSION = YES; 278 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 279 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | SUPPORTED_PLATFORMS = iphoneos; 304 | TARGETED_DEVICE_FAMILY = "1,2"; 305 | VALIDATE_PRODUCT = YES; 306 | }; 307 | name = Profile; 308 | }; 309 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 310 | isa = XCBuildConfiguration; 311 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 312 | buildSettings = { 313 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 314 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 315 | ENABLE_BITCODE = NO; 316 | FRAMEWORK_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "$(PROJECT_DIR)/Flutter", 319 | ); 320 | INFOPLIST_FILE = Runner/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | LIBRARY_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "$(PROJECT_DIR)/Flutter", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterApp; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 348 | CLANG_WARN_EMPTY_BODY = YES; 349 | CLANG_WARN_ENUM_CONVERSION = YES; 350 | CLANG_WARN_INFINITE_RECURSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 354 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 355 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 357 | CLANG_WARN_STRICT_PROTOTYPES = YES; 358 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 362 | COPY_PHASE_STRIP = NO; 363 | DEBUG_INFORMATION_FORMAT = dwarf; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | ENABLE_TESTABILITY = YES; 366 | GCC_C_LANGUAGE_STANDARD = gnu99; 367 | GCC_DYNAMIC_NO_PIC = NO; 368 | GCC_NO_COMMON_BLOCKS = YES; 369 | GCC_OPTIMIZATION_LEVEL = 0; 370 | GCC_PREPROCESSOR_DEFINITIONS = ( 371 | "DEBUG=1", 372 | "$(inherited)", 373 | ); 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 381 | MTL_ENABLE_DEBUG_INFO = YES; 382 | ONLY_ACTIVE_ARCH = YES; 383 | SDKROOT = iphoneos; 384 | TARGETED_DEVICE_FAMILY = "1,2"; 385 | }; 386 | name = Debug; 387 | }; 388 | 97C147041CF9000F007C117D /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 391 | buildSettings = { 392 | ALWAYS_SEARCH_USER_PATHS = NO; 393 | CLANG_ANALYZER_NONNULL = YES; 394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 395 | CLANG_CXX_LIBRARY = "libc++"; 396 | CLANG_ENABLE_MODULES = YES; 397 | CLANG_ENABLE_OBJC_ARC = YES; 398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 399 | CLANG_WARN_BOOL_CONVERSION = YES; 400 | CLANG_WARN_COMMA = YES; 401 | CLANG_WARN_CONSTANT_CONVERSION = YES; 402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INFINITE_RECURSION = YES; 407 | CLANG_WARN_INT_CONVERSION = YES; 408 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 409 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNREACHABLE_CODE = YES; 416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 420 | ENABLE_NS_ASSERTIONS = NO; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu99; 423 | GCC_NO_COMMON_BLOCKS = YES; 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 431 | MTL_ENABLE_DEBUG_INFO = NO; 432 | SDKROOT = iphoneos; 433 | SUPPORTED_PLATFORMS = iphoneos; 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 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 445 | ENABLE_BITCODE = NO; 446 | FRAMEWORK_SEARCH_PATHS = ( 447 | "$(inherited)", 448 | "$(PROJECT_DIR)/Flutter", 449 | ); 450 | INFOPLIST_FILE = Runner/Info.plist; 451 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 452 | LIBRARY_SEARCH_PATHS = ( 453 | "$(inherited)", 454 | "$(PROJECT_DIR)/Flutter", 455 | ); 456 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterApp; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | VERSIONING_SYSTEM = "apple-generic"; 459 | }; 460 | name = Debug; 461 | }; 462 | 97C147071CF9000F007C117D /* Release */ = { 463 | isa = XCBuildConfiguration; 464 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 465 | buildSettings = { 466 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 467 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 468 | ENABLE_BITCODE = NO; 469 | FRAMEWORK_SEARCH_PATHS = ( 470 | "$(inherited)", 471 | "$(PROJECT_DIR)/Flutter", 472 | ); 473 | INFOPLIST_FILE = Runner/Info.plist; 474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 475 | LIBRARY_SEARCH_PATHS = ( 476 | "$(inherited)", 477 | "$(PROJECT_DIR)/Flutter", 478 | ); 479 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterApp; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | VERSIONING_SYSTEM = "apple-generic"; 482 | }; 483 | name = Release; 484 | }; 485 | /* End XCBuildConfiguration section */ 486 | 487 | /* Begin XCConfigurationList section */ 488 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 489 | isa = XCConfigurationList; 490 | buildConfigurations = ( 491 | 97C147031CF9000F007C117D /* Debug */, 492 | 97C147041CF9000F007C117D /* Release */, 493 | 249021D3217E4FDB00AE95B9 /* Profile */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 499 | isa = XCConfigurationList; 500 | buildConfigurations = ( 501 | 97C147061CF9000F007C117D /* Debug */, 502 | 97C147071CF9000F007C117D /* Release */, 503 | 249021D4217E4FDB00AE95B9 /* Profile */, 504 | ); 505 | defaultConfigurationIsVisible = 0; 506 | defaultConfigurationName = Release; 507 | }; 508 | /* End XCConfigurationList section */ 509 | }; 510 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 511 | } 512 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 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 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al4fun/HorizontalNumberPicker/36c6d0a298e491109833eb59b64bf682fe4bd429/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_app 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(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 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/horizontal_numberpicker.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/rendering.dart'; 3 | import 'dart:ui' as ui; 4 | 5 | // ignore: must_be_immutable 6 | class HorizontalNumberPicker extends StatefulWidget { 7 | final int initialValue; 8 | final int minValue; 9 | final int maxValue; 10 | final int step; 11 | 12 | ///控件的宽度 13 | final int widgetWidth; 14 | 15 | ///控件的高度 16 | final int widgetHeight; 17 | 18 | ///大格的总数 19 | int gridCount; 20 | 21 | ///一大格中有多少个小格 22 | final int subGridCountPerGrid; 23 | 24 | ///大格的宽度 25 | int gridWidth; 26 | 27 | ///每一小格的宽度 28 | final int subGridWidth; 29 | 30 | int listViewItemCount; 31 | 32 | double paddingItemWidth; 33 | 34 | final void Function(int) onSelectedChanged; 35 | 36 | ///返回标尺刻度所展示的数值字符串 37 | String Function(int) scaleTransformer; 38 | 39 | ///刻度颜色 40 | final Color scaleColor; 41 | 42 | ///指示器颜色 43 | final Color indicatorColor; 44 | 45 | ///刻度文字颜色 46 | final Color scaleTextColor; 47 | 48 | HorizontalNumberPicker({ 49 | Key key, 50 | this.initialValue = 500, 51 | this.minValue = 100, 52 | this.maxValue = 900, 53 | this.step = 1, 54 | this.widgetWidth = 200, 55 | this.widgetHeight = 60, 56 | this.subGridCountPerGrid = 10, 57 | this.subGridWidth = 8, 58 | @required this.onSelectedChanged, 59 | this.scaleTransformer, 60 | this.scaleColor = const Color(0xFFE9E9E9), 61 | this.indicatorColor = const Color(0xFF3995FF), 62 | this.scaleTextColor = const Color(0xFF8E99A0), 63 | }) : super(key: key) { 64 | if (subGridCountPerGrid % 2 != 0) { 65 | throw Exception("subGridCountPerGrid必须是偶数"); 66 | } 67 | 68 | if ((maxValue - minValue) % step != 0) { 69 | throw Exception("(maxValue - minValue)必须是step的整数倍"); 70 | } 71 | int totalSubGridCount = (maxValue - minValue) ~/ step; 72 | 73 | if (totalSubGridCount % subGridCountPerGrid != 0) { 74 | throw Exception("(maxValue - minValue)~/step必须是subGridCountPerGrid的整数倍"); 75 | } 76 | //第一个grid和最后一个grid都只会展示一半数量的subGrid,因此gridCount需要+1 77 | gridCount = totalSubGridCount ~/ subGridCountPerGrid + 1; 78 | 79 | gridWidth = subGridWidth * subGridCountPerGrid; 80 | 81 | //每个grid都是listView的一个item 82 | //除此之外,在第一个grid之前和最后一个grid之后,还需要各填充一个空白item, 83 | //这样第一个item和最后一个item才能滚动到屏幕中间。 84 | listViewItemCount = gridCount + 2; 85 | 86 | //空白item的宽度 87 | paddingItemWidth = widgetWidth / 2 - gridWidth / 2; 88 | 89 | if (scaleTransformer == null) { 90 | scaleTransformer = (value) { 91 | return value.toString(); 92 | }; 93 | } 94 | } 95 | 96 | @override 97 | State createState() { 98 | return HorizontalNumberPickerState(); 99 | } 100 | } 101 | 102 | class HorizontalNumberPickerState extends State { 103 | ScrollController _scrollController; 104 | 105 | @override 106 | void initState() { 107 | super.initState(); 108 | 109 | _scrollController = ScrollController( 110 | //计算初始偏移量 111 | initialScrollOffset: (widget.initialValue - widget.minValue) / 112 | widget.step * 113 | widget.subGridWidth, 114 | ); 115 | } 116 | 117 | ///处理state的复用 118 | void didUpdateWidget(HorizontalNumberPicker oldWidget) { 119 | super.didUpdateWidget(oldWidget); 120 | 121 | _scrollController?.dispose(); 122 | _scrollController = ScrollController( 123 | //计算初始偏移量 124 | initialScrollOffset: (widget.initialValue - widget.minValue) / 125 | widget.step * 126 | widget.subGridWidth, 127 | ); 128 | } 129 | 130 | @override 131 | Widget build(BuildContext context) { 132 | return Container( 133 | width: widget.widgetWidth.toDouble(), 134 | height: widget.widgetHeight.toDouble(), 135 | child: Stack( 136 | alignment: Alignment.topCenter, 137 | children: [ 138 | NotificationListener( 139 | onNotification: _onNotification, 140 | child: ListView.builder( 141 | physics: ClampingScrollPhysics(), 142 | padding: EdgeInsets.all(0), 143 | controller: _scrollController, 144 | scrollDirection: Axis.horizontal, 145 | itemCount: widget.listViewItemCount, 146 | itemBuilder: (BuildContext context, int index) { 147 | //首尾空白元素 148 | if (index == 0 || index == widget.listViewItemCount - 1) { 149 | return Container( 150 | width: widget.paddingItemWidth, 151 | height: 0, 152 | ); 153 | //普通元素 154 | } else { 155 | int type; 156 | //第一个普通元素 157 | if (index == 1) { 158 | type = 0; 159 | //最后一个普通元素 160 | } else if (index == widget.listViewItemCount - 2) { 161 | type = 2; 162 | //中间普通元素 163 | } else { 164 | type = 1; 165 | } 166 | 167 | return Container( 168 | child: NumberPickerItem( 169 | subGridCount: widget.subGridCountPerGrid, 170 | subGridWidth: widget.subGridWidth, 171 | itemHeight: widget.widgetHeight, 172 | valueStr: widget.scaleTransformer(widget.minValue + 173 | (index - 1) * 174 | widget.subGridCountPerGrid * 175 | widget.step), 176 | type: type, 177 | scaleColor: widget.scaleColor, 178 | scaleTextColor: widget.scaleTextColor, 179 | ), 180 | ); 181 | } 182 | }, 183 | ), 184 | ), 185 | //指示器 186 | Container( 187 | width: 2, 188 | height: widget.widgetHeight / 2, 189 | color: widget.indicatorColor, 190 | ), 191 | ], 192 | ), 193 | ); 194 | } 195 | 196 | ///监听滚动通知 197 | bool _onNotification(Notification notification) { 198 | if (notification is ScrollNotification) { 199 | //距离widget中间最近的刻度值 200 | int centerValue = 201 | (notification.metrics.pixels / widget.subGridWidth).round() * 202 | widget.step + 203 | widget.minValue; 204 | 205 | // 通知回调选中值改变了 206 | widget.onSelectedChanged(centerValue); 207 | 208 | //若用户手指离开屏幕且列表的滚动停止,则滚动到centerValue 209 | if (_scrollingStopped(notification, _scrollController)) { 210 | select(centerValue); 211 | } 212 | } 213 | 214 | return true; //停止通知冒泡 215 | } 216 | 217 | ///判断是否用户手指离开屏幕且列表的滚动停止 218 | bool _scrollingStopped( 219 | Notification notification, 220 | ScrollController scrollController, 221 | ) { 222 | return notification is UserScrollNotification && 223 | notification.direction == ScrollDirection.idle && 224 | scrollController.position.activity is! HoldScrollActivity; 225 | } 226 | 227 | //public------------------------------------------------------------------------ 228 | 229 | ///选中值 230 | select(int valueToSelect) { 231 | _scrollController.animateTo( 232 | (valueToSelect - widget.minValue) / widget.step * widget.subGridWidth, 233 | duration: Duration(milliseconds: 200), 234 | curve: Curves.decelerate, 235 | ); 236 | } 237 | } 238 | 239 | //------------------------------------------------------------------------------ 240 | 241 | ///每个item中间为长刻度,并在下方显示数值。两边都是短刻度 242 | class NumberPickerItem extends StatelessWidget { 243 | final int subGridCount; 244 | final int subGridWidth; 245 | final int itemHeight; 246 | final String valueStr; 247 | 248 | //0:列表首item 1:中间item 2:尾item 249 | final int type; 250 | 251 | final Color scaleColor; 252 | final Color scaleTextColor; 253 | 254 | const NumberPickerItem({ 255 | Key key, 256 | @required this.subGridCount, 257 | @required this.subGridWidth, 258 | @required this.itemHeight, 259 | @required this.valueStr, 260 | @required this.type, 261 | @required this.scaleColor, 262 | @required this.scaleTextColor, 263 | }) : super(key: key); 264 | 265 | @override 266 | Widget build(BuildContext context) { 267 | double itemWidth = (subGridWidth * subGridCount).toDouble(); 268 | double itemHeight = this.itemHeight.toDouble(); 269 | 270 | return CustomPaint( 271 | size: Size(itemWidth, itemHeight), 272 | painter: MyPainter(this.subGridWidth, this.valueStr, this.type, 273 | this.scaleColor, this.scaleTextColor), 274 | ); 275 | } 276 | } 277 | 278 | class MyPainter extends CustomPainter { 279 | final int subGridWidth; 280 | 281 | final String valueStr; 282 | 283 | //0:列表首item 1:中间item 2:尾item 284 | final int type; 285 | 286 | final Color scaleColor; 287 | 288 | final Color scaleTextColor; 289 | 290 | Paint _linePaint; 291 | 292 | double _lineWidth = 2; 293 | 294 | MyPainter(this.subGridWidth, this.valueStr, this.type, this.scaleColor, 295 | this.scaleTextColor) { 296 | _linePaint = Paint() 297 | ..isAntiAlias = true 298 | ..style = PaintingStyle.stroke 299 | ..strokeWidth = _lineWidth 300 | ..color = scaleColor; 301 | } 302 | 303 | @override 304 | void paint(Canvas canvas, Size size) { 305 | drawLine(canvas, size); 306 | drawText(canvas, size); 307 | } 308 | 309 | void drawLine(Canvas canvas, Size size) { 310 | double startX, endX; 311 | switch (type) { 312 | case 0: //首元素只绘制右半部分 313 | startX = size.width / 2; 314 | endX = size.width; 315 | break; 316 | case 2: //尾元素只绘制左半部分 317 | startX = 0; 318 | endX = size.width / 2; 319 | break; 320 | default: //中间元素全部绘制 321 | startX = 0; 322 | endX = size.width; 323 | } 324 | 325 | //绘制横线 326 | canvas.drawLine(Offset(startX, 0 + _lineWidth / 2), 327 | Offset(endX, 0 + _lineWidth / 2), _linePaint); 328 | 329 | //绘制竖线 330 | for (double x = startX; x <= endX; x += subGridWidth) { 331 | if (x == size.width / 2) { 332 | //中间为长刻度 333 | canvas.drawLine( 334 | Offset(x, 0), Offset(x, size.height * 3 / 8), _linePaint); 335 | } else { 336 | //其他为短刻度 337 | canvas.drawLine(Offset(x, 0), Offset(x, size.height / 4), _linePaint); 338 | } 339 | } 340 | } 341 | 342 | void drawText(Canvas canvas, Size size) { 343 | //文字水平方向居中对齐,竖直方向底对齐 344 | ui.Paragraph p = _buildText(valueStr, size.width); 345 | //获得文字的宽高 346 | double halfWidth = p.minIntrinsicWidth / 2; 347 | double halfHeight = p.height / 2; 348 | canvas.drawParagraph( 349 | p, Offset(size.width / 2 - halfWidth, size.height - p.height)); 350 | } 351 | 352 | ui.Paragraph _buildText(String content, double maxWidth) { 353 | ui.ParagraphBuilder paragraphBuilder = 354 | ui.ParagraphBuilder(ui.ParagraphStyle()); 355 | paragraphBuilder.pushStyle( 356 | ui.TextStyle( 357 | fontSize: 14, 358 | color: this.scaleTextColor, 359 | //fontFamily: "Montserrat", 360 | ), 361 | ); 362 | paragraphBuilder.addText(content); 363 | 364 | ui.Paragraph paragraph = paragraphBuilder.build(); 365 | paragraph.layout(ui.ParagraphConstraints(width: maxWidth)); 366 | 367 | return paragraph; 368 | } 369 | 370 | @override 371 | bool shouldRepaint(CustomPainter oldDelegate) => false; 372 | } 373 | -------------------------------------------------------------------------------- /lib/horizontal_numberpicker_wrapper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'horizontal_numberpicker.dart'; 3 | 4 | ///对HorizontalNumberPicker进行简单包装,添加顶部的选中值显示和两边的半透明遮罩 5 | // ignore: must_be_immutable 6 | class HorizontalNumberPickerWrapper extends StatefulWidget { 7 | final int initialValue; 8 | final int minValue; 9 | final int maxValue; 10 | final int step; 11 | final String unit; 12 | 13 | ///控件的宽度 14 | final int widgetWidth; 15 | 16 | ///一大格中有多少个小格 17 | final int subGridCountPerGrid; 18 | 19 | ///每一小格的宽度 20 | final int subGridWidth; 21 | 22 | final void Function(int) onSelectedChanged; 23 | 24 | ///返回上方大标题所展示的数值字符串 25 | String Function(int) titleTransformer; 26 | 27 | ///返回标尺刻度所展示的数值字符串 28 | final String Function(int) scaleTransformer; 29 | 30 | ///标题文字颜色 31 | final Color titleTextColor; 32 | 33 | ///刻度颜色 34 | final Color scaleColor; 35 | 36 | ///指示器颜色 37 | final Color indicatorColor; 38 | 39 | ///刻度文字颜色 40 | final Color scaleTextColor; 41 | 42 | HorizontalNumberPickerWrapper({ 43 | Key key, 44 | this.initialValue = 500, 45 | this.minValue = 100, 46 | this.maxValue = 900, 47 | this.step = 1, 48 | this.unit = "", 49 | this.widgetWidth = 200, 50 | this.subGridCountPerGrid = 10, 51 | this.subGridWidth = 8, 52 | @required this.onSelectedChanged, 53 | this.titleTransformer, 54 | this.scaleTransformer, 55 | this.titleTextColor = const Color(0xFF3995FF), 56 | this.scaleColor = const Color(0xFFE9E9E9), 57 | this.indicatorColor = const Color(0xFF3995FF), 58 | this.scaleTextColor = const Color(0xFF8E99A0), 59 | }) : super(key: key) { 60 | if (titleTransformer == null) { 61 | titleTransformer = (value) { 62 | return value.toString(); 63 | }; 64 | } 65 | } 66 | 67 | @override 68 | State createState() { 69 | return HorizontalNumberPickerWrapperState(); 70 | } 71 | } 72 | 73 | class HorizontalNumberPickerWrapperState 74 | extends State { 75 | int _selectedValue; 76 | 77 | @override 78 | void initState() { 79 | super.initState(); 80 | _selectedValue = widget.initialValue; 81 | } 82 | 83 | ///处理state的复用 84 | void didUpdateWidget(HorizontalNumberPickerWrapper oldWidget) { 85 | super.didUpdateWidget(oldWidget); 86 | _selectedValue = widget.initialValue; 87 | } 88 | 89 | @override 90 | Widget build(BuildContext context) { 91 | int numberPickerHeight = 60; 92 | 93 | return Column( 94 | mainAxisSize: MainAxisSize.min, 95 | crossAxisAlignment: CrossAxisAlignment.center, 96 | children: [ 97 | //上方选中值 98 | Row( 99 | mainAxisSize: MainAxisSize.min, 100 | crossAxisAlignment: CrossAxisAlignment.baseline, 101 | textBaseline: TextBaseline.alphabetic, 102 | children: [ 103 | Text( 104 | widget.titleTransformer(_selectedValue), 105 | style: TextStyle( 106 | color: widget.titleTextColor, 107 | fontSize: 40, 108 | //fontFamily: "Montserrat", 109 | ), 110 | ), 111 | Text( 112 | ' ${widget.unit}', 113 | style: TextStyle( 114 | color: widget.titleTextColor, 115 | fontSize: 14, 116 | //fontFamily: "Montserrat", 117 | ), 118 | ), 119 | ], 120 | ), 121 | Container(width: 0, height: 10), 122 | //可滚动标尺 123 | Stack( 124 | children: [ 125 | HorizontalNumberPicker( 126 | initialValue: widget.initialValue, 127 | minValue: widget.minValue, 128 | maxValue: widget.maxValue, 129 | step: widget.step, 130 | widgetWidth: widget.widgetWidth, 131 | widgetHeight: numberPickerHeight, 132 | subGridCountPerGrid: widget.subGridCountPerGrid, 133 | subGridWidth: widget.subGridWidth, 134 | onSelectedChanged: (value) { 135 | widget.onSelectedChanged(value); 136 | setState(() { 137 | _selectedValue = value; 138 | }); 139 | }, 140 | scaleTransformer: widget.scaleTransformer, 141 | scaleColor: widget.scaleColor, 142 | indicatorColor: widget.indicatorColor, 143 | scaleTextColor: widget.scaleTextColor, 144 | ), 145 | //左右半透明遮罩 146 | Positioned( 147 | left: 0, 148 | child: Container( 149 | width: 20, 150 | height: numberPickerHeight.toDouble(), 151 | decoration: BoxDecoration( 152 | gradient: LinearGradient(colors: [ 153 | Colors.white.withOpacity(0.8), 154 | Colors.white.withOpacity(0) 155 | ]), 156 | ), 157 | ), 158 | ), 159 | Positioned( 160 | right: 0, 161 | child: Container( 162 | width: 20, 163 | height: numberPickerHeight.toDouble(), 164 | decoration: BoxDecoration( 165 | gradient: LinearGradient(colors: [ 166 | Colors.white.withOpacity(0), 167 | Colors.white.withOpacity(0.8) 168 | ]), 169 | ), 170 | ), 171 | ), 172 | ], 173 | ), 174 | ], 175 | ); 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:intl/intl.dart'; 3 | 4 | import 'horizontal_numberpicker_wrapper.dart'; 5 | 6 | void main() => runApp(MyApp()); 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | home: MyHomePage(), 13 | ); 14 | } 15 | } 16 | 17 | class MyHomePage extends StatefulWidget { 18 | MyHomePage({Key key}) : super(key: key); 19 | 20 | @override 21 | _MyHomePageState createState() => _MyHomePageState(); 22 | } 23 | 24 | class _MyHomePageState extends State { 25 | NumberFormat _numberFormat = NumberFormat(',000'); 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | backgroundColor: Colors.white, 31 | body: SingleChildScrollView( 32 | scrollDirection: Axis.vertical, 33 | child: Container( 34 | width: double.infinity, 35 | margin: EdgeInsets.symmetric(vertical: 40), 36 | child: Column( 37 | mainAxisSize: MainAxisSize.min, 38 | crossAxisAlignment: CrossAxisAlignment.center, 39 | children: [ 40 | HorizontalNumberPickerWrapper( 41 | initialValue: 160, 42 | minValue: 100, 43 | maxValue: 200, 44 | step: 1, 45 | unit: 'CM', 46 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 47 | subGridCountPerGrid: 10, 48 | subGridWidth: 8, 49 | onSelectedChanged: (value) { 50 | print(value); 51 | }, 52 | ), 53 | Container(height: 10), 54 | HorizontalNumberPickerWrapper( 55 | initialValue: 600, 56 | minValue: 100, 57 | maxValue: 1500, 58 | step: 1, 59 | unit: 'KG', 60 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 61 | subGridCountPerGrid: 10, 62 | subGridWidth: 8, 63 | onSelectedChanged: (value) { 64 | print(value / 10); 65 | }, 66 | titleTransformer: (value) { 67 | return formatIntegerStr(value / 10); 68 | }, 69 | scaleTransformer: (value) { 70 | return formatIntegerStr(value / 10); 71 | }, 72 | ), 73 | Container(height: 10), 74 | HorizontalNumberPickerWrapper( 75 | initialValue: 100, 76 | minValue: 0, 77 | maxValue: 300, 78 | step: 1, 79 | unit: 'mmHg', 80 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 81 | subGridCountPerGrid: 2, 82 | subGridWidth: 20, 83 | onSelectedChanged: (value) { 84 | print(value); 85 | }, 86 | ), 87 | Container(height: 10), 88 | HorizontalNumberPickerWrapper( 89 | initialValue: 80, 90 | minValue: 10, 91 | maxValue: 250, 92 | step: 1, 93 | unit: 'mmol/L', 94 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 95 | subGridCountPerGrid: 2, 96 | subGridWidth: 20, 97 | onSelectedChanged: (value) { 98 | print(value / 10); 99 | }, 100 | titleTransformer: (value) { 101 | return formatIntegerStr(value / 10); 102 | }, 103 | scaleTransformer: (value) { 104 | return formatIntegerStr(value / 10); 105 | }, 106 | ), 107 | Container(height: 10), 108 | HorizontalNumberPickerWrapper( 109 | initialValue: 6000, 110 | minValue: 1000, 111 | maxValue: 21000, 112 | step: 1000, 113 | unit: '步', 114 | widgetWidth: MediaQuery.of(context).size.width.round() - 30, 115 | subGridCountPerGrid: 2, 116 | subGridWidth: 20, 117 | onSelectedChanged: (value) { 118 | print(value); 119 | }, 120 | titleTransformer: (value) { 121 | return _numberFormat.format(value); 122 | }, 123 | scaleTransformer: (value) { 124 | return '${value ~/ 1000}k'; 125 | }, 126 | ), 127 | ], 128 | ), 129 | ), 130 | ), // This trailing comma makes auto-formatting nicer for build methods. 131 | ); 132 | } 133 | } 134 | 135 | ///去掉整数后的小数点和0 136 | ///1.0 -> "1" 137 | ///1.2 -> "1.2" 138 | String formatIntegerStr(num number) { 139 | int intNumber = number.truncate(); 140 | 141 | //是整数 142 | if (intNumber == number) { 143 | return intNumber.toString(); 144 | } else { 145 | return number.toString(); 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /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.flutter-io.cn" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "2.4.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.0.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.flutter-io.cn" 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.flutter-io.cn" 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.flutter-io.cn" 82 | source: hosted 83 | version: "2.1.4" 84 | intl: 85 | dependency: "direct main" 86 | description: 87 | name: intl 88 | url: "https://pub.flutter-io.cn" 89 | source: hosted 90 | version: "0.16.1" 91 | matcher: 92 | dependency: transitive 93 | description: 94 | name: matcher 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "0.12.6" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.flutter-io.cn" 103 | source: hosted 104 | version: "1.1.8" 105 | path: 106 | dependency: transitive 107 | description: 108 | name: path 109 | url: "https://pub.flutter-io.cn" 110 | source: hosted 111 | version: "1.6.4" 112 | pedantic: 113 | dependency: transitive 114 | description: 115 | name: pedantic 116 | url: "https://pub.flutter-io.cn" 117 | source: hosted 118 | version: "1.8.0+1" 119 | petitparser: 120 | dependency: transitive 121 | description: 122 | name: petitparser 123 | url: "https://pub.flutter-io.cn" 124 | source: hosted 125 | version: "2.4.0" 126 | quiver: 127 | dependency: transitive 128 | description: 129 | name: quiver 130 | url: "https://pub.flutter-io.cn" 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.flutter-io.cn" 143 | source: hosted 144 | version: "1.5.5" 145 | stack_trace: 146 | dependency: transitive 147 | description: 148 | name: stack_trace 149 | url: "https://pub.flutter-io.cn" 150 | source: hosted 151 | version: "1.9.3" 152 | stream_channel: 153 | dependency: transitive 154 | description: 155 | name: stream_channel 156 | url: "https://pub.flutter-io.cn" 157 | source: hosted 158 | version: "2.0.0" 159 | string_scanner: 160 | dependency: transitive 161 | description: 162 | name: string_scanner 163 | url: "https://pub.flutter-io.cn" 164 | source: hosted 165 | version: "1.0.5" 166 | term_glyph: 167 | dependency: transitive 168 | description: 169 | name: term_glyph 170 | url: "https://pub.flutter-io.cn" 171 | source: hosted 172 | version: "1.1.0" 173 | test_api: 174 | dependency: transitive 175 | description: 176 | name: test_api 177 | url: "https://pub.flutter-io.cn" 178 | source: hosted 179 | version: "0.2.11" 180 | typed_data: 181 | dependency: transitive 182 | description: 183 | name: typed_data 184 | url: "https://pub.flutter-io.cn" 185 | source: hosted 186 | version: "1.1.6" 187 | vector_math: 188 | dependency: transitive 189 | description: 190 | name: vector_math 191 | url: "https://pub.flutter-io.cn" 192 | source: hosted 193 | version: "2.0.8" 194 | xml: 195 | dependency: transitive 196 | description: 197 | name: xml 198 | url: "https://pub.flutter-io.cn" 199 | source: hosted 200 | version: "3.5.0" 201 | sdks: 202 | dart: ">=2.5.0 <3.0.0" 203 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_app 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 | intl: ^0.16.0 21 | flutter: 22 | sdk: flutter 23 | 24 | # The following adds the Cupertino Icons font to your application. 25 | # Use with the CupertinoIcons class for iOS style icons. 26 | cupertino_icons: ^0.1.2 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 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_app/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 | --------------------------------------------------------------------------------