https://github.com/rahullkumr/flutter-03-dicee
https://github.com/rahullkumr/flutter-03-dicee
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rahullkumr/flutter-03-dicee
- Owner: Rahullkumr
- Created: 2023-09-01T17:01:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-26T10:03:32.000Z (over 1 year ago)
- Last Synced: 2025-02-06T08:21:21.430Z (5 months ago)
- Language: Dart
- Size: 421 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flutter-03-Dicee
used various widgets like Container, Column, Row, Expanded, etc to develop a stateful Dice app.
## The App
## Notes
### 1. Expanded() widget
- it adjusts it's child a/c to the screen size.
- it's `flex` property will divide the children into ratio### 2. Other way of using AssetImage()
`Image.asset('images/name.png')`
### 3. Deprecated widgets
- FlatButton => TextButton()
- RaisedButton => ElevatedButton()## Different ways to make circle in flutter
1. using `CircleAvatar()` widget
```
CircleAvatar(
radius: 50,
child: Text('My Avatar'),
)
```2. using `borderRadius:` property of Container widget
```
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
),
)
```3. Using `shape: BoxShape.circle` property
```
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
),
)
```4. Using the `CustomPaint`
```
CustomPaint(
painter: CirclePainter(),
)
```# Let's build Stateful Apps
- whatever will change, is coded inside the `State` part of the stateful widget
- State part tracks and updates the screen as the state changes
- `setState((){})` marks certain things dirty
> for eg: leftDice is getting changed inside setState(), so setState() will mark every part, wherever leftDice is used, as DIRTY- `setState((){})` triggers/calls the build method and tells it that state has changed
- whenever hot reload is done, the `build()` method is called and it re-builds only those parts that are marked as DIRTY
- `Hot reload` is a feature of Flutter that allows to see the changes in code without having to rebuild the app. When a change is made to a `stateful widget`, the `dirty` flag will be set and the `build()` method will be called. This will cause the widget to be rebuilt and the changes will be reflected in the app.
-----
Run any Flutter repository on Zapp website: refer this link
List of all Flutter apps: click here