Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change background color used in Recents apps screen with Flutter app

Tags:

flutter

How can I change the color shown in the app switcher of Android. Right now the color comes up with a gray background, but I want it to be red.

Gray image

This is the app code.

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      color: Colors.red,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Material(
        child: Text('Check color in app switcher.'),
      ),
    );
  }
}

The color parameter of MaterialApp has no effect.

like image 711
S.D. Avatar asked Oct 19 '25 05:10

S.D.


1 Answers

If you are using the MaterialApp you would use the color attribute to change the color of the app bar in the switcher.

You could also use the SystemChrome.setApplicationSwitcherDescription method which you would find in package:flutter/services.dart

like image 106
jogboms Avatar answered Oct 21 '25 03:10

jogboms



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!