can we use API to change this color on iOS/Android in Flutter?
CodePudding user response:
Yes, You can use API to change the color of the bottom safe area try with the below code. I hope your problem will be resolved.
@override
Widget build(BuildContext context) {
return FutureBuilder<ModelClassName>(
future: getColorFromAPI....,
builder:(context,snapshot){
final color = snapshot.data;
return Container(
color: color,
child: SafeArea(
top: false,
child: Scaffold(
resizeToAvoidBottomInset: false,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Change Bottom Bar Color',
),
],
),
),
),
),
),
}
);
}
}
CodePudding user response:
If you want to use with Package try this
import 'package:flutter_statusbarcolor_ns/flutter_statusbarcolor_ns.dart';
FlutterStatusbarcolor.setStatusBarColor(Colors.white);
Without package, Recommended solution (Flutter 2.0 and above)
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.white
));