Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Design Pattern Examples in Dart

License

NotificationsYou must be signed in to change notification settings

RefactoringGuru/design-patterns-dart

Repository files navigation

This repository is part of theRefactoring.Guru project.It containsDart examples for all classicGoF design patterns.

Implementation checklist:

Requirements

The examples were written inDart 2.17.Some complex examples requireFlutter 3.0.0.

Contributor's Guide

We appreciate any help, whether it's a simple fix of a typo or a whole new example.Justmake a fork,do your change and submit apull request.

Step-by-step instruction

  1. Just make a fork.
  2. Clone the forked repository to your local machine.
  3. Create a new branch and name it, for example: fix-issue-32.
  4. Make changes.
  5. Create commits and push them to your forked Github repository.
  6. Submit a pull request to the master branch.
  7. Wait for review.

Style guide

Here's a style guide which might help you to keep your changes consistent with our code:

  1. All code should meet theEffective Dart: Style.

  2. UseDart Format or auto format shortcutCtrl + Alt + L in your ide.

  3. Try to hard wrap the code at 80th's character. It helps to list the code on the website without scrollbars.

  4. File names should match following convention:some_class_name.dart

  5. Comments may or may not have language tags in them, such as this:

    // EN: All products families have the same varieties (MacOS/Windows).// This is a MacOS variant of a button.// RU: Все семейства продуктов имеют одни и те же вариации (MacOS/Windows).// Это вариант кнопки под MacOS.

    Don't be scared and ignore the non-English part of such comments. If you want to changesomething in a comment like this, then do it. Even if you do it wrong, we'll tell you howto fix it during the Pull Request.

Build Flutter examples

cd root directoryflutter build web -t bin\main.dart

Deploy flutter demos

  1. Fork this repo:https://github.com/RefactoringGuru/design-patterns-dart
  2. Apply your changes.
  3. Run the scriptdart bin\deploy_flutter_demos.dart.This script will build a web platform flutter app and push the changes to yourweb-demos branch on github.
  4. You can now make a pull request on theweb-demos branch.
  5. Once approved for the merge, the web app will be available athttps://refactoringguru.github.io/design-patterns-dart .

License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Creative Commons License

Credits

Authors: Alexander Shvets (@neochief), ilopX (@ilopX)


[8]ページ先頭

©2009-2025 Movatter.jp