Skip to content

[adaptive_scaffold] asserts that navigation rail items cannot be less than two items #110902

Closed

Description

@a-wallen

The layout procedure responsible for the left navigation bar should resemble the Drawer APIs. If we set the number of NavigationDestinations on AdaptiveScaffold to some arbitrary number, we must have some comprehensive reason for why we do not allow an empty sidebar or one element in the sidebar.

Give a better error message whenever the rules of the NavigationDestination items are less than the number required.

Steps to Reproduce

Code sample
  1. Clone flutter/packages into the folder of your choice (at the time of writing, AdaptiveScaffold has not been released.
  2. Add adaptive_scaffold to the flutter project:
dependencies
    adaptive_scaffold:
        path: <path_to_the_packages_repo>/packages/adaptive_scaffold/
  1. Add the following tomain.dart
import 'package:flutter/material.dart';
import 'package:adaptive_scaffold/adaptive_scaffold.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: AdaptiveScaffold(
        destinations: [
          NavigationDestination(icon: Icon(Icons.home), label: "ABCDEFGHIJKLMNOP")
        ],
      ),
    );
  }
}

Activity

  1. changed the title [-]`AdaptiveScaffold` asserts that navigation rail items cannot be less than two[/-] [+]`AdaptiveScaffold` asserts that navigation rail items cannot be less than two items[/+] on Sep 7, 2022
  2. changed the title [-]`AdaptiveScaffold` asserts that navigation rail items cannot be less than two items[/-] [+][adaptive_scaffold] asserts that navigation rail items cannot be less than two items[/+] on Sep 14, 2022
  3. added
    in triagePresently being triaged by the triage team
    packageflutter/packages repository. See also p: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Sep 15, 2022
  4. added
    P3Issues that are less important to the Flutter project
    on Sep 20, 2022
  5. flutter-triage-bot commented on Jul 10, 2023

    @flutter-triage-bot

    This issue is missing a priority label. Please set a priority label when adding the triaged-ecosystem label.

  6. aliasgar4558 commented on Mar 21, 2024

    @aliasgar4558
    Contributor

    Added assertion, we can mark this issue as Closed.

  7. added 2 commits that reference this issue on Mar 22, 2024
  8. added a commit that references this issue on Mar 22, 2024
  9. aliasgar4558 commented on May 10, 2024

    @aliasgar4558
    Contributor

    @a-wallen - Can you please mark this bug as closed?

  10. github-actions commented on May 27, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectp: flutter_adaptive_scaffoldThe flutter_adaptive_scaffold packagepackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions