-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from leo-lox/dev
gPlay - clickable hashtags + db
- Loading branch information
Showing
129 changed files
with
12,744 additions
and
4,469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,6 @@ | |
"prefs", | ||
"pubkey", | ||
"Pubkeys" | ||
] | ||
], | ||
"java.configuration.updateBuildConfiguration": "interactive" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import 'package:camelus/routes/nostr/onboarding/onboarding.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:camelus/main.dart' as app; | ||
|
||
main() { | ||
//IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive; | ||
|
||
group('end-to-end test', () { | ||
testWidgets('test onboarding, terms acceptance', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
expect(find.text('camelus'), findsOneWidget); | ||
|
||
// check agb link | ||
expect(find.text('terms and conditions'), findsOneWidget); | ||
|
||
await tester.tap(find.widgetWithText(ElevatedButton, 'next')); | ||
await tester.pumpAndSettle(); | ||
expect(find.byType(SnackBar), findsOneWidget); | ||
expect(find.text('Please read and accept the terms and conditions first'), | ||
findsOneWidget); | ||
await tester.pumpAndSettle(); | ||
|
||
await tester.tap(find.byType(Checkbox)); | ||
await tester.pumpAndSettle(); | ||
|
||
await tester.tap(find.widgetWithText(ElevatedButton, 'next')); | ||
await tester.pump(const Duration(milliseconds: 500)); | ||
expect(find.byType(NostrOnboarding), findsNothing); | ||
|
||
//await tester.pumpAndSettle(const Duration(minutes: 1)); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import 'package:camelus/config/palette.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class BackButtonRound extends StatelessWidget { | ||
const BackButtonRound({ | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
margin: const EdgeInsets.all(0), | ||
padding: const EdgeInsets.only(top: 10, right: 0, left: 0), | ||
child: ButtonTheme( | ||
minWidth: 10, | ||
height: 1, | ||
child: ElevatedButton( | ||
onPressed: () { | ||
Navigator.pop(context); | ||
}, | ||
style: ElevatedButton.styleFrom( | ||
backgroundColor: Colors.black54, | ||
padding: const EdgeInsets.all(0), | ||
shape: const CircleBorder(), | ||
), | ||
child: const Icon( | ||
Icons.arrow_back, | ||
color: Palette.white, | ||
size: 20, | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import 'package:camelus/config/palette.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
Widget followButton({ | ||
required bool isFollowing, | ||
required VoidCallback onPressed, | ||
}) { | ||
if (isFollowing) { | ||
return Container( | ||
margin: const EdgeInsets.only(top: 0, right: 10), | ||
child: ElevatedButton( | ||
onPressed: () { | ||
onPressed(); | ||
}, | ||
style: ElevatedButton.styleFrom( | ||
backgroundColor: Palette.black, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(20), | ||
side: const BorderSide(color: Palette.white, width: 1), | ||
), | ||
), | ||
child: const Text( | ||
'unfollow', | ||
style: TextStyle( | ||
color: Palette.white, | ||
fontSize: 16, | ||
), | ||
), | ||
), | ||
); | ||
} | ||
return Container( | ||
margin: const EdgeInsets.only(top: 0, right: 10), | ||
child: ElevatedButton( | ||
onPressed: () { | ||
onPressed(); | ||
}, | ||
style: ElevatedButton.styleFrom( | ||
backgroundColor: Palette.white, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(20), | ||
side: const BorderSide(color: Palette.black, width: 1), | ||
), | ||
), | ||
child: const Text( | ||
'follow', | ||
style: TextStyle( | ||
color: Palette.black, | ||
fontSize: 16, | ||
), | ||
), | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
import 'dart:math'; | ||
|
||
import 'package:camelus/config/palette.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class HashtagCard extends StatelessWidget { | ||
final int index; | ||
final String hashtag; | ||
final int threadsCount; | ||
final Function(String hashtag) onTap; | ||
|
||
const HashtagCard({ | ||
super.key, | ||
required this.index, | ||
required this.hashtag, | ||
required this.threadsCount, | ||
required this.onTap, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return InkWell( | ||
onTap: () { | ||
onTap(hashtag); | ||
}, | ||
child: Container( | ||
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 12), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Row( | ||
crossAxisAlignment: CrossAxisAlignment.end, | ||
children: [ | ||
Text( | ||
"${index + 1}. ", | ||
style: const TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w600, | ||
height: BorderSide.strokeAlignCenter, | ||
), | ||
), | ||
const SizedBox(width: 5), | ||
Text( | ||
hashtag, | ||
style: const TextStyle( | ||
height: BorderSide.strokeAlignCenter, | ||
letterSpacing: 1, | ||
fontSize: 28, | ||
fontWeight: FontWeight.w600, | ||
), | ||
), | ||
], | ||
), | ||
const SizedBox(height: 2), | ||
Row( | ||
children: [ | ||
const SizedBox(width: 25), | ||
Text( | ||
threadsCount.toString(), | ||
style: const TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w400, | ||
color: Palette.gray, | ||
), | ||
), | ||
const SizedBox(width: 8), | ||
const Text( | ||
"threads", | ||
style: TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w400, | ||
color: Palette.gray, | ||
), | ||
), | ||
], | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} | ||
|
||
class HashtagCardSkeleton extends StatelessWidget { | ||
const HashtagCardSkeleton({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 12), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Row( | ||
crossAxisAlignment: CrossAxisAlignment.end, | ||
children: [ | ||
Container( | ||
width: 20, | ||
height: 20, | ||
decoration: BoxDecoration( | ||
color: Palette.extraDarkGray, | ||
borderRadius: BorderRadius.circular(5), | ||
), | ||
), | ||
const SizedBox(width: 5), | ||
Container( | ||
// random between 100 and 200 | ||
width: 80 + (140 * (Random().nextDouble() * 1.0)), | ||
height: 40, | ||
decoration: BoxDecoration( | ||
color: Palette.extraDarkGray, | ||
borderRadius: BorderRadius.circular(5), | ||
), | ||
), | ||
], | ||
), | ||
const SizedBox(height: 2), | ||
Row( | ||
children: [ | ||
const SizedBox(width: 25), | ||
Container( | ||
width: 100, | ||
height: 20, | ||
decoration: BoxDecoration( | ||
color: Palette.extraDarkGray, | ||
borderRadius: BorderRadius.circular(5), | ||
), | ||
), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:camelus/config/palette.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
Widget longButton({ | ||
required String name, | ||
required Function() onPressed, | ||
bool inverted = false, | ||
bool disabled = false, | ||
bool loading = false, | ||
}) { | ||
return ElevatedButton( | ||
onPressed: disabled && !loading ? null : onPressed, | ||
style: ElevatedButton.styleFrom( | ||
disabledBackgroundColor: Palette.darkGray, | ||
foregroundColor: inverted ? Palette.black : Palette.lightGray, | ||
backgroundColor: inverted ? Palette.extraLightGray : Palette.black, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(20), | ||
side: const BorderSide(color: Palette.white, width: 1), | ||
), | ||
), | ||
child: loading | ||
? _progress() | ||
: Text( | ||
name, | ||
style: TextStyle( | ||
color: inverted ? Palette.black : Palette.white, | ||
fontSize: 18, | ||
), | ||
), | ||
); | ||
} | ||
|
||
Widget _progress() { | ||
return const Padding( | ||
padding: EdgeInsets.only(left: 10, right: 10), | ||
child: LinearProgressIndicator( | ||
backgroundColor: Palette.gray, | ||
color: Palette.black, | ||
), | ||
); | ||
} |
Oops, something went wrong.