Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Introduce LeaderboardSubmissionButton widget

hunteraraujo79f96c8f911a
diff --git a/frontend/lib/views/task_queue/leaderboard_submission_button.dart b/frontend/lib/views/task_queue/leaderboard_submission_button.dart
new file mode 100644
index 0000000000..9a99201fac
--- /dev/null
+++ b/frontend/lib/views/task_queue/leaderboard_submission_button.dart
@@ -0,0 +1,48 @@
+import 'package:auto_gpt_flutter_client/constants/app_colors.dart';
+import 'package:flutter/material.dart';
+
+class LeaderboardSubmissionButton extends StatelessWidget {
+ final VoidCallback? onPressed;
+ final bool isDisabled;
+
+ LeaderboardSubmissionButton(
+ {required this.onPressed, this.isDisabled = false});
+
+ @override
+ Widget build(BuildContext context) {
+ return SizedBox(
+ height: 50,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: isDisabled ? Colors.grey : AppColors.primaryLight,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(8.0),
+ ),
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+ elevation: 5.0,
+ ),
+ onPressed: isDisabled ? null : onPressed,
+ child: const Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ 'Submit to leaderboard',
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 12.50,
+ fontFamily: 'Archivo',
+ fontWeight: FontWeight.w400,
+ ),
+ ),
+ SizedBox(width: 10),
+ Icon(
+ Icons.emoji_events,
+ color: Colors.white,
+ size: 24,
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}