Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter webview scaffold #322

Open
samjoe5 opened this issue Feb 12, 2019 · 0 comments
Open

Flutter webview scaffold #322

samjoe5 opened this issue Feb 12, 2019 · 0 comments

Comments

@samjoe5
Copy link

samjoe5 commented Feb 12, 2019

My flutter web-view scaffold URL is working but the default color of the web page is not working.
screenshot from 2019-02-12 16-01-05
`screenshot_1549967372

import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
import 'package:system_shortcuts/system_shortcuts.dart';
import 'package:splashscreen/splashscreen.dart';
import 'package:flutter/rendering.dart';

void main() => runApp(MaterialApp(
    home: MyApp(),
    debugShowCheckedModeBanner: false,
    theme: ThemeData(
      primaryColor: Colors.blueGrey[900],
      brightness:Brightness.light,
      fontFamily: 'Bungee',
      primaryTextTheme: TextTheme(
        title: TextStyle(color: Colors.yellow),
      ),
    )));

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return new SplashScreen(
      seconds: 2,
      navigateAfterSeconds: AfterSplash(),
      image: new Image.asset(
        'assets/images/icon.png',
        width: 100,
        height: 100,
      ),
      backgroundColor: Colors.blueGrey[800],
      photoSize: 100.0,
      loaderColor: Colors.yellow[300],
    );
  }
}

class AfterSplash extends StatefulWidget {
  @override
  _MyAppsState createState() => _MyAppsState();
}

class _MyAppsState extends State<AfterSplash> {
  @override
  Widget build(BuildContext context) {
    return WebviewScaffold(
      appBar: AppBar(title: Text("Crypto Signals"), 
      actions: <Widget>[
        // action button
        IconButton(
            icon: Icon(Icons.screen_rotation),
            onPressed: () async {
              await SystemShortcuts.orientLandscape();

            }),
      ]),
      url: "http://crypto.slamtrade.com/",
      withJavascript: true,
      withZoom: true,
      withLocalStorage: true,
      enableAppScheme: true,
      hidden: true,
      userAgent: 'https://accounts.google.com/signin/oauth/oauthchooseaccount?client_id=966276189940-1k54igc67tmva1i1tbodfmt3k5kf3e1i.apps.googleusercontent.com&as=bZHn1GRLkEC4_cjzG36PNg&destination=https%3A%2F%2Fslamtrade-ui.firebaseapp.com&approval_state=!ChRHRkRjRUhfeFhDZFMtM3ZQNzZychIfMDZJb0UtTWF2bE1ROEhuU1JuY2dubXFPaVNZSWpoWQ%E2%88%99AJDr988AAAAAXGPAtfiv-BKiA0Kd25fHIHc156Jb1sJX&oauthgdpr=1&xsrfsig=ChkAeAh8TyMGfEj66DNTFSmu0TeDs_vg-UHBEg5hcHByb3ZhbF9zdGF0ZRILZGVzdGluYXRpb24SBXNvYWN1Eg9vYXV0aHJpc2t5c2NvcGU&flowName=GeneralOAuthFlow',
    );
  }
}



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant