An animated widget that displays atom with a three electrons revolving around a nucleus at its center.
- Can be scaled upto any size within parent widget boundaries
- Smooth animations with mathematically pre-derived ellipse path equation
- Transparent background for flexible usage with colors
- 3 electron orbits (support for more may come later)
- Orbits angle can be changed
- Orbits color can be changed (support for individual color may come later)
- Nucleus color can be changed
- Electrons color can be changed (support for individual color may come later)
- Individual electron's revolution duration can be changed
- Any widget can be added in the center instead of nucleus
pubspec.yaml of your flutter project, add the following dependency:
dependencies: ... create_atom: ^1.4.0
In your library add the following import:
After that run
flutter pub get
For help getting started with Flutter, view the online documentation.
... child: Atom( size: 100.0, ), ...
Yeah, just like that.
All properties are optional except
You will get a black atom by default.
centerWidget property usage -
centerWidget with any widget to display that Widget instead of nucleus.
... child: Atom( size: 100.0, centerWidget: Text("At Center"), ), ...
Note: If both
centerWidget are set then the Widget will get preference.
|size||Defines size of the atom's container|
|orbit1angle||Defines 1st orbit's angle in radians|
|orbit2angle||Defines 2nd orbit's angle in radians|
|orbit3angle||Defines 3rd orbit's angle in radians|
|nucleusColor||Defines Nucleus Color|
|orbitsColor||Defines Orbits Color|
|electronsColor||Defines Electrons Color|
|animDuration1||Defines Animation Duration of 1st electron|
|animDuration2||Defines Animation Duration of 2nd electron|
|animDuration3||Defines Animation Duration of 3rd electron|
|centerWidget||Defines a widget to display at center|
Types and Initial Values -
Breaking Changes from v1.4.0 kindly see changelog
See CHANGELOG.md for recent changes.
You can be of great help if you want to improve or add anything !
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
Package and all code within licensed under MIT License.