Last updated:
0 purchases
lock orientation
lock_orientation #
What does this library do? #
This library locks device's orientation (like PortraitUp,LandscapeLeft,LandscapeRight) and give you current orientation.
Usage #
Use lockOrientation() and unlockOrientation() whenever you want.
You can also get current orientation with getOrientation().
Example #
Center(
child: Column(mainAxisSize: MainAxisSize.min,
children: [
ElevatedButton(onPressed: (){
getOrientation().then((ori) {
setState(() {
_orientation=ori.toString();
});
});
},child: Text(_orientation),),
Switch(value: islock, onChanged: (v){
if(islock) {
unlockOrientation();
}else{
lockOrientation();
}
setState(() {
islock=v;
});
})
],
),
),
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.