Skip to content

Instantly share code, notes, and snippets.

@sbis04
Last active October 11, 2019 07:12
Show Gist options
  • Save sbis04/743e78b5f70356c41b4e8da93abe201b to your computer and use it in GitHub Desktop.
Save sbis04/743e78b5f70356c41b4e8da93abe201b to your computer and use it in GitHub Desktop.
Flutter VR
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart';
void main() {
SystemChrome.setEnabledSystemUIOverlays([]);
runApp(MyApp());
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Colors.transparent, // navigation bar color
statusBarColor: Colors.transparent,
systemNavigationBarIconBrightness: Brightness.dark, // status bar color
));
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter VR',
theme: ThemeData(
primarySwatch: Colors.blue,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Container(
color: Colors.blue,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(),
Text(
'Flutter VR',
style: TextStyle(
fontSize: 60,
color: Colors.white,
fontWeight: FontWeight.bold
),
),
SizedBox(height: 20),
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)),
color: Colors.blue[800],
child: Padding(
padding: const EdgeInsets.all(10),
child: Text(
'ENTER',
style: TextStyle(
fontSize: 25,
color: Colors.white,
),
),
),
onPressed: () => _launchURL(context),
),
],
),
),
),
);
}
Future<void> _launchURL(BuildContext context) async {
try {
await launch(
// NOTE: Replace this URL with your GitHub Pages URL.
'https://sbis04.github.io/demo360',
option: CustomTabsOption(
toolbarColor: Theme.of(context).primaryColor,
enableDefaultShare: true,
enableUrlBarHiding: true,
showPageTitle: false,
animation: CustomTabsAnimation.slideIn(),
extraCustomTabs: const <String>[
// ref. https://play.google.com/store/apps/details?id=org.mozilla.firefox
'org.mozilla.firefox',
// ref. https://play.google.com/store/apps/details?id=com.microsoft.emmx
'com.microsoft.emmx',
],
),
);
} catch (e) {
// An exception is thrown if browser app is not installed on Android device.
debugPrint(e.toString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment