What is the difference between Scaffold and Container in Flutter?

Technology CommunityCategory: FlutterWhat is the difference between Scaffold and Container in Flutter?
VietMX Staff asked 3 years ago

Scaffold and container both serves different purpose for design.

Scaffold

  • Implements the basic material design visual layout structure.
  • This class provides APIs for showing drawers, snack bars, and bottom sheets.

Container

  • A convenience widget that combines common painting, positioning, and sizing widgets.
  • It basically contains different widget into one widget over which you can give padding , size, position etc.

You need Scaffold widget as main parent of your page where you use container for smaller widget into page to give them different properties like size, border, padding, margin etc.