add icon assets, fix name, use env vars

+1
.gitignore
··· 11 11 .svn/ 12 12 .swiftpm/ 13 13 migrate_working_dir/ 14 + .env 14 15 15 16 # IntelliJ related 16 17 *.iml
+1 -1
README.md
··· 1 - # grain_flutter 1 + # grain 2 2 3 3 A new Flutter project. 4 4
+30 -4
ios/Runner.xcodeproj/project.pbxproj
··· 161 161 AA08BF815C647AB5DC8411F3 /* Pods-RunnerTests.release.xcconfig */, 162 162 1D6BE487C5E5B0B864003BB1 /* Pods-RunnerTests.profile.xcconfig */, 163 163 ); 164 - name = Pods; 165 164 path = Pods; 166 165 sourceTree = "<group>"; 167 166 }; ··· 469 468 baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 470 469 buildSettings = { 471 470 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 + ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; 472 472 CLANG_ENABLE_MODULES = YES; 473 473 CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 474 474 DEVELOPMENT_TEAM = YN68LN9T7Z; 475 475 ENABLE_BITCODE = NO; 476 476 INFOPLIST_FILE = Runner/Info.plist; 477 + INFOPLIST_KEY_CFBundleDisplayName = Grain; 478 + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking"; 477 479 LD_RUNPATH_SEARCH_PATHS = ( 478 480 "$(inherited)", 479 481 "@executable_path/Frameworks", 480 482 ); 481 - PRODUCT_BUNDLE_IDENTIFIER = com.example.grainFlutter; 483 + MARKETING_VERSION = "1.0.0+1"; 484 + PRODUCT_BUNDLE_IDENTIFIER = social.grain.grain; 482 485 PRODUCT_NAME = "$(TARGET_NAME)"; 486 + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; 487 + SUPPORTS_MACCATALYST = NO; 488 + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; 489 + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; 483 490 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 484 491 SWIFT_VERSION = 5.0; 492 + TARGETED_DEVICE_FAMILY = 1; 485 493 VERSIONING_SYSTEM = "apple-generic"; 486 494 }; 487 495 name = Profile; ··· 652 660 baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 653 661 buildSettings = { 654 662 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 663 + ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; 655 664 CLANG_ENABLE_MODULES = YES; 656 665 CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 657 666 DEVELOPMENT_TEAM = YN68LN9T7Z; 658 667 ENABLE_BITCODE = NO; 659 668 INFOPLIST_FILE = Runner/Info.plist; 669 + INFOPLIST_KEY_CFBundleDisplayName = Grain; 670 + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking"; 660 671 LD_RUNPATH_SEARCH_PATHS = ( 661 672 "$(inherited)", 662 673 "@executable_path/Frameworks", 663 674 ); 664 - PRODUCT_BUNDLE_IDENTIFIER = com.example.grainFlutter; 675 + MARKETING_VERSION = "1.0.0+1"; 676 + PRODUCT_BUNDLE_IDENTIFIER = social.grain.grain; 665 677 PRODUCT_NAME = "$(TARGET_NAME)"; 678 + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; 679 + SUPPORTS_MACCATALYST = NO; 680 + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; 681 + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; 666 682 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 667 683 SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 668 684 SWIFT_VERSION = 5.0; 685 + TARGETED_DEVICE_FAMILY = 1; 669 686 VERSIONING_SYSTEM = "apple-generic"; 670 687 }; 671 688 name = Debug; ··· 675 692 baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 676 693 buildSettings = { 677 694 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 695 + ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; 678 696 CLANG_ENABLE_MODULES = YES; 679 697 CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 680 698 DEVELOPMENT_TEAM = YN68LN9T7Z; 681 699 ENABLE_BITCODE = NO; 682 700 INFOPLIST_FILE = Runner/Info.plist; 701 + INFOPLIST_KEY_CFBundleDisplayName = Grain; 702 + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking"; 683 703 LD_RUNPATH_SEARCH_PATHS = ( 684 704 "$(inherited)", 685 705 "@executable_path/Frameworks", 686 706 ); 687 - PRODUCT_BUNDLE_IDENTIFIER = com.example.grainFlutter; 707 + MARKETING_VERSION = "1.0.0+1"; 708 + PRODUCT_BUNDLE_IDENTIFIER = social.grain.grain; 688 709 PRODUCT_NAME = "$(TARGET_NAME)"; 710 + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; 711 + SUPPORTS_MACCATALYST = NO; 712 + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; 713 + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; 689 714 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 690 715 SWIFT_VERSION = 5.0; 716 + TARGETED_DEVICE_FAMILY = 1; 691 717 VERSIONING_SYSTEM = "apple-generic"; 692 718 }; 693 719 name = Release;
ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png

This is a binary file and will not be displayed.

+1 -122
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 - } 1 + {"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"}]}
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png

