Initial commit

This commit is contained in:
Yas Opisso
2025-12-12 14:31:36 -05:00
commit 83775bdc72
175 changed files with 17284 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
import 'package:flutter/cupertino.dart';
class CupertinoIconHelper {
static const Map<
String,
IconData
>
_iconMap = {
'add': CupertinoIcons.add,
'add_circled': CupertinoIcons.add_circled,
'bell': CupertinoIcons.bell,
'bell_fill': CupertinoIcons.bell_fill,
'camera': CupertinoIcons.camera,
'camera_fill': CupertinoIcons.camera_fill,
'car': CupertinoIcons.car,
'house': CupertinoIcons.house,
'house_fill': CupertinoIcons.house_fill,
'leaf': CupertinoIcons.leaf_arrow_circlepath,
'person': CupertinoIcons.person,
'person_fill': CupertinoIcons.person_fill,
'search': CupertinoIcons.search,
'sportscourt': CupertinoIcons.sportscourt,
'sportscourt_fill': CupertinoIcons.sportscourt_fill,
'wrench': CupertinoIcons.wrench,
'wrench_fill': CupertinoIcons.wrench_fill,
'square_grid_2x2': CupertinoIcons.square_grid_2x2,
'square_grid_2x2_fill': CupertinoIcons.square_grid_2x2_fill,
'desktopcomputer': CupertinoIcons.desktopcomputer,
'tree': CupertinoIcons.tree,
// extend with more CupertinoIcons as needed
};
static IconData fromString(
String key,
) {
return _iconMap[key] ??
CupertinoIcons.question; // 👈 default fallback
}
}

View File

@@ -0,0 +1,65 @@
const appTitle = 'HUM';
// GENERAL
const doneLabel = 'Done';
const doneCancel = 'Cancel';
const doneBack = 'Back';
// HOME PAGE
const homeViewSearchPlaceholder = 'Ask me anything...';
const homeViewVoiceTitle = 'Tap the image, chat with HUM AI';
const homeViewVoiceMessage = 'Your intelligent rental marketplace';
const homeBTNBrowse = 'Show Listings';
const homeViewAI = 'HUM AI';
const homeViewGrid = 'GRID';
const homeViewMap = 'SHOW MAP';
const homeViewIdeas = [
'💡 Ask: "Find gaming gear near me"',
'💡 Ask: "What is trending in electronics"',
'💡 Try: "Show me constructions tools."',
'💡 Try: "I need camera gear for a wedding"',
];
// HOME FILTERS
const filterLocation = 'Location';
const filterLocationPlaceholder = 'Type a city or location...';
const filterDates = 'Dates';
const filterLabelStartDate = 'Start Date';
const filterLabelEndDate = 'End Date';
const filterPricing = 'Price';
// LISTINGS
const listingAddTitle = 'Add Your Item';
const listingAddMessage =
"Snatch a photo, we'll fill in the details for you. You can edit before posting.";
const listingTakePhoto = 'Take a photo';
const listingTakePhotoDescription = 'Use your camera';
const listingChoosePhoto = 'Choose from Library';
const listingChoosePhotoDescription = 'Select existing photo';
const listingLabelFeatures = 'Features';
const listingLabelOwner = 'Owner';
const listingLabelCondition = 'Condition: ';
const listingConditionGood = 'Good';
const listingActionMessage = 'Message';
const listingActionRent = 'Rent';
// AUTH
const authTitleSignIn = 'Welcome Back';
const authTitleSignUp = 'Create Account';
const authPlaceholderDisplayName = 'Display Name';
const authPlaceholderEmail = 'Email';
const authPlaceholderPassword = 'Password';
const authSignIn = 'Sign In';
const authSignUp = 'Sign Up';
const authModeSignUp = 'Need an account? Sign Up';
const authModeSignIn = 'Got an account? Sign In';
const authSignGoogle = 'Sign in with Google';
const authSignApple = 'Sign in with Apple';
// PROFILE
const profileTitle = 'Profile';
const profileBtnSignOut = 'Sign Out';
const profileStatRental = 'Rentals';
const profileStatListings = 'Listings';
const profileStatEarnings = 'Earnings';
const profileStatFavorites = 'Favorites';

View File

