Skip to content

Commit d49c00b

Browse files
committed
docs(examples): references shared style guide
1 parent f061c19 commit d49c00b

File tree

1 file changed

+23
-36
lines changed

1 file changed

+23
-36
lines changed

examples/build.md

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ Pay close attention to:
5151
- List item layout (stacked vs inline key-value)
5252
- Icon choices (delete, close, info, etc.)
5353
- Typography, spacing, and colors
54-
- Spacing: 12px gap between sections, 8px gap between cards/buttons within a section
54+
55+
Refer to the shared style reference for exact design tokens (colors, spacing,
56+
typography, buttons, cards, etc.):
57+
https://raw.githubusercontent.com/OneSignal/sdk-shared/refs/heads/main/demo/styles.md
5558
5659
You can also interact with the reference app to observe specific flows:
5760
@@ -318,7 +321,7 @@ App Section layout:
318321
2. Sticky guidance banner below App ID:
319322
- Text: "Add your own App ID, then rebuild to fully test all functionality."
320323
- Link text: "Get your keys at onesignal.com" (clickable, opens browser via url_launcher)
321-
- Light background color to stand out
324+
- Warning banner styling per styles.md
322325
323326
3. Consent card with up to two toggles:
324327
a. "Consent Required" toggle (always visible):
@@ -346,7 +349,7 @@ User Section layout (separate SectionCard titled "User", placed after App Sectio
346349
- Status shows "Anonymous"
347350
- External ID shows "–" (dash)
348351
- When logged in:
349-
- Status shows "Logged In" with green styling (Color(0xFF2E7D32))
352+
- Status shows "Logged In" with green styling
350353
- External ID shows the actual external user ID
351354
352355
2. LOGIN USER button:
@@ -407,13 +410,8 @@ Send In-App Message Section (placed right after In-App Messaging):
407410
2. BOTTOM BANNER - Icons.vertical_align_bottom, trigger: "iam_type" = "bottom_banner"
408411
3. CENTER MODAL - Icons.crop_square, trigger: "iam_type" = "center_modal"
409412
4. FULL SCREEN - Icons.fullscreen, trigger: "iam_type" = "full_screen"
410-
- Button styling:
411-
- RED background color (Color(0xFFE9444E))
412-
- WHITE text
413-
- Type-specific icon on LEFT side only (no right side icon)
414-
- Full width of the card
415-
- Left-aligned text and icon content (not centered)
416-
- UPPERCASE button text
413+
- Button styling: primary (red) background, white text, type-specific icon on
414+
LEFT side only, full width, left-aligned content, UPPERCASE text
417415
- On tap: adds trigger and shows SnackBar "Sent In-App Message: {type}"
418416
- Also upserts `iam_type` in the Triggers list immediately so UI reflects the sent IAM type
419417
@@ -849,9 +847,9 @@ toggle_row.dart:
849847
- Row layout with MainAxisAlignment.spaceBetween
850848
851849
action_button.dart:
852-
- PrimaryButton (filled, primary color background)
853-
- DestructiveButton (outlined, red accent)
850+
- PrimaryButton (filled) and DestructiveButton (outlined)
854851
- Full-width buttons with SizedBox(width: double.infinity)
852+
- Styling per styles.md
855853
856854
list_widgets.dart:
857855
- PairItem (key-value with optional delete IconButton)
@@ -861,8 +859,7 @@ list_widgets.dart:
861859
- PairList (simple list of key-value pairs)
862860
863861
loading_overlay.dart:
864-
- Semi-transparent full-screen overlay using Stack + Container
865-
- Centered CircularProgressIndicator
862+
- Full-screen overlay with centered CircularProgressIndicator (styling per styles.md)
866863
- Shown via isLoading state from AppViewModel
867864
868865
dialogs.dart:
@@ -920,28 +917,18 @@ Used by:
920917
### Prompt 8.5 - Theme
921918

922919
```
923-
Create OneSignal theme in lib/theme.dart:
924-
925-
Colors:
926-
- oneSignalRed = Color(0xFFE54B4D) (primary)
927-
- oneSignalGreen = Color(0xFF34A853) (success)
928-
- oneSignalGreenLight = Color(0xFFE6F4EA) (success background)
929-
- lightBackground = Color(0xFFF8F9FA)
930-
- cardBackground = Colors.white
931-
- dividerColor = Color(0xFFE8EAED)
932-
- warningBackground = Color(0xFFFFF8E1)
933-
934-
Spacing constants:
935-
- cardGap = 8.0 // gap between a card/banner and its action buttons within a section
936-
- sectionGap = 12.0 // gap between sections (SectionCard wrapper bottom margin)
937-
938-
AppTheme class with static ThemeData get light:
939-
- useMaterial3: true
940-
- ColorScheme.fromSeed with OneSignalRed as seed
941-
- Override primary to oneSignalRed
942-
- Custom CardTheme with rounded corners (12dp)
943-
- Custom ElevatedButtonTheme with rounded corners (8dp)
944-
- Custom InputDecorationTheme with OutlineInputBorder
920+
Create OneSignal theme in lib/theme.dart.
921+
922+
All colors, spacing, typography, button styles, card styles, and component
923+
specs are defined in the shared style reference:
924+
https://raw.githubusercontent.com/OneSignal/sdk-shared/refs/heads/main/demo/styles.md
925+
926+
Implement an AppTheme class with a static ThemeData getter that maps the
927+
style reference values to Material 3 theming (ColorScheme.fromSeed,
928+
CardTheme, ElevatedButtonTheme, InputDecorationTheme, etc.).
929+
930+
Also define AppColors and AppSpacing convenience classes that expose the
931+
tokens from styles.md as typed constants for use throughout the app.
945932
```
946933

947934
### Prompt 8.6 - Log View (Appium-Ready)

0 commit comments

Comments
 (0)