Skip to content

Commit 9e096e8

Browse files
authored
Merge pull request #39 from leo-lox/onboarding
Onboarding
2 parents 6c97cf6 + 959861e commit 9e096e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1845
-596
lines changed

android/app/build.gradle

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
id "com.google.protobuf"
6+
}
7+
18
def localProperties = new Properties()
29
def localPropertiesFile = rootProject.file('local.properties')
310
if (localPropertiesFile.exists()) {
@@ -6,10 +13,7 @@ if (localPropertiesFile.exists()) {
613
}
714
}
815

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
16+
1317

1418
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1519
if (flutterVersionCode == null) {
@@ -21,10 +25,7 @@ if (flutterVersionName == null) {
2125
flutterVersionName = '1.0'
2226
}
2327

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply plugin: 'com.google.protobuf'
27-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
28+
2829

2930

3031
// signing
@@ -37,7 +38,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
3738

3839

3940
android {
40-
compileSdkVersion 33
41+
compileSdkVersion 34
4142
ndkVersion flutter.ndkVersion
4243

4344
compileOptions {
@@ -91,8 +92,8 @@ flutter {
9192
source '../..'
9293
}
9394

94-
dependencies {
95-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
95+
// dependencies {
96+
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
9697

97-
}
98+
// }
9899

android/build.gradle

-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.8.20'
3-
ext.javalite_version = '3.21.7'
4-
ext.protoc_version = '3.9.2'
5-
ext.protobuf_gradle = '0.9.1'
6-
7-
repositories {
8-
google()
9-
mavenCentral()
10-
}
11-
12-
dependencies {
13-
classpath 'com.android.tools.build:gradle:7.4.2'
14-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15-
classpath "com.google.protobuf:protobuf-gradle-plugin:$protobuf_gradle"
16-
}
17-
}
181

192
allprojects {
203
repositories {

android/settings.gradle

+23-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.4.2" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.20" apply false
23+
id "com.google.protobuf" version "0.9.1" apply false
24+
}
25+
26+
include ":app"

assets/images/header1.jpg

127 KB
Loading

devtools_options.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extensions:

lib/atoms/crop_avatar.dart

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import 'dart:typed_data';
2+
3+
import 'package:camelus/atoms/long_button.dart';
4+
import 'package:camelus/config/palette.dart';
5+
import 'package:flutter/material.dart';
6+
import 'package:crop_your_image/crop_your_image.dart';
7+
8+
class CropAvatar extends StatelessWidget {
9+
final Uint8List _imageData;
10+
11+
Uint8List _croppedImageData = Uint8List(0);
12+
13+
CropAvatar({
14+
super.key,
15+
required Uint8List imageData,
16+
}) : _imageData = imageData;
17+
18+
final _controller = CropController();
19+
20+
@override
21+
build(context) {
22+
return Stack(
23+
children: [
24+
Crop(
25+
baseColor: Palette.background,
26+
aspectRatio: 1,
27+
//radius: 150,
28+
interactive: false,
29+
withCircleUi: true,
30+
image: _imageData,
31+
controller: _controller,
32+
33+
onCropped: (image) {
34+
_croppedImageData = image;
35+
},
36+
),
37+
Column(
38+
mainAxisAlignment: MainAxisAlignment.end,
39+
children: [
40+
Center(
41+
child: SizedBox(
42+
width: 250,
43+
height: 40,
44+
child: longButton(
45+
name: "apply",
46+
onPressed: () {
47+
Navigator.pop(context, _croppedImageData);
48+
},
49+
),
50+
),
51+
),
52+
const SizedBox(height: 20),
53+
],
54+
),
55+
],
56+
);
57+
}
58+
}

lib/atoms/my_profile_picture.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Widget myProfilePicture({
6363
shape: BoxShape.circle,
6464
),
6565
child: SvgPicture.network(
66-
"https://avatars.dicebear.com/api/personas/$pubkey.svg"),
66+
"https://api.dicebear.com/7.x/personas/svg?seed=$pubkey"),
6767
);
6868
}
6969

@@ -81,7 +81,7 @@ class UserImage extends StatelessWidget {
8181
Widget build(BuildContext context) {
8282
return myProfilePicture(
8383
pictureUrl: myMetadata?.picture ??
84-
"https://avatars.dicebear.com/api/personas/$pubkey.svg",
84+
"https://api.dicebear.com/7.x/personas/svg?seed=$pubkey",
8585
pubkey: pubkey,
8686
filterQuality: FilterQuality.medium,
8787
);

lib/atoms/person_card.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class PersonCard extends ConsumerWidget {
1717
final Function(bool) onFollowTab;
1818

1919
const PersonCard({
20-
Key? key,
20+
super.key,
2121
required this.pubkey,
2222
required this.name,
2323
required this.pictureUrl,
@@ -26,7 +26,7 @@ class PersonCard extends ConsumerWidget {
2626
required this.onTap,
2727
required this.onFollowTab,
2828
this.nip05,
29-
}) : super(key: key);
29+
});
3030

3131
Future<String> checkNip05(String nip05, String pubkey, WidgetRef ref) async {
3232
var nip05service = await ref.read(nip05provider.future);

lib/atoms/picture.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:flutter_svg/svg.dart';
55
Widget simplePicture(String? pictureUrl, String? pubkey) {
66
if (pictureUrl == null) {
77
return SvgPicture.network(
8-
"https://avatars.dicebear.com/api/personas/$pubkey.svg");
8+
"https://api.dicebear.com/7.x/personas/svg?seed=$pubkey");
99
}
1010

1111
if (pictureUrl.contains(".svg")) {
@@ -25,5 +25,5 @@ Widget simplePicture(String? pictureUrl, String? pubkey) {
2525
}
2626

2727
return SvgPicture.network(
28-
"https://avatars.dicebear.com/api/personas/$pubkey.svg");
28+
"https://api.dicebear.com/7.x/personas/svg?seed=$pubkey");
2929
}

0 commit comments

Comments
 (0)