night_color 0.0.1 copy "night_color: ^0.0.1" to clipboard
night_color: ^0.0.1 copied to clipboard

Night Color adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:night_color/night_color.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool enabled = true;

  @override
  Widget build(BuildContext context) {
    return NightColor(
      enabled: enabled,
      child: Scaffold(
        appBar: AppBar(
          title: const Text('Night Color Demo Home Page'),
        ),
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Text(
                "test night color",
                style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
              ),
              Switch(
                value: enabled,
                onChanged: (value) {
                  setState(() {
                    enabled = value;
                  });
                },
              )
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
12
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Night Color adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on night_color