
here is the demo, only push a new page , then pop:
class _SecondPageState extends State<SecondPage> {
Shell shell = Shell();
@override
void initState() {
super.initState();
// runShell();
}
@override
void dispose() {
super.dispose();
shell.kill();
}
Future runShell() async {
await shell.cd(r'D:\data\projects\magic_box').runExecutableArguments('git', ['status']);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Container(),
);
}
}
process_run: ^0.14.2
flutter: 3.19.0
windows 11 or 10