Repository: iosyaowei/wechat_clone_flutter Branch: master Commit: 4cf1af33572c Files: 52 Total size: 94.2 KB Directory structure: gitextract_5nni6xaj/ ├── .gitignore ├── .metadata ├── README.md ├── android/ │ ├── .gitignore │ ├── app/ │ │ ├── build.gradle │ │ └── src/ │ │ ├── debug/ │ │ │ └── AndroidManifest.xml │ │ ├── main/ │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin/ │ │ │ │ └── com/ │ │ │ │ └── example/ │ │ │ │ └── flutter_wechat_clone/ │ │ │ │ └── MainActivity.kt │ │ │ └── res/ │ │ │ ├── drawable/ │ │ │ │ └── launch_background.xml │ │ │ ├── drawable-v21/ │ │ │ │ └── launch_background.xml │ │ │ ├── values/ │ │ │ │ └── styles.xml │ │ │ └── values-night/ │ │ │ └── styles.xml │ │ └── profile/ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ └── settings.gradle ├── ios/ │ ├── .gitignore │ ├── Flutter/ │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner/ │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets/ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.imageset/ │ │ │ ├── Contents.json │ │ │ └── README.md │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h │ ├── Runner.xcodeproj/ │ │ ├── project.pbxproj │ │ ├── project.xcworkspace/ │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata/ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── Runner.xcscheme │ └── Runner.xcworkspace/ │ ├── contents.xcworkspacedata │ └── xcshareddata/ │ ├── IDEWorkspaceChecks.plist │ └── WorkspaceSettings.xcsettings ├── lib/ │ ├── constants.dart │ ├── main.dart │ ├── model/ │ │ ├── contacts.dart │ │ └── conversation.dart │ ├── pages/ │ │ ├── contacts_page.dart │ │ ├── conversation_page.dart │ │ ├── discover_page.dart │ │ ├── main_page.dart │ │ └── profile_page.dart │ └── widgets/ │ └── full_width_button.dart ├── pubspec.yaml ├── test/ │ └── widget_test.dart └── web/ ├── index.html └── manifest.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Miscellaneous *.class *.log *.pyc *.swp .DS_Store .atom/ .buildlog/ .history .svn/ # IntelliJ related *.iml *.ipr *.iws .idea/ # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. #.vscode/ # Flutter/Dart/Pub related **/doc/api/ **/ios/Flutter/.last_build_id .dart_tool/ .flutter-plugins .flutter-plugins-dependencies .packages .pub-cache/ .pub/ /build/ # Web related lib/generated_plugin_registrant.dart # Symbolication related app.*.symbols # Obfuscation related app.*.map.json # Android Studio will place build artifacts here /android/app/debug /android/app/profile /android/app/release ================================================ FILE: .metadata ================================================ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled and should not be manually edited. version: revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 channel: stable project_type: app ================================================ FILE: README.md ================================================ # flutter_wechat_clone A new Flutter project. ## Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is your first Flutter project: - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) For help getting started with Flutter, view our [online documentation](https://flutter.dev/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference. ================================================ FILE: android/.gitignore ================================================ gradle-wrapper.jar /.gradle /captures/ /gradlew /gradlew.bat /local.properties GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app key.properties ================================================ FILE: android/app/build.gradle ================================================ def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 30 sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.flutter_wechat_clone" minSdkVersion 16 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } ================================================ FILE: android/app/src/debug/AndroidManifest.xml ================================================ ================================================ FILE: android/app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: android/app/src/main/kotlin/com/example/flutter_wechat_clone/MainActivity.kt ================================================ package com.example.flutter_wechat_clone import io.flutter.embedding.android.FlutterActivity class MainActivity: FlutterActivity() { } ================================================ FILE: android/app/src/main/res/drawable/launch_background.xml ================================================ ================================================ FILE: android/app/src/main/res/drawable-v21/launch_background.xml ================================================ ================================================ FILE: android/app/src/main/res/values/styles.xml ================================================ ================================================ FILE: android/app/src/main/res/values-night/styles.xml ================================================ ================================================ FILE: android/app/src/profile/AndroidManifest.xml ================================================ ================================================ FILE: android/build.gradle ================================================ buildscript { ext.kotlin_version = '1.3.50' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:4.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { google() jcenter() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" project.evaluationDependsOn(':app') } task clean(type: Delete) { delete rootProject.buildDir } ================================================ FILE: android/gradle/wrapper/gradle-wrapper.properties ================================================ #Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip ================================================ FILE: android/gradle.properties ================================================ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true ================================================ FILE: android/settings.gradle ================================================ include ':app' def localPropertiesFile = new File(rootProject.projectDir, "local.properties") def properties = new Properties() assert localPropertiesFile.exists() localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" ================================================ FILE: ios/.gitignore ================================================ *.mode1v3 *.mode2v3 *.moved-aside *.pbxuser *.perspectivev3 **/*sync/ .sconsign.dblite .tags* **/.vagrant/ **/DerivedData/ Icon? **/Pods/ **/.symlinks/ profile xcuserdata **/.generated/ Flutter/App.framework Flutter/Flutter.framework Flutter/Flutter.podspec Flutter/Generated.xcconfig Flutter/ephemeral/ Flutter/app.flx Flutter/app.zip Flutter/flutter_assets/ Flutter/flutter_export_environment.sh ServiceDefinitions.json Runner/GeneratedPluginRegistrant.* # Exceptions to above rules. !default.mode1v3 !default.mode2v3 !default.pbxuser !default.perspectivev3 ================================================ FILE: ios/Flutter/AppFrameworkInfo.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable App CFBundleIdentifier io.flutter.flutter.app CFBundleInfoDictionaryVersion 6.0 CFBundleName App CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 MinimumOSVersion 8.0 ================================================ FILE: ios/Flutter/Debug.xcconfig ================================================ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" ================================================ FILE: ios/Flutter/Release.xcconfig ================================================ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" ================================================ FILE: ios/Podfile ================================================ # Uncomment this line to define a global platform for your project # platform :ios, '9.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end ================================================ FILE: ios/Runner/AppDelegate.swift ================================================ import UIKit import Flutter @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ================================================ FILE: ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "size" : "20x20", "idiom" : "iphone", "filename" : "Icon-App-20x20@2x.png", "scale" : "2x" }, { "size" : "20x20", "idiom" : "iphone", "filename" : "Icon-App-20x20@3x.png", "scale" : "3x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@1x.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@2x.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@3x.png", "scale" : "3x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "Icon-App-40x40@2x.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "Icon-App-40x40@3x.png", "scale" : "3x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "Icon-App-60x60@2x.png", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "Icon-App-60x60@3x.png", "scale" : "3x" }, { "size" : "20x20", "idiom" : "ipad", "filename" : "Icon-App-20x20@1x.png", "scale" : "1x" }, { "size" : "20x20", "idiom" : "ipad", "filename" : "Icon-App-20x20@2x.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "Icon-App-29x29@1x.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "Icon-App-29x29@2x.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "Icon-App-40x40@1x.png", "scale" : "1x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "Icon-App-40x40@2x.png", "scale" : "2x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "Icon-App-76x76@1x.png", "scale" : "1x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "Icon-App-76x76@2x.png", "scale" : "2x" }, { "size" : "83.5x83.5", "idiom" : "ipad", "filename" : "Icon-App-83.5x83.5@2x.png", "scale" : "2x" }, { "size" : "1024x1024", "idiom" : "ios-marketing", "filename" : "Icon-App-1024x1024@1x.png", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "filename" : "LaunchImage.png", "scale" : "1x" }, { "idiom" : "universal", "filename" : "LaunchImage@2x.png", "scale" : "2x" }, { "idiom" : "universal", "filename" : "LaunchImage@3x.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md ================================================ # Launch Screen Assets You can customize the launch screen with your own desired assets by replacing the image files in this directory. 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. ================================================ FILE: ios/Runner/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: ios/Runner/Base.lproj/Main.storyboard ================================================ ================================================ FILE: ios/Runner/Info.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName flutter_wechat_clone CFBundlePackageType APPL CFBundleShortVersionString $(FLUTTER_BUILD_NAME) CFBundleSignature ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance ================================================ FILE: ios/Runner/Runner-Bridging-Header.h ================================================ #import "GeneratedPluginRegistrant.h" ================================================ FILE: ios/Runner.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; BC855B25829D08A6E9AEA9ED /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC958AAAFC3FC331F3F85D0A /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 5F46BE8AF9301476435AC0E0 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 862A1027280452E6684BAE7B /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B672AAAAA105BEDC65F98A1B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; BC958AAAFC3FC331F3F85D0A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BC855B25829D08A6E9AEA9ED /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 959031C05C79CDAD9D620797 /* Frameworks */ = { isa = PBXGroup; children = ( BC958AAAFC3FC331F3F85D0A /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, ); name = Flutter; sourceTree = ""; }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, A4E57281CD2BB1B021512958 /* Pods */, 959031C05C79CDAD9D620797 /* Frameworks */, ); sourceTree = ""; }; 97C146EF1CF9000F007C117D /* Products */ = { isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, ); name = Products; sourceTree = ""; }; 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; A4E57281CD2BB1B021512958 /* Pods */ = { isa = PBXGroup; children = ( B672AAAAA105BEDC65F98A1B /* Pods-Runner.debug.xcconfig */, 5F46BE8AF9301476435AC0E0 /* Pods-Runner.release.xcconfig */, 862A1027280452E6684BAE7B /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( 395690F9EEACF6DD06AF64D9 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, FE4B05D0A457BCC38C497F27 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Runner; productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 1020; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 97C146E51CF9000F007C117D; productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 395690F9EEACF6DD06AF64D9 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( ); outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; FE4B05D0A457BCC38C497F27 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 97C146FB1CF9000F007C117D /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 97C147001CF9000F007C117D /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Profile; }; 249021D4217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWechatClone; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Profile; }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 97C147061CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWechatClone; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; 97C147071CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWechatClone; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147031CF9000F007C117D /* Debug */, 97C147041CF9000F007C117D /* Release */, 249021D3217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147061CF9000F007C117D /* Debug */, 97C147071CF9000F007C117D /* Release */, 249021D4217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme ================================================ ================================================ FILE: ios/Runner.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: lib/constants.dart ================================================ import 'package:flutter/material.dart'; class AppColors { static const BackgroundColor = Color(0xffebebeb); static const AppBarColor = Color(0xff303030); static const TabIconNormal = Color(0xff999999); static const TabIconActive = Color(0xff46c11b); static const AppBarPopupMenuColor = Color(0xffffffff); static const TitleColor = Color(0xff353535); static const ConversationItemBgColor = Color(0xffffffff); static const DescTextColor = Color(0xff9e9e9e); static const DividerColor = Color(0xffd9d9d9); static const NotifyDotBgColor = Color(0xffff3e3e); static const NotifyDotText = Color(0xffffffff); static const ConversationMuteIconColor = Color(0xffd8d8d8); static const DeviceInfoItemBgColor = Color(0xfff5f5f5); static const DeviceInfoItemTextColor = Color(0xff606062); static const DeviceInfoItemIconColor = Color(0xff606062); static const ContactGroupTitleBgColor = Color(0xffebebeb); static const ContactGroupTitleColor = Color(0xff888888); static const IndexLetterBoxBgColor = Colors.black45; } class AppStyles { static const TitleStyle = TextStyle( fontSize: 14.0, color: AppColors.TitleColor, ); static const DescStyle = TextStyle( fontSize: 12.0, color: AppColors.DescTextColor, ); static const UnreadMsgCountDotStyle = TextStyle( fontSize: 12.0, color: AppColors.NotifyDotText, ); static const DeviceInfoItemTextStyle = TextStyle( fontSize: 13.0, color: AppColors.DeviceInfoItemTextColor, ); static const GroupTitleItemTextStyle = TextStyle( fontSize: 14.0, color: AppColors.ContactGroupTitleColor, ); static const IndexLetterBoxTextStyle = TextStyle( fontSize: 64.0, color: Colors.white, ); } class Constants { static const IconFontFamily = "appIconFont"; static const ConversationAvatarSize = 48.0; static const DividerWidth = 0.5; static const UnReadMsgNotifyDotSize = 20.0; static const ConversationMuteIcon = 18.0; static const ContactAvatarSize = 36.0; static const IndexBarWidth = 24.0; static const IndexLetterBoxSize = 114.0; static const IndexLetterBoxRadius = 4.0; static const FullWidthIconButtonIconSize = 24.0; static const ProfileHeaderIconSize = 60.0; static const ConversationAvatarDefaultIocn = Icon( IconData( 0xe642, fontFamily: IconFontFamily, ), size: ConversationAvatarSize, ); static const ContactAvatarDefaultIocn = Icon( IconData( 0xe642, fontFamily: IconFontFamily, ), size: ContactAvatarSize, ); static const ProfileAvatarDefaultIocn = Icon( IconData( 0xe642, fontFamily: IconFontFamily, ), size: ProfileHeaderIconSize, ); } ================================================ FILE: lib/main.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_wechat_clone/constants.dart'; import 'package:flutter_wechat_clone/pages/main_page.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: '微信', theme: ThemeData( primaryColor: AppColors.AppBarColor, cardColor: AppColors.AppBarColor), home: MainPage(), ); } } ================================================ FILE: lib/model/contacts.dart ================================================ class Contact { const Contact({ required this.avatar, required this.name, required this.nameIndex, }); final String avatar; final String name; final String nameIndex; } class ContactsPageData { final List contacts = [ const Contact( avatar: 'https://randomuser.me/api/portraits/men/53.jpg', name: 'Maurice Sutton', nameIndex: 'M', ), const Contact( avatar: 'https://randomuser.me/api/portraits/women/76.jpg', name: 'Jerry', nameIndex: 'J', ), const Contact( avatar: 'https://randomuser.me/api/portraits/women/17.jpg', name: 'Dangdang', nameIndex: 'D', ), const Contact( avatar: 'https://randomuser.me/api/portraits/women/55.jpg', name: 'Teddy', nameIndex: 'T', ), const Contact( avatar: 'https://randomuser.me/api/portraits/women/11.jpg', name: 'Steave', nameIndex: 'S', ), const Contact( avatar: 'https://randomuser.me/api/portraits/women/65.jpg', name: 'Vivian', nameIndex: 'V', ), const Contact( avatar: 'https://randomuser.me/api/portraits/women/50.jpg', name: 'Mary', nameIndex: 'M', ), const Contact( avatar: 'https://randomuser.me/api/portraits/women/91.jpg', name: 'David', nameIndex: 'D', ), const Contact( avatar: 'https://randomuser.me/api/portraits/women/60.jpg', name: 'Bob', nameIndex: 'B', ), const Contact( avatar: 'https://randomuser.me/api/portraits/men/60.jpg', name: 'Jeff Green', nameIndex: 'J', ), const Contact( avatar: 'https://randomuser.me/api/portraits/men/45.jpg', name: 'Adam', nameIndex: 'A', ), const Contact( avatar: 'https://randomuser.me/api/portraits/men/7.jpg', name: 'Michel', nameIndex: 'M', ), const Contact( avatar: 'https://randomuser.me/api/portraits/men/35.jpg', name: 'Green', nameIndex: 'G', ), const Contact( avatar: 'https://randomuser.me/api/portraits/men/64.jpg', name: 'Jack Ma', nameIndex: 'J', ), const Contact( avatar: 'https://randomuser.me/api/portraits/men/86.jpg', name: 'Tom', nameIndex: 'T', ), const Contact( avatar: 'https://randomuser.me/api/portraits/men/31.jpg', name: 'Zat', nameIndex: 'Z', ), const Contact( avatar: 'https://randomuser.me/api/portraits/women/13.jpg', name: 'Zlia', nameIndex: 'Z', ), ]; static ContactsPageData mock() { return ContactsPageData(); } } ================================================ FILE: lib/model/conversation.dart ================================================ import 'package:flutter/material.dart'; import '../constants.dart'; enum Device { MAC, WIN } class Conversation { final String avatar; final String title; final Color titleColor; final String desc; final String updateAt; final bool isMute; final int unreadMsgCount; final bool dispalyDot; const Conversation( {required this.avatar, required this.title, this.titleColor: AppColors.TitleColor, required this.desc, required this.updateAt, this.isMute: false, this.unreadMsgCount: 0, this.dispalyDot: false}); bool isAvatarFromNet() { if (this.avatar.indexOf('http') == 0 || this.avatar.indexOf('https') == 0) { return true; } return false; } } class ConversationPageData { const ConversationPageData({ this.device, required this.conversations, }); final Device? device; final List conversations; static mock() { return ConversationPageData( device: Device.WIN, conversations: mockConversations); } static List mockConversations = [ const Conversation( avatar: 'assets/images/ic_file_transfer.png', title: '文件传输助手', desc: '', updateAt: '19:56', ), const Conversation( avatar: 'assets/images/ic_tx_news.png', title: '腾讯新闻', desc: '豪车与出租车刮擦 俩车主划拳定责', updateAt: '17:20', ), const Conversation( avatar: 'assets/images/ic_wx_games.png', title: '微信游戏', titleColor: Color(0xff586b95), desc: '25元现金助力开学季!', updateAt: '17:12', ), const Conversation( avatar: 'https://randomuser.me/api/portraits/men/10.jpg', title: '汤姆丁', desc: '今晚要一起去吃肯德基吗?', updateAt: '17:56', isMute: true, unreadMsgCount: 0, ), const Conversation( avatar: 'https://randomuser.me/api/portraits/women/10.jpg', title: 'Tina Morgan', desc: '晚自习是什么来着?你知道吗,看到的话赶紧回复我', updateAt: '17:58', isMute: false, unreadMsgCount: 3, ), const Conversation( avatar: 'assets/images/ic_fengchao.png', title: '蜂巢智能柜', titleColor: Color(0xff586b95), desc: '喷一喷,竟比洗牙还神奇!5秒钟还你一个漂亮洁白的口腔。', updateAt: '17:12', ), const Conversation( avatar: 'https://randomuser.me/api/portraits/women/57.jpg', title: 'Lily', desc: '今天要去运动场锻炼吗?', updateAt: '昨天', isMute: false, unreadMsgCount: 99, ), const Conversation( avatar: 'https://randomuser.me/api/portraits/men/10.jpg', title: '汤姆丁', desc: '今晚要一起去吃肯德基吗?', updateAt: '17:56', isMute: true, unreadMsgCount: 0, ), const Conversation( avatar: 'https://randomuser.me/api/portraits/women/10.jpg', title: 'Tina Morgan', desc: '晚自习是什么来着?你知道吗,看到的话赶紧回复我', updateAt: '17:58', isMute: false, unreadMsgCount: 3, ), const Conversation( avatar: 'https://randomuser.me/api/portraits/women/57.jpg', title: 'Lily', desc: '今天要去运动场锻炼吗?', updateAt: '昨天', isMute: false, unreadMsgCount: 0, ), const Conversation( avatar: 'https://randomuser.me/api/portraits/men/10.jpg', title: '汤姆丁', desc: '今晚要一起去吃肯德基吗?', updateAt: '17:56', isMute: true, unreadMsgCount: 0, ), const Conversation( avatar: 'https://randomuser.me/api/portraits/women/10.jpg', title: 'Tina Morgan', desc: '晚自习是什么来着?你知道吗,看到的话赶紧回复我', updateAt: '17:58', isMute: false, unreadMsgCount: 1, ), const Conversation( avatar: 'https://randomuser.me/api/portraits/women/57.jpg', title: 'Lily', desc: '今天要去运动场锻炼吗?', updateAt: '昨天', isMute: false, unreadMsgCount: 0, ), ]; } ================================================ FILE: lib/pages/contacts_page.dart ================================================ import 'package:flutter/material.dart'; import '../constants.dart'; import '../model/contacts.dart' show Contact, ContactsPageData; import 'package:cached_network_image/cached_network_image.dart'; @immutable class _ContactItem extends StatelessWidget { _ContactItem({ required this.avatar, required this.title, this.groupTitle, required this.onPressed, }); final String avatar; final String title; final String? groupTitle; final VoidCallback onPressed; static const double MARGIN_VERTICAL = 10.0; static const double GROUP_TITLE_HEIGHT = 24.0; bool get _isAvatarFromNet { return this.avatar.startsWith('http') || this.avatar.startsWith("https"); } static double _height(bool hasGroupTitle) { final _buttonHeight = MARGIN_VERTICAL * 2 + Constants.ContactAvatarSize + Constants.DividerWidth; if (hasGroupTitle) { return _buttonHeight + GROUP_TITLE_HEIGHT; } else { return _buttonHeight; } } @override Widget build(BuildContext context) { Widget _avatarIcon; if (_isAvatarFromNet) { _avatarIcon = CachedNetworkImage( imageUrl: this.avatar, placeholder: (context, url) => Constants.ContactAvatarDefaultIocn, width: Constants.ContactAvatarSize, height: Constants.ContactAvatarSize, errorWidget: (context, url, msg) => Constants.ContactAvatarDefaultIocn, ); } else { _avatarIcon = Image.asset( this.avatar, width: Constants.ContactAvatarSize, height: Constants.ContactAvatarSize, ); } Widget _button = Container( margin: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(vertical: MARGIN_VERTICAL), decoration: BoxDecoration( border: Border( bottom: BorderSide( width: Constants.DividerWidth, color: AppColors.DividerColor), )), child: Row( children: [ _avatarIcon, SizedBox(width: 10.0), Text(title), ], ), ); //分组标签 Widget _itemBody; if (this.groupTitle != null) { _itemBody = Column( children: [ Container( height: GROUP_TITLE_HEIGHT, padding: EdgeInsets.only(left: 16.0, right: 16.0), color: AppColors.ContactGroupTitleBgColor, alignment: Alignment.centerLeft, child: Text(this.groupTitle!, style: AppStyles.GroupTitleItemTextStyle), ), _button, ], ); } else { _itemBody = _button; } return _itemBody; } } const INDEX_BAR_WORDS = [ "↑", "☆", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ]; // ignore: must_be_immutable class ContactsPage extends StatefulWidget { Color _indexBarBgColor = Colors.transparent; String _currentLetter = ''; @override _ContactsPageState createState() => _ContactsPageState(); } class _ContactsPageState extends State { late ScrollController _scrollController; final ContactsPageData data = ContactsPageData.mock(); final List _contacts = []; final List<_ContactItem> _functionButtons = [ _ContactItem( avatar: 'assets/images/ic_new_friend.png', title: '新的朋友', onPressed: () { print("添加新朋友"); }), _ContactItem( avatar: 'assets/images/ic_group_chat.png', title: '群聊', onPressed: () { print("点击了群聊"); }), _ContactItem( avatar: 'assets/images/ic_tag.png', title: '标签', onPressed: () { print("点击了标签"); }), _ContactItem( avatar: 'assets/images/ic_public_account.png', title: '公众号', onPressed: () { print("添加公众号"); }), ]; final Map _letterPosMap = {INDEX_BAR_WORDS[0]: 0.0}; @override void initState() { super.initState(); _contacts ..addAll(data.contacts) ..addAll(data.contacts) ..addAll(data.contacts); _contacts .sort((Contact a, Contact b) => a.nameIndex.compareTo(b.nameIndex)); _scrollController = new ScrollController(); //计算用于 IndexBar 进行定位的关键通讯录列表项的位置 var _totalPos = _functionButtons.length * _ContactItem._height(false); for (var i = 0; i < _contacts.length; i++) { bool _hasGroupTitle = true; if (i > 0 && _contacts[i].nameIndex.compareTo(_contacts[i - 1].nameIndex) == 0) { _hasGroupTitle = false; } if (_hasGroupTitle) { _letterPosMap[_contacts[i].nameIndex] = _totalPos; } _totalPos += _ContactItem._height(_hasGroupTitle); } } @override void dispose() { _scrollController.dispose(); super.dispose(); } String getLetter(BuildContext context, double tileHeight, Offset globalPos) { RenderBox _box = context.findRenderObject() as RenderBox; var local = _box.globalToLocal(globalPos); int index = (local.dy ~/ tileHeight).clamp(0, INDEX_BAR_WORDS.length - 1); return INDEX_BAR_WORDS[index]; } void _jumpToIndex(String letter) { if (_letterPosMap.isNotEmpty) { final _pos = _letterPosMap[letter]; if (_pos != null) { _scrollController.animateTo(_letterPosMap[letter], curve: Curves.easeInOut, duration: Duration(microseconds: 200)); } } } Widget _buildIndexBar(BuildContext context, BoxConstraints constraints) { final List _letters = INDEX_BAR_WORDS.map((String word) { return Expanded(child: Text(word)); }).toList(); final _totalHeight = constraints.biggest.height; final _tileHeight = _totalHeight / _letters.length; print(_totalHeight); return GestureDetector( onVerticalDragDown: (DragDownDetails details) { setState(() { widget._indexBarBgColor = Colors.black26; widget._currentLetter = getLetter(context, _tileHeight, details.globalPosition); _jumpToIndex(widget._currentLetter); }); }, onVerticalDragEnd: (DragEndDetails details) { setState(() { widget._indexBarBgColor = Colors.transparent; widget._currentLetter = ''; }); }, onVerticalDragCancel: () { setState(() { widget._indexBarBgColor = Colors.transparent; widget._currentLetter = ''; }); }, onVerticalDragUpdate: (DragUpdateDetails details) { setState(() { widget._currentLetter = getLetter(context, _tileHeight, details.globalPosition); _jumpToIndex(widget._currentLetter); }); }, child: Column( children: _letters, ), ); } @override Widget build(BuildContext context) { final List _body = [ ListView.builder( controller: _scrollController, itemBuilder: (BuildContext context, int index) { if (index < _functionButtons.length) { return _functionButtons[index]; } int _contactIndex = index - _functionButtons.length; bool _isGroupTitle = true; Contact _contact = _contacts[_contactIndex]; if (_contactIndex >= 1 && _contact.nameIndex == _contacts[_contactIndex - 1].nameIndex) { _isGroupTitle = false; } return _ContactItem( avatar: _contact.avatar, title: _contact.name, groupTitle: _isGroupTitle ? _contact.nameIndex : null, onPressed: () {}, ); }, itemCount: _contacts.length + _functionButtons.length, ), Positioned( width: Constants.IndexBarWidth, right: 0.0, top: 0.0, bottom: 0.0, child: Container( color: widget._indexBarBgColor, child: LayoutBuilder( builder: _buildIndexBar, ), ), ) ]; if (widget._currentLetter.isNotEmpty) { _body.add(Center( child: Container( width: Constants.IndexLetterBoxSize, height: Constants.IndexLetterBoxSize, decoration: BoxDecoration( color: AppColors.IndexLetterBoxBgColor, borderRadius: BorderRadius.all( Radius.circular(Constants.IndexLetterBoxRadius)), ), child: Center( child: Text(widget._currentLetter, style: AppStyles.IndexLetterBoxTextStyle), ), ), )); } return Stack( children: _body, ); } } ================================================ FILE: lib/pages/conversation_page.dart ================================================ import 'package:flutter/material.dart'; import '../constants.dart' show AppColors, AppStyles, Constants; import '../model/conversation.dart'; import 'package:cached_network_image/cached_network_image.dart'; class _ConversationItem extends StatelessWidget { const _ConversationItem({required this.conversation}); final Conversation conversation; @override Widget build(BuildContext context) { Widget avatar; if (conversation.isAvatarFromNet()) { avatar = CachedNetworkImage( imageUrl: conversation.avatar, placeholder: (context, msg) => Constants.ConversationAvatarDefaultIocn, width: Constants.ConversationAvatarSize, height: Constants.ConversationAvatarSize, ); } else { avatar = Image.asset( conversation.avatar, width: Constants.ConversationAvatarSize, height: Constants.ConversationAvatarSize, ); } Widget avatarContainer; if (conversation.unreadMsgCount > 0) { // 未读消息角标 Widget unreadMsgCountText = Container( width: Constants.UnReadMsgNotifyDotSize, height: Constants.UnReadMsgNotifyDotSize, alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(Constants.UnReadMsgNotifyDotSize / 2.0), color: AppColors.NotifyDotBgColor, ), child: Text(conversation.unreadMsgCount.toString(), style: AppStyles.UnreadMsgCountDotStyle), ); avatarContainer = Stack( clipBehavior: Clip.none, children: [ avatar, Positioned( right: -6.0, top: -6.0, child: unreadMsgCountText, ) ], ); } else { avatarContainer = avatar; } Color muteIconColor; if (conversation.isMute) { muteIconColor = AppColors.ConversationMuteIconColor; } else { muteIconColor = Colors.transparent; } //勿扰模式图标 Widget muteContainer = Container( margin: const EdgeInsets.only(top: 10.0), child: Icon( IconData( 0xe78b, fontFamily: Constants.IconFontFamily, ), color: muteIconColor, size: Constants.ConversationMuteIcon, ), ); var _rightArea = [ Text(conversation.updateAt, style: AppStyles.DescStyle), muteContainer ]; return Container( padding: const EdgeInsets.all(10.0), decoration: BoxDecoration( color: AppColors.ConversationItemBgColor, border: Border( bottom: BorderSide( color: AppColors.DividerColor, width: Constants.DividerWidth))), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ avatarContainer, Container(width: 10.0), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(conversation.title, style: AppStyles.TitleStyle), Text(conversation.desc, style: AppStyles.DescStyle) ], ), ), Container(width: 10.0), Column( children: _rightArea, ) ], ), ); } } class _DeviceInfoItem extends StatelessWidget { const _DeviceInfoItem({required this.device}); final Device device; int get iconName { return device == Device.WIN ? 0xe72a : 0xe640; } String get deviceName { return device == Device.WIN ? "Windows" : "Mac"; } @override Widget build(BuildContext context) { return Container( padding: EdgeInsets.only(left: 24.0, top: 10.0, right: 24.0, bottom: 10.0), decoration: BoxDecoration( border: Border( bottom: BorderSide( width: Constants.DividerWidth, color: AppColors.DividerColor, ), )), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ Icon( IconData(this.iconName, fontFamily: Constants.IconFontFamily), size: 24.0, color: AppColors.DeviceInfoItemIconColor, ), SizedBox(width: 16.0), Text('$deviceName 微信已登录,手机通知已关闭。', style: AppStyles.DeviceInfoItemTextStyle) ], ), ); } } class ConversationPage extends StatefulWidget { @override _ConversationPageState createState() => _ConversationPageState(); } class _ConversationPageState extends State { final ConversationPageData data = ConversationPageData.mock(); @override Widget build(BuildContext context) { return ListView.builder( itemBuilder: (BuildContext context, int index) { if (data.device != null) { //需要显示其他设备的登录信息 if (index == 0) { return _DeviceInfoItem(device: data.device!); } else { return _ConversationItem( conversation: data.conversations[index - 1]); } } else { return _ConversationItem(conversation: data.conversations[index]); } }, itemCount: data.device != null ? data.conversations.length + 1 : data.conversations.length, ); } } ================================================ FILE: lib/pages/discover_page.dart ================================================ import 'package:flutter/material.dart'; import '../widgets/full_width_button.dart'; import '../constants.dart' show AppColors; class DiscoverPage extends StatefulWidget { @override _DiscoverPageState createState() => _DiscoverPageState(); } class _DiscoverPageState extends State { static const SEPARATE_SIZE = 20.0; @override Widget build(BuildContext context) { return Container( color: AppColors.BackgroundColor, child: SingleChildScrollView( child: Column( children: [ SizedBox(height: SEPARATE_SIZE), FullWidthButton( iconPath: 'assets/images/ic_social_circle.png', title: '朋友圈', onPressed: () { print('点击了朋友圈'); }, ), SizedBox(height: SEPARATE_SIZE), FullWidthButton( iconPath: 'assets/images/ic_quick_scan.png', title: '扫一扫', showDivider: true, onPressed: () { print('点击了扫一扫'); }, ), FullWidthButton( iconPath: 'assets/images/ic_shake_phone.png', title: '摇一摇', onPressed: () {}, ), SizedBox(height: SEPARATE_SIZE), FullWidthButton( iconPath: 'assets/images/ic_feeds.png', title: '看一看', showDivider: true, onPressed: () {}, ), FullWidthButton( iconPath: 'assets/images/ic_quick_search.png', title: '搜一搜', onPressed: () {}, ), SizedBox(height: SEPARATE_SIZE), FullWidthButton( iconPath: 'assets/images/ic_people_nearby.png', title: '附近的人', showDivider: true, onPressed: () {}, ), FullWidthButton( iconPath: 'assets/images/ic_bottle_msg.png', title: '漂流瓶', onPressed: () {}, ), SizedBox(height: SEPARATE_SIZE), FullWidthButton( iconPath: 'assets/images/ic_shopping.png', title: '购物', showDivider: true, onPressed: () {}, ), FullWidthButton( iconPath: 'assets/images/ic_game_entry.png', title: '游戏', onPressed: () {}, ), SizedBox(height: SEPARATE_SIZE), FullWidthButton( iconPath: 'assets/images/ic_mini_program.png', title: '小程序', onPressed: () {}, ), SizedBox(height: SEPARATE_SIZE), ], ), ), ); } } ================================================ FILE: lib/pages/main_page.dart ================================================ import 'package:flutter/material.dart'; import '../constants.dart'; import 'contacts_page.dart'; import 'conversation_page.dart'; import 'profile_page.dart'; import 'discover_page.dart'; enum ActionItems { GROUP_CHAT, ADD_FRIEND, QR_SCAN, PAYMENT } class NavigationIconView { final BottomNavigationBarItem item; NavigationIconView( {required String title, required IconData icon, required IconData activeIcon}) : item = new BottomNavigationBarItem( icon: Icon(icon), activeIcon: Icon(activeIcon), label: title, backgroundColor: Colors.white); } class MainPage extends StatefulWidget { MainPage({Key? key}) : super(key: key); @override _MainPageState createState() => _MainPageState(); } class _MainPageState extends State { int _currentIndex = 0; late PageController _pageController; late List _pages; List _navigationViews = [ NavigationIconView( title: '微信', icon: IconData(0xe608, fontFamily: Constants.IconFontFamily), activeIcon: IconData(0xe603, fontFamily: Constants.IconFontFamily)), NavigationIconView( title: '通讯录', icon: IconData(0xe601, fontFamily: Constants.IconFontFamily), activeIcon: IconData(0xe602, fontFamily: Constants.IconFontFamily), ), NavigationIconView( title: '发现', icon: IconData(0xe600, fontFamily: Constants.IconFontFamily), activeIcon: IconData(0xe604, fontFamily: Constants.IconFontFamily), ), NavigationIconView( title: '我', icon: IconData(0xe607, fontFamily: Constants.IconFontFamily), activeIcon: IconData(0xe630, fontFamily: Constants.IconFontFamily), ), ]; @override void initState() { super.initState(); _pageController = PageController(initialPage: _currentIndex); _pages = [ ConversationPage(), ContactsPage(), DiscoverPage(), ProfilePage(), ]; } _buildPopupMenuItem(int iconName, String title) { return Row( children: [ Icon( IconData(iconName, fontFamily: Constants.IconFontFamily), size: 22.0, color: AppColors.AppBarPopupMenuColor, ), Container(width: 12.0), Text( title, style: TextStyle(color: AppColors.AppBarPopupMenuColor), ), ], ); } @override Widget build(BuildContext context) { final BottomNavigationBar botNavBar = new BottomNavigationBar( items: _navigationViews.map((NavigationIconView view) { return view.item; }).toList(), currentIndex: _currentIndex, type: BottomNavigationBarType.fixed, fixedColor: AppColors.TabIconActive, onTap: (int index) { setState(() { _currentIndex = index; _pageController.jumpToPage(_currentIndex); // _pageController.animateToPage(_currentIndex, duration: Duration(milliseconds: 200), curve: Curves.easeInOut); }); }, ); return Scaffold( appBar: AppBar( title: Text('微信'), elevation: 0.0, //不需要阴影 actions: [ IconButton( icon: Icon(IconData(0xe605, fontFamily: Constants.IconFontFamily)), onPressed: () { print('点击了搜索按钮'); }, ), Container(width: 16.0), PopupMenuButton( itemBuilder: (BuildContext context) { return >[ PopupMenuItem( child: _buildPopupMenuItem(0xe606, "发起群聊"), value: ActionItems.GROUP_CHAT, ), PopupMenuItem( child: _buildPopupMenuItem(0xe638, "添加朋友"), value: ActionItems.ADD_FRIEND, ), PopupMenuItem( child: _buildPopupMenuItem(0xe79b, "扫一扫"), value: ActionItems.QR_SCAN, ), PopupMenuItem( child: _buildPopupMenuItem(0xe658, "收付款"), value: ActionItems.PAYMENT, ), ]; }, icon: Icon( IconData(0xe66b, fontFamily: Constants.IconFontFamily), size: 22.0, ), onSelected: (ActionItems selected) { print('点击的是$selected'); }, ), Container(width: 16.0) ], ), body: PageView.builder( itemBuilder: (BuildContext context, int index) { return _pages[index]; }, physics: NeverScrollableScrollPhysics(), controller: _pageController, itemCount: _pages.length, onPageChanged: (int index) { setState(() { _currentIndex = index; }); }, ), bottomNavigationBar: botNavBar, ); } } ================================================ FILE: lib/pages/profile_page.dart ================================================ import 'package:flutter/material.dart'; import '../widgets/full_width_button.dart'; import '../constants.dart' show AppColors, Constants; import 'package:cached_network_image/cached_network_image.dart'; class _ProfileHeaderView extends StatelessWidget { static const HORIZONTAL_PADDING = 20.0; static const VERTICAL_PADDING = 13.0; @override Widget build(BuildContext context) { return Container( color: Colors.white, padding: EdgeInsets.symmetric( vertical: VERTICAL_PADDING, horizontal: HORIZONTAL_PADDING), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ CachedNetworkImage( imageUrl: 'https://z3.ax1x.com/2021/08/18/fom6ED.jpg', imageBuilder: (context, imageProvider) => Container( decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), image: DecorationImage(image: imageProvider, fit: BoxFit.cover), ), ), placeholder: (context, msg) => Constants.ProfileAvatarDefaultIocn, errorWidget: (context, url, error) => Icon(Icons.error), width: Constants.ProfileHeaderIconSize, height: Constants.ProfileHeaderIconSize, ), SizedBox(width: 10.0), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('码农 Super V', style: TextStyle( color: AppColors.TitleColor, fontSize: 16.0, fontWeight: FontWeight.w500, )), SizedBox(height: 10.0), Text('微信号: xxx123xxx', style: TextStyle( color: AppColors.DescTextColor, fontSize: 13.0, )) ], ), ), Icon( IconData( 0xe620, fontFamily: Constants.IconFontFamily, ), size: 22.0, color: AppColors.TabIconNormal, ), SizedBox(width: 5.0), Icon( IconData( 0xe664, fontFamily: Constants.IconFontFamily, ), size: 22.0, color: AppColors.TabIconNormal, ), ], ), ); } } class ProfilePage extends StatefulWidget { @override _ProfilePageState createState() => _ProfilePageState(); } class _ProfilePageState extends State { static const SEPARATE_SIZE = 20.0; @override Widget build(BuildContext context) { return Container( color: AppColors.BackgroundColor, child: SingleChildScrollView( child: Column( children: [ SizedBox(height: SEPARATE_SIZE), _ProfileHeaderView(), SizedBox(height: SEPARATE_SIZE), FullWidthButton( iconPath: 'assets/images/ic_wallet.png', title: '钱包', showDivider: true, onPressed: () {}, ), SizedBox(height: SEPARATE_SIZE), FullWidthButton( iconPath: 'assets/images/ic_collections.png', title: '收藏', showDivider: true, onPressed: () {}, ), FullWidthButton( iconPath: 'assets/images/ic_album.png', title: '相册', showDivider: true, onPressed: () {}, ), FullWidthButton( iconPath: 'assets/images/ic_cards_wallet.png', title: '卡包', showDivider: true, onPressed: () {}, ), FullWidthButton( iconPath: 'assets/images/ic_emotions.png', title: '表情', showDivider: true, onPressed: () {}, ), SizedBox(height: SEPARATE_SIZE), FullWidthButton( iconPath: 'assets/images/ic_settings.png', title: '设置', showDivider: true, onPressed: () {}, ), ], ), ), ); } } ================================================ FILE: lib/widgets/full_width_button.dart ================================================ import 'package:flutter/material.dart'; import '../constants.dart' show Constants, AppColors; class FullWidthButton extends StatelessWidget { static const HORIZONTAL_PADDING = 20.0; static const VERTICAL_PADDING = 13.0; const FullWidthButton({ required this.title, required this.iconPath, required this.onPressed, this.showDivider: false, }); final String title; final String iconPath; final bool showDivider; final VoidCallback onPressed; @override Widget build(BuildContext context) { final pureButton = Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( iconPath, width: Constants.FullWidthIconButtonIconSize, height: Constants.FullWidthIconButtonIconSize, ), SizedBox(width: HORIZONTAL_PADDING), Expanded( child: Text(title), ), Icon( IconData( 0xe664, fontFamily: Constants.IconFontFamily, ), size: 22.0, color: AppColors.TabIconNormal, ), ], ); final borderButton = Container( decoration: BoxDecoration( border: Border( bottom: BorderSide( color: AppColors.DividerColor, width: Constants.DividerWidth)), ), padding: EdgeInsets.only(bottom: VERTICAL_PADDING), child: pureButton, ); return GestureDetector( onTap: onPressed, child: Container( padding: EdgeInsets.only( left: HORIZONTAL_PADDING, right: HORIZONTAL_PADDING, top: VERTICAL_PADDING, bottom: showDivider ? 0.0 : VERTICAL_PADDING), color: Colors.white, child: showDivider ? borderButton : pureButton, ), ); } } ================================================ FILE: pubspec.yaml ================================================ name: flutter_wechat_clone description: A new Flutter project. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 # followed by an optional build number separated by a +. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html version: 1.0.0+1 environment: sdk: ">=2.12.0 <3.0.0" dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 cached_network_image: ^3.1.0 dev_dependencies: flutter_test: sdk: flutter # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true assets: - assets/images/ic_file_transfer.png - assets/images/ic_fengchao.png - assets/images/ic_tx_news.png - assets/images/ic_wx_games.png - assets/images/ic_new_friend.png - assets/images/ic_group_chat.png - assets/images/ic_tag.png - assets/images/ic_public_account.png - assets/images/ic_bottle_msg.png - assets/images/ic_feeds.png - assets/images/ic_game_entry.png - assets/images/ic_mini_program.png - assets/images/ic_people_nearby.png - assets/images/ic_quick_scan.png - assets/images/ic_quick_search.png - assets/images/ic_shake_phone.png - assets/images/ic_shopping.png - assets/images/ic_social_circle.png - assets/images/ic_wallet.png - assets/images/ic_album.png - assets/images/ic_collections.png - assets/images/ic_cards_wallet.png - assets/images/ic_emotions.png - assets/images/ic_settings.png - assets/images/ic_qrcode_preview_tiny.png - assets/images/default_nor_avatar.png fonts: - family: appIconFont fonts: - asset: assets/fonts/iconfont.ttf # To add assets to your application, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see # https://flutter.dev/assets-and-images/#from-packages # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages ================================================ FILE: test/widget_test.dart ================================================ // This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_wechat_clone/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); } ================================================ FILE: web/index.html ================================================ flutter_wechat_clone ================================================ FILE: web/manifest.json ================================================ { "name": "flutter_wechat_clone", "short_name": "flutter_wechat_clone", "start_url": ".", "display": "standalone", "background_color": "#0175C2", "theme_color": "#0175C2", "description": "A new Flutter project.", "orientation": "portrait-primary", "prefer_related_applications": false, "icons": [ { "src": "icons/Icon-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "icons/Icon-512.png", "sizes": "512x512", "type": "image/png" } ] }