Sabatino81 commited on
Commit
b57ecd3
·
verified ·
1 Parent(s): 77de16a

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. agents/flutter_screen_generator.py +45 -2
agents/flutter_screen_generator.py CHANGED
@@ -397,6 +397,7 @@ class FlutterScreenGenerator:
397
  "bg_style": variant["background"],
398
  "header_type": variant["header"],
399
  "footer_type": variant["footer"],
 
400
  "reasoning": variant.get("reasoning", ""),
401
  "status": "generated"
402
  })
@@ -555,6 +556,18 @@ JSON Plan:"""
555
  # Get all background names for AI
556
  bg_list = "\n".join([f"- {bg_id} ({info['name']}, {info['complexity']})" for bg_id, info in self.BACKGROUND_CATALOG.items()])
557
 
 
 
 
 
 
 
 
 
 
 
 
 
558
  prompt = f"""You are a UX/UI expert. Generate 4 different screen layout variants for a {app_type} mobile app.
559
 
560
  THEME INFO:
@@ -582,6 +595,9 @@ FOOTERS:
582
  - classic_expanded (icons + labels, traditional)
583
  - gesture_bar (iOS-style swipe, minimal)
584
 
 
 
 
585
  Generate 4 DIFFERENT variants, each optimized for different use cases.
586
  Consider theme style + app type to make smart combinations.
587
 
@@ -589,7 +605,8 @@ IMPORTANT RULES:
589
  1. Use a DIFFERENT background for each variant (choose from 30 options above)
590
  2. Vary the complexity: mix simple, medium, and complex backgrounds
591
  3. Match background category to use case (gradients=clean, waves=dynamic, geometric=modern, organic=creative, patterns=structured, abstract=premium)
592
- 4. **PERSONALIZE TEXT** content based on app_type (e.g., fitness="Workout Tracker", banking="Account Overview")
 
593
 
594
  Output ONLY valid JSON:
595
  {{
@@ -600,6 +617,7 @@ Output ONLY valid JSON:
600
  "background": "waves_smooth",
601
  "header": "stats_header",
602
  "footer": "floating_fab",
 
603
  "texts": {{
604
  "header_title": "Personalized title for {app_type}",
605
  "header_subtitle": "Optional subtitle",
@@ -613,6 +631,7 @@ Output ONLY valid JSON:
613
  "background": "gradient_mesh",
614
  "header": "minimal",
615
  "footer": "animated_pills",
 
616
  "texts": {{
617
  "header_title": "Different title for {app_type}",
618
  "header_subtitle": "Different subtitle",
@@ -620,7 +639,7 @@ Output ONLY valid JSON:
620
  }},
621
  "reasoning": "Different background and components"
622
  }},
623
- ...2 more variants with DIFFERENT backgrounds and personalized texts
624
  ]
625
  }}
626
 
@@ -662,6 +681,7 @@ JSON:"""
662
  "background": "waves_smooth",
663
  "header": "stats_header",
664
  "footer": "floating_fab",
 
665
  "texts": {
666
  "header_title": "Workout Tracker",
667
  "header_subtitle": "Today's Progress",
@@ -675,6 +695,7 @@ JSON:"""
675
  "background": "gradient_linear",
676
  "header": "minimal",
677
  "footer": "gesture_bar",
 
