Skip to content

Commit

Permalink
Location use limitation, autodev prompt tweaks, analysis button press…
Browse files Browse the repository at this point in the history
… color
  • Loading branch information
alexdredmon committed Apr 21, 2024
1 parent abf5365 commit 5539cfb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
2 changes: 0 additions & 2 deletions flutter/lib/_autodev_prompt.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
You are a software development team. I'm going to provide you with your codebase, then we'll build some features. Do not start to make changes until I request them - reply only with "I'm in" when you receive the codebase.

I will ask you to build features on top of the codebase - respond first with the files that need to be changed followed by a brief summary of the changes. Only output files that require changes to implement the current feature. When you output the files, begin with the filename of the file being updated and then output the entire un-truncated file after modifications. Do not remove any comments. Ensure that the first line of each file is "// FILENAME" where "FILENAME" is the file's name, and that the last line of each file is "// eof" - and most importantly, make sure to surround each file with triple backticks "```" so that they will be entirely formatted as code.

Here's my codebase:

8 changes: 5 additions & 3 deletions flutter/lib/camera_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ class CameraFunctions {

// Request location permissions
LocationPermission permission = await Geolocator.requestPermission();
if (permission != LocationPermission.denied && permission != LocationPermission.deniedForever) {
if (
prompt.contains("{location.")
&& permission != LocationPermission.denied
&& permission != LocationPermission.deniedForever
) {
// Get the user's current location
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);

Expand All @@ -101,8 +105,6 @@ class CameraFunctions {
}
}



// Replace the orientation token in the prompt with actual value
// if (prompt.contains("{location.orientation}")) {
// String orientation;
Expand Down
1 change: 1 addition & 0 deletions flutter/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner:false,
title: 'CrayEye',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
Expand Down
27 changes: 21 additions & 6 deletions flutter/lib/prompt_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,28 @@ class PromptButton extends StatelessWidget {
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: currentPromptTitle == 'Select a Prompt' ? onPressed : onAnalyzePressed,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.deepPurple.shade700,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) {
return Colors.black; // Background color when button is pressed
}
return Colors.deepPurple.shade700; // Default background color
}),
foregroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) {
return Colors.white; // Text color when button is pressed
}
return Colors.white; // Default text color
}),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
),
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expand Down
5 changes: 5 additions & 0 deletions flutter/lib/z_autodev_prompt_end.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
That's my codebase.

I will ask you to build features on top of the codebase - respond first with the files that need to be changed followed by a brief summary of the changes. Only output files that require changes to implement the current feature. When you output the files, begin with the filename of the file being updated and then output the entire un-truncated file after modifications. Do not remove any comments. Ensure that the first line of each file is "// FILENAME" where "FILENAME" is the file's name, and that the last line of each file is "// eof" - and most importantly, make sure to surround each file with triple backticks "```" so that they will be entirely formatted as code.

As a reminder, just reply "I'm in" and then we'll start working on features.

0 comments on commit 5539cfb

Please sign in to comment.