@@ -0,0 +1,33 @@
import 'package:flutter/cupertino.dart';
// SIZES
const searchBarHeight = 40.0;
const categoryHeight = 30.0;
const roundLarge = 12.0;
const radiusCards = 26.0;
// COLORS
const colorAccentPrimary = CupertinoDynamicColor.withBrightness(
color: Color(0xFF00CC00),
darkColor: Color(0xFF67ce67),
);
const colorAccentSecondary = CupertinoDynamicColor.withBrightness(
color: Color(0xFF283CD7),
darkColor: Color(0xFF369DF7),
);
const colorBackground = CupertinoDynamicColor.withBrightness(
color: Color(0xFFF8F8F8),
darkColor: Color(0xFF0a0a0a),
);
const colorBarBackground = CupertinoColors.systemGrey6;
const colorBarControl = CupertinoColors.systemGrey5;
const colorBarControlBordeer = CupertinoColors.systemGrey4;
const colorBarButton = CupertinoColors.systemGrey5;
const colorCategoryButtonBG = CupertinoColors.systemGrey3;
const colorCategoryButtonFG = CupertinoDynamicColor.withBrightness(
color: Color(0xFFFFFFFF),
darkColor: Color(0xFFDFDFE5),
);

View File

@@ -0,0 +1,59 @@
import 'package:flutter/cupertino.dart';
Future<
bool
>
showYesNoDialog(
BuildContext context, {
String close = 'Close',
String accept = 'Accept',
String title = '',
String message = '',
VoidCallback? actionClose,
VoidCallback? actionOk,
}) async {
final result =
await showCupertinoDialog<
bool
>(
context: context,
builder:
(
BuildContext context,
) {
return CupertinoAlertDialog(
title: Text(
title,
),
content: Text(
message,
),
actions: [
CupertinoDialogAction(
isDefaultAction: true,
onPressed: () => Navigator.pop(
context,
false,
),
child: Text(
close,
),
),
CupertinoDialogAction(
isDestructiveAction: true,
onPressed: () => Navigator.pop(
context,
true,
),
child: Text(
accept,
),
),
],
);
},
);
return result ??
false; // false if dismissed
}

File diff suppressed because it is too large Load Diff

153
lib/core/utils/toaster.dart Normal file
View File

@@ -0,0 +1,153 @@
import 'package:flutter/cupertino.dart';
import 'dart:async';
import 'package:hum/core/constants/app_theme.dart';
void
showCupertinoToast(
BuildContext context,
String message,
) {
final overlay = Overlay.of(
context,
);
// Animation controller lives inside an OverlayEntry widget
late OverlayEntry entry;
final animationController = AnimationController(
vsync: Navigator.of(
context,
),
duration: const Duration(
milliseconds: 250,
),
);
entry = OverlayEntry(
builder:
(
ctx,
) {
return Positioned(
bottom: 30,
left: 24,
right: 24,
child: FadeTransition(
opacity: CurvedAnimation(
parent: animationController,
curve: Curves.easeInOut,
),
child: CupertinoPopupSurface(
isSurfacePainted: true,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 12,
),
decoration: BoxDecoration(
// color: CupertinoColors.black.withValues(
// alpha: .8,
// ),
color: CupertinoDynamicColor.resolve(
colorBackground,
context,
),
borderRadius: BorderRadius.circular(
12,
),
),
child: Center(
child: Text(
message,
style: const TextStyle(
color: CupertinoColors.white,
fontSize: 16,
),
textAlign: TextAlign.center,
),
),
),
),
),
);
},
);
overlay.insert(
entry,
);
// Animate fade-in
animationController.forward();
// Wait, then fade out and remove
Future.delayed(
const Duration(
seconds: 2,
),
).then(
(
_,
) async {
await animationController.reverse();
entry.remove();
animationController.dispose();
},
);
}
// void
// showCupertinoToast(
// BuildContext context,
// String message,
// ) {
// final overlay = Overlay.of(
// context,
// );
// final overlayEntry = OverlayEntry(
// builder:
// (
// _,
// ) => Positioned(
// bottom: 100, // distance from bottom
// left: 24,
// right: 24,
// child: CupertinoPopupSurface(
// isSurfacePainted: true,
// child: Container(
// padding: const EdgeInsets.symmetric(
// horizontal: 16,
// vertical: 12,
// ),
// decoration: BoxDecoration(
// color: CupertinoColors.black.withValues(
// alpha: 0.8,
// ),
// borderRadius: BorderRadius.circular(
// 12,
// ),
// ),
// child: Center(
// child: Text(
// message,
// style: const TextStyle(
// color: CupertinoColors.white,
// ),
// textAlign: TextAlign.center,
// ),
// ),
// ),
// ),
// ),
// );
// overlay.insert(
// overlayEntry,
// );
// Future.delayed(
// const Duration(
// seconds: 2,
// ),
// overlayEntry.remove,
// );
// }