678
  "texts": {
679
  "header_title": "Active Session",
680
  "header_subtitle": "",
@@ -688,6 +709,7 @@ JSON:"""
688
  "background": "geometric_circles",
689
  "header": "tabs",
690
  "footer": "animated_pills",
 
691
  "texts": {
692
  "header_title": "Fitness Hub",
693
  "header_subtitle": "Your Weekly Goals",
@@ -701,6 +723,7 @@ JSON:"""
701
  "background": "abstract_particles",
702
  "header": "avatar_search",
703
  "footer": "classic_expanded",
 
704
  "texts": {
705
  "header_title": "Level Up",
706
  "header_subtitle": "Achievements & Rewards",
@@ -716,6 +739,7 @@ JSON:"""
716
  "background": "gradient_radial",
717
  "header": "minimal",
718
  "footer": "minimal_icons",
 
719
  "texts": {
720
  "header_title": "My Accounts",
721
  "header_subtitle": "Secure Banking",
@@ -729,6 +753,7 @@ JSON:"""
729
  "background": "gradient_linear",
730
  "header": "tabs",
731
  "footer": "classic_expanded",
 
732
  "texts": {
733
  "header_title": "Financial Hub",
734
  "header_subtitle": "Account Overview",
@@ -742,6 +767,7 @@ JSON:"""
742
  "background": "waves_minimal",
743
  "header": "collapsible",
744
  "footer": "animated_pills",
 
745
  "texts": {
746
  "header_title": "Wealth Manager",
747
  "header_subtitle": "Premium Services",
@@ -755,6 +781,7 @@ JSON:"""
755
  "background": "pattern_lines",
756
  "header": "avatar_search",
757
  "footer": "gesture_bar",
 
758
  "texts": {
759
  "header_title": "Smart Banking",
760
  "header_subtitle": "Quick Actions",
@@ -770,6 +797,7 @@ JSON:"""
770
  "background": "waves_sharp",
771
  "header": "stats_header",
772
  "footer": "floating_fab",
 
773
  "texts": {
774
  "header_title": "On Delivery",
775
  "header_subtitle": "Today's Earnings",
@@ -783,6 +811,7 @@ JSON:"""
783
  "background": "gradient_diagonal",
784
  "header": "collapsible",
785
  "footer": "minimal_icons",
 
786
  "texts": {
787
  "header_title": "Navigate",
788
  "header_subtitle": "Active Route",
@@ -796,6 +825,7 @@ JSON:"""
796
  "background": "abstract_crystalline",
797
  "header": "tabs",
798
  "footer": "classic_expanded",
 
799
  "texts": {
800
  "header_title": "Rider Hub",
801
  "header_subtitle": "Weekly Performance",
@@ -809,6 +839,7 @@ JSON:"""
809
  "background": "geometric_stripes",
810
  "header": "avatar_search",
811
  "footer": "animated_pills",
 
812
  "texts": {
813
  "header_title": "Rider Community",
814
  "header_subtitle": "Leaderboard & Friends",
@@ -824,6 +855,7 @@ JSON:"""
824
  "background": "gradient_mesh",
825
  "header": "avatar_search",
826
  "footer": "floating_fab",
 
827
  "texts": {
828
  "header_title": "Shop",
829
  "header_subtitle": "Discover Products",
@@ -837,6 +869,7 @@ JSON:"""
837
  "background": "pattern_dots",
838
  "header": "minimal",
839
  "footer": "classic_expanded",
 
840
  "texts": {
841
  "header_title": "Store",
842
  "header_subtitle": "Featured Collection",
@@ -850,6 +883,7 @@ JSON:"""
850
  "background": "abstract_rays",
851
  "header": "collapsible",
852
  "footer": "animated_pills",
 
853
  "texts": {
854
  "header_title": "Luxury Collection",
855
  "header_subtitle": "Exclusive Items",
@@ -863,6 +897,7 @@ JSON:"""
863
  "background": "waves_curved",
864
  "header": "tabs",
865
  "footer": "gesture_bar",
 
866
  "texts": {
867
  "header_title": "Flash Deals",
868
  "header_subtitle": "Limited Time Offers",
@@ -878,6 +913,7 @@ JSON:"""
878
  "background": "organic_fluid",
879
  "header": "avatar_search",
880
  "footer": "minimal_icons",
 
881
  "texts": {
882
  "header_title": "Feed",
883
  "header_subtitle": "What's Happening",
@@ -891,6 +927,7 @@ JSON:"""
891
  "background": "gradient_sweep",
892
  "header": "minimal",
893
  "footer": "gesture_bar",
 
894
  "texts": {
895
  "header_title": "Stories",
896
  "header_subtitle": "24h Updates",
@@ -904,6 +941,7 @@ JSON:"""
904
  "background": "geometric_hexagons",
905
  "header": "tabs",
906
  "footer": "floating_fab",
 
907
  "texts": {
908
  "header_title": "Create",
909
  "header_subtitle": "Your Studio",
@@ -917,6 +955,7 @@ JSON:"""
917
  "background": "abstract_constellation",
918
  "header": "collapsible",
919
  "footer": "animated_pills",
 
920
  "texts": {
921
  "header_title": "Activity",
922
  "header_subtitle": "Your Network",
@@ -934,6 +973,7 @@ JSON:"""
934
  "background": "gradient_linear",
935
  "header": "minimal",
936
  "footer": "minimal_icons",
 
937
  "description": "Simple and clean",
938
  "texts": {
939
  "header_title": "Home",
@@ -947,6 +987,7 @@ JSON:"""
947
  "background": "waves_layered",
948
  "header": "avatar_search",
949
  "footer": "floating_fab",
 
950
  "description": "Active and social",
951
  "texts": {
952
  "header_title": "Dashboard",
@@ -960,6 +1001,7 @@ JSON:"""
960
  "background": "abstract_voronoi",
961
  "header": "tabs",
962
  "footer": "animated_pills",
 
963
  "description": "Professional look",
964
  "texts": {
965
  "header_title": "Overview",
@@ -973,6 +1015,7 @@ JSON:"""
973
  "background": "organic_blobs",
974
  "header": "collapsible",
975
  "footer": "classic_expanded",
 
976
  "description": "Fun and creative",
977
  "texts": {
978
  "header_title": "Creative Hub",
 
397
  "bg_style": variant["background"],
398
  "header_type": variant["header"],
399
  "footer_type": variant["footer"],
400
+ "cards": variant.get("cards", []),
401
  "reasoning": variant.get("reasoning", ""),
402
  "status": "generated"
403
  })
 
556
  # Get all background names for AI
557
  bg_list = "\n".join([f"- {bg_id} ({info['name']}, {info['complexity']})" for bg_id, info in self.BACKGROUND_CATALOG.items()])
558
 
559
+ # Get card suggestions based on app type
560
+ card_suggestions = {
561
+ "fitness": ["workout_summary", "activity_ring", "step_counter", "calorie_tracker", "heart_rate", "achievement_badge", "workout_session", "weekly_progress", "streak_counter"],
562
+ "banking": ["account_balance", "transaction_item", "credit_card", "bank_transfer", "investment_summary", "stock_item", "crypto_balance", "bill_payment", "quick_action", "savings_goal"],
563
+ "rider": ["delivery_order", "delivery_tracking", "earnings_summary", "customer_rating", "map_route", "income_breakdown", "navigation_step", "challenge_card"],
564
+ "ecommerce": ["product_vertical", "product_rating", "flash_sale", "cart_item", "wishlist_item", "product_grid_compact", "order_tracking", "coupon_card", "brand_card"],
565
+ "social": ["post_card", "story_card", "user_profile", "comment_thread", "reaction_bar", "follower_item", "event_card", "poll_card", "notification_card"],
566
+ "generic": ["info_card", "action_card", "stats_summary", "feature_card", "activity_card", "progress_bar", "premium_feature", "gallery_item"]
567
+ }
568
+ cards_list = card_suggestions.get(app_type, card_suggestions["generic"])
569
+ cards_str = ", ".join(cards_list)
570
+
571
  prompt = f"""You are a UX/UI expert. Generate 4 different screen layout variants for a {app_type} mobile app.
572
 
573
  THEME INFO:
 
595
  - classic_expanded (icons + labels, traditional)
596
  - gesture_bar (iOS-style swipe, minimal)
597
 
598
+ CARDS for {app_type} app (choose 3-4 per variant):
599
+ {cards_str}
600
+
601
  Generate 4 DIFFERENT variants, each optimized for different use cases.
602
  Consider theme style + app type to make smart combinations.
603
 
 
605
  1. Use a DIFFERENT background for each variant (choose from 30 options above)
606
  2. Vary the complexity: mix simple, medium, and complex backgrounds
607
  3. Match background category to use case (gradients=clean, waves=dynamic, geometric=modern, organic=creative, patterns=structured, abstract=premium)
608
+ 4. **SELECT 3-4 CARDS** from the list above that fit the variant's purpose for the home screen
609
+ 5. **PERSONALIZE TEXT** content based on app_type (e.g., fitness="Workout Tracker", banking="Account Overview")
610
 
611
  Output ONLY valid JSON:
612
  {{
 
617
  "background": "waves_smooth",
618
  "header": "stats_header",
619
  "footer": "floating_fab",
620
+ "cards": ["card1", "card2", "card3", "card4"],
621
  "texts": {{
622
  "header_title": "Personalized title for {app_type}",
623
  "header_subtitle": "Optional subtitle",
 
631
  "background": "gradient_mesh",
632
  "header": "minimal",
633
  "footer": "animated_pills",
634
+ "cards": ["different1", "different2", "different3"],
635
  "texts": {{
636
  "header_title": "Different title for {app_type}",
637
  "header_subtitle": "Different subtitle",
 
639
  }},
640
  "reasoning": "Different background and components"
641
  }},
642
+ ...2 more variants with DIFFERENT backgrounds, cards and personalized texts
643
  ]
644
  }}
645
 
 
681
  "background": "waves_smooth",
682
  "header": "stats_header",
683
  "footer": "floating_fab",
684
+ "cards": ["workout_summary", "activity_ring", "step_counter", "calorie_tracker"],
685
  "texts": {
686
  "header_title": "Workout Tracker",
687
  "header_subtitle": "Today's Progress",
 
695
  "background": "gradient_linear",
696
  "header": "minimal",
697
  "footer": "gesture_bar",
698
+ "cards": ["workout_session", "heart_rate", "timer_widget"],
699
  "texts": {
700
  "header_title": "Active Session",
701
  "header_subtitle": "",
 
709
  "background": "geometric_circles",
710
  "header": "tabs",
711
  "footer": "animated_pills",
712
+ "cards": ["weekly_progress", "achievement_badge", "streak_counter", "leaderboard_item"],
713
  "texts": {
714
  "header_title": "Fitness Hub",
715
  "header_subtitle": "Your Weekly Goals",
 
723
  "background": "abstract_particles",
724
  "header": "avatar_search",
725
  "footer": "classic_expanded",
726
+ "cards": ["achievement_unlock", "level_progress", "quest_item", "reward_card"],
727
  "texts": {
728
  "header_title": "Level Up",
729
  "header_subtitle": "Achievements & Rewards",
 
739
  "background": "gradient_radial",
740
  "header": "minimal",
741
  "footer": "minimal_icons",
742
+ "cards": ["account_balance", "transaction_item", "credit_card", "quick_action"],
743
  "texts": {
744
  "header_title": "My Accounts",
745
  "header_subtitle": "Secure Banking",
 
753
  "background": "gradient_linear",
754
  "header": "tabs",
755
  "footer": "classic_expanded",
756
+ "cards": ["bank_transfer", "bill_payment", "investment_summary", "stock_item"],
757
  "texts": {
758
  "header_title": "Financial Hub",
759
  "header_subtitle": "Account Overview",
 
767
  "background": "waves_minimal",
768
  "header": "collapsible",
769
  "footer": "animated_pills",
770
+ "cards": ["crypto_balance", "portfolio_chart", "market_index", "advisor_card"],
771
  "texts": {
772
  "header_title": "Wealth Manager",
773
  "header_subtitle": "Premium Services",
 
781
  "background": "pattern_lines",
782
  "header": "avatar_search",
783
  "footer": "gesture_bar",
784
+ "cards": ["savings_goal", "cashback_reward", "spending_category", "scheduled_payment"],
785
  "texts": {
786
  "header_title": "Smart Banking",
787
  "header_subtitle": "Quick Actions",
 
797
  "background": "waves_sharp",
798
  "header": "stats_header",
799
  "footer": "floating_fab",
800
+ "cards": ["delivery_order", "delivery_tracking", "earnings_summary", "customer_rating"],
801
  "texts": {
802
  "header_title": "On Delivery",
803
  "header_subtitle": "Today's Earnings",
 
811
  "background": "gradient_diagonal",
812
  "header": "collapsible",
813
  "footer": "minimal_icons",
814
+ "cards": ["map_route", "navigation_step", "eta_card", "customer_info"],
815
  "texts": {
816
  "header_title": "Navigate",
817
  "header_subtitle": "Active Route",
 
825
  "background": "abstract_crystalline",
826
  "header": "tabs",
827
  "footer": "classic_expanded",
828
+ "cards": ["income_breakdown", "delivery_stats", "weekly_goal", "bonus_reward"],
829
  "texts": {
830
  "header_title": "Rider Hub",
831
  "header_subtitle": "Weekly Performance",
 
839
  "background": "geometric_stripes",
840
  "header": "avatar_search",
841
  "footer": "animated_pills",
842
+ "cards": ["leaderboard_item", "rider_profile", "challenge_card", "badge_showcase"],
843
  "texts": {
844
  "header_title": "Rider Community",
845
  "header_subtitle": "Leaderboard & Friends",
 
855
  "background": "gradient_mesh",
856
  "header": "avatar_search",
857
  "footer": "floating_fab",
858
+ "cards": ["product_vertical", "product_rating", "flash_sale", "brand_card"],
859
  "texts": {
860
  "header_title": "Shop",
861
  "header_subtitle": "Discover Products",
 
869
  "background": "pattern_dots",
870
  "header": "minimal",
871
  "footer": "classic_expanded",
872
+ "cards": ["product_grid_compact", "category_tile", "wishlist_item", "order_tracking"],
873
  "texts": {
874
  "header_title": "Store",
875
  "header_subtitle": "Featured Collection",
 
883
  "background": "abstract_rays",
884
  "header": "collapsible",
885
  "footer": "animated_pills",
886
+ "cards": ["product_featured", "luxury_item", "designer_card", "vip_offer"],
887
  "texts": {
888
  "header_title": "Luxury Collection",
889
  "header_subtitle": "Exclusive Items",
 
897
  "background": "waves_curved",
898
  "header": "tabs",
899
  "footer": "gesture_bar",
900
+ "cards": ["flash_sale", "coupon_card", "deal_countdown", "cart_item"],
901
  "texts": {
902
  "header_title": "Flash Deals",
903
  "header_subtitle": "Limited Time Offers",
 
913
  "background": "organic_fluid",
914
  "header": "avatar_search",
915
  "footer": "minimal_icons",
916
+ "cards": ["post_card", "story_card", "user_profile", "comment_thread"],
917
  "texts": {
918
  "header_title": "Feed",
919
  "header_subtitle": "What's Happening",
 
927
  "background": "gradient_sweep",
928
  "header": "minimal",
929
  "footer": "gesture_bar",
930
+ "cards": ["story_card", "reel_card", "live_stream", "follower_item"],
931
  "texts": {
932
  "header_title": "Stories",
933
  "header_subtitle": "24h Updates",
 
941
  "background": "geometric_hexagons",
942
  "header": "tabs",
943
  "footer": "floating_fab",
944
+ "cards": ["analytics_card", "content_draft", "engagement_stats", "monetization_card"],
945
  "texts": {
946
  "header_title": "Create",
947
  "header_subtitle": "Your Studio",
 
955
  "background": "abstract_constellation",
956
  "header": "collapsible",
957
  "footer": "animated_pills",
958
+ "cards": ["notification_card", "friend_request", "event_card", "poll_card"],
959
  "texts": {
960
  "header_title": "Activity",
961
  "header_subtitle": "Your Network",
 
973
  "background": "gradient_linear",
974
  "header": "minimal",
975
  "footer": "minimal_icons",
976
+ "cards": ["info_card", "action_card", "stats_summary", "quick_action"],
977
  "description": "Simple and clean",
978
  "texts": {
979
  "header_title": "Home",
 
987
  "background": "waves_layered",
988
  "header": "avatar_search",
989
  "footer": "floating_fab",
990
+ "cards": ["feature_card", "activity_card", "progress_bar", "notification_badge"],
991
  "description": "Active and social",
992
  "texts": {
993
  "header_title": "Dashboard",
 
1001
  "background": "abstract_voronoi",
1002
  "header": "tabs",
1003
  "footer": "animated_pills",
1004
+ "cards": ["premium_feature", "pricing_card", "testimonial_card", "cta_card"],
1005
  "description": "Professional look",
1006
  "texts": {
1007
  "header_title": "Overview",
 
1015
  "background": "organic_blobs",
1016
  "header": "collapsible",
1017
  "footer": "classic_expanded",
1018
+ "cards": ["gallery_item", "project_card", "inspiration_card", "community_post"],
1019
  "description": "Fun and creative",
1020
  "texts": {
1021
  "header_title": "Creative Hub",