Repository: flutter
Issue: [Semantics] Feature: respect sortKey outside parent widget tree
Labels: framework,a: accessibility,c: proposal,P3,team-accessibility,triaged-accessibility

### Use case

I am trying to control the Semantic traverse order.
Right now the following code(63 lines of code): 
```dart
 Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Expanded(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.end,
              children: [
                Text("Sell", style: labelTextStyle),
                const SizedBox(height: 8),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Semantics(sortKey: const OrdinalSortKey(1), child: Text("Amount", style: contentTextStyle)),
                    Semantics(sortKey: const OrdinalSortKey(3), child: Text("Limit", style: contentTextStyle)),
                  ],
                ),
                const SizedBox(height: 8),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Semantics(sortKey: const OrdinalSortKey(2), child: const Text("675")),
                    Semantics(sortKey: const OrdinalSortKey(4), child: Text("8,333.67", style: TextStyle(color: appColors.valueRedColor))),
                  ],
                ),
              ],
            ),
          ),
          Padding(
            padding: const EdgeInsets.symmetric(horizontal: 16),
            child: Container(
              color: Colors.grey.withOpacity(0.4),
              width: 1,
              height: 62,
            ),
          ),
          Expanded(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text("Buy", style: labelTextStyle),
                const SizedBox(height: 8),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text("Limit", style: contentTextStyle),
                    Text("Amount", style: contentTextStyle),
                  ],
                ),
                const SizedBox(height: 8),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text("13,222.45", style: TextStyle(color: appColors.valueRedColor)),
                    const Text("345"),
                  ],
                ),
              ],
            ),
          ),
        ],
      )
```
Creates the following traverse order:
https://github.com/user-attachments/assets/2b8b7f61-24b2-4c9b-914b-a9be9e3cfd99
So the Semantic traverse order wasn't affected by the sortKey at all.

So the sortKey doesn't work if the Semantic widget has a different parent. 

Eventually, I got the desired behavior(Not perfect):
https://github.com/user-attachments/assets/ee20fadd-3f6a-42dd-8381-5b0dbb0ece28

By refactoring the code to this(79 lines):
```dart
Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Expanded(
            child: MergeSemantics(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.end,
                children: [
                  Text("Sell", style: labelTextStyle),
                  const SizedBox(height: 8),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text("Amount", style: contentTextStyle),
                          const SizedBox(height: 8),
                          const Text("675"),
                        ],
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.end,
                        children: [
                          Text("Limit", style: contentTextStyle),
                          const SizedBox(height: 8),
                          const Text("8,333.67"),
                        ],
                      )
                    ],
                  ),
                ],
              ),
            ),
          ),
          Padding(
            padding: const EdgeInsets.symmetric(horizontal: 16),
            child: Container(
              color: Colors.grey.withOpacity(0.4),
              width: 1,
              height: 62,
            ),
          ),
          Expanded(
            child: MergeSemantics(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text("Buy", style: labelTextStyle),
                  const SizedBox(height: 8),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text("Amount", style: contentTextStyle),
                          const SizedBox(height: 8),
                          const Text("345"),
                        ],
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.end,
                        children: [
                          Text("Limit", style: contentTextStyle),
                          const SizedBox(height: 8),
                          const Text("13,222.45"),
                        ],
                      )
                    ],
                  ),
                ],
              ),
            ),
          ),
        ],
      )
```

It will be nice if the sortKey worked in scope of some other widget. Something like: FocusTraversalGroup.

### Proposal

If I am doing something wrong or there is already a solution for this I would be glad to hear.
If not...

Some wrapper widget like SemanticTraversalGroup would be nice to reduce complexity(of the devs :)