This is a binary file and will not be displayed.

ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png

This is a binary file and will not be displayed.

+15 -15
ios/Runner/Info.plist
··· 2 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 3 <plist version="1.0"> 4 4 <dict> 5 + <key>CADisableMinimumFrameDurationOnPhone</key> 6 + <true/> 5 7 <key>CFBundleDevelopmentRegion</key> 6 8 <string>$(DEVELOPMENT_LANGUAGE)</string> 7 9 <key>CFBundleDisplayName</key> 8 - <string>Grain Flutter</string> 10 + <string>Grain</string> 9 11 <key>CFBundleExecutable</key> 10 12 <string>$(EXECUTABLE_NAME)</string> 11 13 <key>CFBundleIdentifier</key> ··· 13 15 <key>CFBundleInfoDictionaryVersion</key> 14 16 <string>6.0</string> 15 17 <key>CFBundleName</key> 16 - <string>grain_flutter</string> 18 + <string>grain</string> 17 19 <key>CFBundlePackageType</key> 18 20 <string>APPL</string> 19 21 <key>CFBundleShortVersionString</key> 20 22 <string>$(FLUTTER_BUILD_NAME)</string> 21 23 <key>CFBundleSignature</key> 22 24 <string>????</string> 25 + <key>CFBundleURLTypes</key> 26 + <array> 27 + <dict> 28 + <key>CFBundleURLSchemes</key> 29 + <array> 30 + <string>grainflutter</string> 31 + </array> 32 + </dict> 33 + </array> 23 34 <key>CFBundleVersion</key> 24 35 <string>$(FLUTTER_BUILD_NUMBER)</string> 25 36 <key>LSRequiresIPhoneOS</key> 26 37 <true/> 38 + <key>UIApplicationSupportsIndirectInputEvents</key> 39 + <true/> 27 40 <key>UILaunchStoryboardName</key> 28 41 <string>LaunchScreen</string> 29 42 <key>UIMainStoryboardFile</key> ··· 40 53 <string>UIInterfaceOrientationPortraitUpsideDown</string> 41 54 <string>UIInterfaceOrientationLandscapeLeft</string> 42 55 <string>UIInterfaceOrientationLandscapeRight</string> 43 - </array> 44 - <key>CADisableMinimumFrameDurationOnPhone</key> 45 - <true/> 46 - <key>UIApplicationSupportsIndirectInputEvents</key> 47 - <true/> 48 - <key>CFBundleURLTypes</key> 49 - <array> 50 - <dict> 51 - <key>CFBundleURLSchemes</key> 52 - <array> 53 - <string>grainflutter</string> 54 - </array> 55 - </dict> 56 56 </array> 57 57 </dict> 58 58 </plist>
+6 -5
lib/api.dart
··· 2 2 import 'dart:convert'; 3 3 import 'profile.dart'; 4 4 import 'gallery.dart'; 5 + import 'package:flutter_dotenv/flutter_dotenv.dart'; 5 6 6 7 class ApiService { 7 8 String? _accessToken; 8 9 Profile? currentUser; 9 10 List<Gallery> galleries = []; 11 + 12 + String get _apiUrl => dotenv.env['API_URL'] ?? 'http://localhost:8080'; 10 13 11 14 void setToken(String token) { 12 15 _accessToken = token; ··· 15 18 Future<void> fetchProfile() async { 16 19 if (_accessToken == null) return; 17 20 final response = await http.get( 18 - Uri.parse('http://localhost:8080/xrpc/social.grain.actor.getProfile'), 21 + Uri.parse('$_apiUrl/xrpc/social.grain.actor.getProfile'), 19 22 headers: {'Authorization': 'Bearer $_accessToken'}, 20 23 ); 21 24 if (response.statusCode == 200) { ··· 29 32 Future<List<Gallery>> fetchActorGalleries() async { 30 33 if (_accessToken == null) return []; 31 34 final response = await http.get( 32 - Uri.parse( 33 - 'http://localhost:8080/xrpc/social.grain.gallery.getActorGalleries', 34 - ), 35 + Uri.parse('$_apiUrl/xrpc/social.grain.gallery.getActorGalleries'), 35 36 headers: {'Authorization': 'Bearer $_accessToken'}, 36 37 ); 37 38 if (response.statusCode == 200) { ··· 44 45 } 45 46 return galleries; 46 47 } else { 47 - throw Exception('Failed to load galleries: \\${response.statusCode}'); 48 + throw Exception('Failed to load galleries: ${response.statusCode}'); 48 49 } 49 50 } 50 51 }
+10 -5
lib/main.dart
··· 1 + import 'package:flutter/foundation.dart'; 1 2 import 'package:flutter/material.dart'; 2 3 import 'package:flutter_web_auth_2/flutter_web_auth_2.dart'; 3 - import 'package:grain_flutter/api.dart'; 4 - import 'package:grain_flutter/gallery.dart'; 4 + import 'package:grain/api.dart'; 5 + import 'package:grain/gallery.dart'; 6 + import 'package:flutter_dotenv/flutter_dotenv.dart'; 5 7 6 - void main() { 8 + Future<void> main() async { 9 + if (!kReleaseMode) { 10 + await dotenv.load(fileName: '.env'); 11 + } 7 12 runApp(const MyApp()); 8 13 } 9 14 ··· 82 87 _signingIn = true; 83 88 }); 84 89 try { 90 + final apiUrl = dotenv.env['API_URL'] ?? 'http://localhost:8080'; 85 91 final redirectedUrl = await FlutterWebAuth2.authenticate( 86 92 url: 87 - 'http://localhost:8080/oauth/login?client=native&handle=' + 88 - Uri.encodeComponent(handle), 93 + '$apiUrl/oauth/login?client=native&handle=${Uri.encodeComponent(handle)}', 89 94 callbackUrlScheme: 'grainflutter', 90 95 ); 91 96 final uri = Uri.parse(redirectedUrl);
+8
pubspec.lock
··· 169 169 description: flutter 170 170 source: sdk 171 171 version: "0.0.0" 172 + flutter_dotenv: 173 + dependency: "direct main" 174 + description: 175 + name: flutter_dotenv 176 + sha256: b7c7be5cd9f6ef7a78429cabd2774d3c4af50e79cb2b7593e3d5d763ef95c61b 177 + url: "https://pub.dev" 178 + source: hosted 179 + version: "5.2.1" 172 180 flutter_lints: 173 181 dependency: "direct dev" 174 182 description:
+4 -2
pubspec.yaml
··· 1 - name: grain_flutter 1 + name: grain 2 2 description: "A new Flutter project." 3 3 # The following line prevents the package from being accidentally published to 4 4 # pub.dev using `flutter pub publish`. This is preferred for private packages. ··· 57 57 ref: main # or the branch/commit you want 58 58 path: packages/xrpc 59 59 http: ^1.4.0 60 - 60 + flutter_dotenv: ^5.2.1 61 61 62 62 dependency_overrides: 63 63 atproto_oauth: ··· 132 132 # 133 133 # For details regarding fonts from package dependencies, 134 134 # see https://flutter.dev/to/font-from-package 135 + assets: 136 + - .env
+1 -1
test/widget_test.dart
··· 8 8 import 'package:flutter/material.dart'; 9 9 import 'package:flutter_test/flutter_test.dart'; 10 10 11 - import 'package:grain_flutter/main.dart'; 11 + import 'package:grain/main.dart'; 12 12 13 13 void main() { 14 14 testWidgets('Counter increments smoke test', (WidgetTester tester) async {