You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
samples/chrome-os-best-practices
Andrew Brogdon 3d40fa9fb2
Tweaked pubspecs, linted. (#113)
6 years ago
..
android Added Chrome OS Best Practices Sample (#74) 6 years ago
ios Added Chrome OS Best Practices Sample (#74) 6 years ago
lib Tweaked pubspecs, linted. (#113) 6 years ago
test Add analysis_options, re-format, add commas. (#101) 6 years ago
.gitignore Added Chrome OS Best Practices Sample (#74) 6 years ago
.metadata Added Chrome OS Best Practices Sample (#74) 6 years ago
README.md Added Chrome OS Best Practices Sample (#74) 6 years ago
analysis_options.yaml Tweaked pubspecs, linted. (#113) 6 years ago
pubspec.lock Tweaked pubspecs, linted. (#113) 6 years ago
pubspec.yaml Tweaked pubspecs, linted. (#113) 6 years ago

README.md

Chrome OS Best Practices

A Flutter sample app that builds upon the Friendlychat codelab to show how to build a responsive app that works well on Chrome OS

Goals for this sample

  • Showcase how to build an app that works well on Chrome OS including:
    • Changing layouts on screen size and handling resizing well
    • Keyboard navigation support (coming soon!)
    • Deeper mouse/trackpad support: Right click support etc... (coming soon!)

The important bits

main.dart

As of now, the main thing to look at is the main build method where we use layout builder to determine which layouts to build

body: LayoutBuilder(
        builder: (context, constraints) {
          final double width = constraints.maxWidth;
          debugPrint('width: $width');
          if (constraints.maxWidth > 800)
            return TwoPaneChatLayout(chatEntries: chats);
          else
            return ChatListScreen(chatEntries: chats);
        },
      ),

Questions/issues

If you have a general question about building for Chrome OS in Flutter, the best places to go are:

If you run into an issue with the sample itself, please file an issue in the main Flutter repo.