lock_orientation

Last updated:

0 purchases

lock_orientation Image
lock_orientation Images
Add to Cart

Description:

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

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.