build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Describes the part of the user interface represented by this widget.

The framework calls this method when this widget is inserted into the tree in a given BuildContext and when the dependencies of this widget change (e.g., an InheritedWidget referenced by this widget changes). This method can potentially be called in every frame and should not have any side effects beyond building a widget.

The framework replaces the subtree below this widget with the widget returned by this method, either by updating the existing subtree or by removing the subtree and inflating a new subtree, depending on whether the widget returned by this method can update the root of the existing subtree, as determined by calling Widget.canUpdate.

Typically implementations return a newly created constellation of widgets that are configured with information from this widget's constructor and from the given BuildContext.

The given BuildContext contains information about the location in the tree at which this widget is being built. For example, the context provides the set of inherited widgets for this location in the tree. A given widget might be built with multiple different BuildContext arguments over time if the widget is moved around the tree or if the widget is inserted into the tree in multiple places at once.

The implementation of this method must only depend on:

If a widget's build method is to depend on anything else, use a StatefulWidget instead.

See also:

  • StatelessWidget, which contains the discussion on performance considerations.

Implementation

@override
Widget build(BuildContext context) {
  return Container(
    width: double.infinity,
    height: double.infinity,
    // RN ModalSheet background = surface (#FAFAFA)
    color: const Color(0xFFFAFAFA),
    // ModalSheet paddingHorizontal: 24 — applied to all children
    padding: const EdgeInsets.symmetric(horizontal: 24),
    child: Column(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        // ── Scrollable content area, top-aligned with paddingTop:20 ──
        Expanded(
          child: Padding(
            padding: const EdgeInsets.only(top: 20),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                // ── BrandMark (marginBottom:32) ──
                Container(
                  margin: const EdgeInsets.only(bottom: 32),
                  child: Image.asset(
                    'packages/onairos/assets/images/OnairosNewLogo.png',
                    width: 110,
                    height: 110,
                    fit: BoxFit.contain,
                    errorBuilder: (_, __, ___) => const SizedBox(
                      width: 110,
                      height: 110,
                      child: Center(
                        child: Text(
                          'Onairos',
                          style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12),
                        ),
                      ),
                    ),
                  ),
                ),

                // ── HeadingGroup (marginBottom:24) ──
                // kicker: 18px bold grey500 letterSpacing:-0.24
                const Text(
                  'Welcome to',
                  style: TextStyle(
                    fontFamily: 'IBM Plex Sans',
                    fontWeight: FontWeight.w700,
                    fontSize: 18,
                    height: 20 / 18,
                    color: Color(0xFF86888E), // grey500
                    letterSpacing: -0.24,
                  ),
                ),
                const SizedBox(height: 4),
                // title: 48px bold grey800
                const Text(
                  'Onairos',
                  style: TextStyle(
                    fontFamily: 'IBM Plex Sans',
                    fontWeight: FontWeight.w700,
                    fontSize: 48,
                    height: 54 / 48,
                    color: Color(0xFF1F242F), // grey800
                  ),
                ),
                const SizedBox(height: 24),

                // ── BodyText (paddingH:20 within ModalSheet's 24px, marginBottom:32) ──
                const Padding(
                  padding: EdgeInsets.symmetric(horizontal: 20),
                  child: Text(
                    'The secure, portable persona built from your data. Every app personalized while your data stays yours.',
                    textAlign: TextAlign.center,
                    style: TextStyle(
                      fontFamily: 'Inter',
                      fontWeight: FontWeight.w400,
                      fontSize: 16,
                      height: 24 / 16,
                      color: Color(0xFF62646C), // grey600
                    ),
                  ),
                ),
                const SizedBox(height: 32),

                // ── Spacer (flex:1) pushes button to bottom ──
                const Spacer(),
              ],
            ),
          ),
        ),

        // ── Button (buttonContainer: paddingH:24 + ModalSheet's 24 = 48px from edge) ──
        Padding(
          padding: const EdgeInsets.fromLTRB(24, 0, 24, 20),
          child: NpmPrimaryButton(
            label: 'Get Started',
            onPressed: () {
              HapticFeedback.lightImpact();
              onContinue();
            },
            // Default IconCircle (dark gradient circle with → arrow)
          ),
        ),
      ],
    ),
  );
}