Skip to content

Commit e1796a6

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

File tree

1 file changed

+19
-36
lines changed

1 file changed

+19
-36
lines changed

examples/build.md

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ 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
5554
5655
You can also interact with the reference app to observe specific flows:
5756
@@ -318,7 +317,7 @@ App Section layout:
318317
2. Sticky guidance banner below App ID:
319318
- Text: "Add your own App ID, then rebuild to fully test all functionality."
320319
- Link text: "Get your keys at onesignal.com" (clickable, opens browser via url_launcher)
321-
- Light background color to stand out
320+
- Warning banner styling per styles.md
322321
323322
3. Consent card with up to two toggles:
324323
a. "Consent Required" toggle (always visible):
@@ -346,7 +345,7 @@ User Section layout (separate SectionCard titled "User", placed after App Sectio
346345
- Status shows "Anonymous"
347346
- External ID shows "–" (dash)
348347
- When logged in:
349-
- Status shows "Logged In" with green styling (Color(0xFF2E7D32))
348+
- Status shows "Logged In" with green styling
350349
- External ID shows the actual external user ID
351350
352351
2. LOGIN USER button:
@@ -407,13 +406,8 @@ Send In-App Message Section (placed right after In-App Messaging):
407406
2. BOTTOM BANNER - Icons.vertical_align_bottom, trigger: "iam_type" = "bottom_banner"
408407
3. CENTER MODAL - Icons.crop_square, trigger: "iam_type" = "center_modal"
409408
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
409+
- Button styling: primary (red) background, white text, type-specific icon on
410+
LEFT side only, full width, left-aligned content, UPPERCASE text
417411
- On tap: adds trigger and shows SnackBar "Sent In-App Message: {type}"
418412
- Also upserts `iam_type` in the Triggers list immediately so UI reflects the sent IAM type
419413
@@ -849,9 +843,9 @@ toggle_row.dart:
849843
- Row layout with MainAxisAlignment.spaceBetween
850844
851845
action_button.dart:
852-
- PrimaryButton (filled, primary color background)
853-
- DestructiveButton (outlined, red accent)
846+
- PrimaryButton (filled) and DestructiveButton (outlined)
854847
- Full-width buttons with SizedBox(width: double.infinity)
848+
- Styling per styles.md
855849
856850
list_widgets.dart:
857851
- PairItem (key-value with optional delete IconButton)
@@ -861,8 +855,7 @@ list_widgets.dart:
861855
- PairList (simple list of key-value pairs)
862856
863857
loading_overlay.dart:
864-
- Semi-transparent full-screen overlay using Stack + Container
865-
- Centered CircularProgressIndicator
858+
- Full-screen overlay with centered CircularProgressIndicator (styling per styles.md)
866859
- Shown via isLoading state from AppViewModel
867860
868861
dialogs.dart:
@@ -920,28 +913,18 @@ Used by:
920913
### Prompt 8.5 - Theme
921914

922915
```
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
916+
Create OneSignal theme in lib/theme.dart.
917+
918+
All colors, spacing, typography, button styles, card styles, and component
919+
specs are defined in the shared style reference:
920+
https://raw.githubusercontent.com/OneSignal/sdk-shared/refs/heads/main/demo/styles.md
921+
922+
Implement an AppTheme class with a static ThemeData getter that maps the
923+
style reference values to Material 3 theming (ColorScheme.fromSeed,
924+
CardTheme, ElevatedButtonTheme, InputDecorationTheme, etc.).
925+
926+
Also define AppColors and AppSpacing convenience classes that expose the
927+
tokens from styles.md as typed constants for use throughout the app.
945928
```
946929

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

0 commit comments

Comments
 (0)