ybq / Android-SpinKit

Android loading animations
https://ybq.github.io/Android-SpinKit
MIT License
8.6k stars 1.31k forks source link

how to clear background color #53

Open arshadsk5 opened 5 years ago

arshadsk5 commented 5 years ago

Hi when the loader is displayed , the whole screen is in white color, how do i remove that color and my app screen should be visible in background.

Please help thanks in advance.

katsumeshi commented 5 years ago

@arshadsk5 I had same issue.

getWindow().setBackgroundDrawableResource(android.R.color.transparent);

this works for me

ajini-sahaejana commented 3 years ago

@arshadsk5 I had same issue.

getWindow().setBackgroundDrawableResource(android.R.color.transparent);

this works for me

Where should insert it into in the following code? Thanks!

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:green_pedals/constants.dart';

class Loading extends StatelessWidget {
  //const Loading({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    getWindow().setBackgroundDrawableResource(android.R.color.transparent);
    return Container(
      child: Center(
        child: SpinKitDoubleBounce(
          color: kPrimaryLightColor,
          size: 40.0,
        ),
      ),
    );
  }
}