Skip to content

Instantly share code, notes, and snippets.

@doyle-flutter
Last active February 19, 2021 05:01
Show Gist options
  • Save doyle-flutter/7e41daa3a967e0855db0f6562e7acb96 to your computer and use it in GitHub Desktop.
Save doyle-flutter/7e41daa3a967e0855db0f6562e7acb96 to your computer and use it in GitHub Desktop.
#07 포그라운드 - 플러터 : 메인
// ... import, main 생략
class ForegroundPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Flutter Foreground")),
body: Center(
child: TextButton(
child: Text("PLAY"),
onPressed: () async{
const String _method = "foregroundflutter";
const String _channelName = "app.james.cam/foregroundflutter";
MethodChannel channel = new MethodChannel(_channelName);
await channel.invokeMethod<void>(_method);
return;
},
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment