crayola 1.0.0+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 70
crayola

snack pub style: pedantic license

A plugin for customising Flutter desktop window properties. Currently macOS only.

Usage #

Set title bar color:

Crayloa.setTitleBarColor(Colors.blue);

Set tile bar color, with platform-default transparency:

Crayola.setTitleBarColor(Colors.blue, false);

Set title text visibility:

Crayola.setTitleVisbility(false);

Set the title bar visiblity (removes the entire bar):

Crayola.setTitleBarVisiblity(false);

1.0.0+1 #

  • Add documentation
  • Update description

1.0.0 #

  • Bump package version
  • Update readme

0.0.1 #

  • Initialize repository

example/lib/main.dart

import 'dart:async';
import 'package:crayola/crayola.dart';
import 'package:flutter/material.dart';

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

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

class _MyAppState extends State<MyApp> {
  bool showTitle;
  bool showTitleBar;

  @override
  void initState() {
    super.initState();
    showTitle = false;
    showTitleBar = true;
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    await Crayola.setTitleBarColor(Color.fromARGB(255, 76, 75, 80));
    await Crayola.setTitleVisibility(false);
    if (!mounted) return;
  }

  void setTitle(bool value) {
    Crayola.setTitleVisibility(value);
    setState(() {
      showTitle = value;
    });
  }

  void setTitleBar(bool value) {
    Crayola.setTitleBarVisibility(value);
    setState(() {
      showTitleBar = value;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData.light(),
      home: Scaffold(
        body: Column(
          children: [
            Container(
              height: 48.0,
              color: Color.fromARGB(255, 76, 75, 80),
              child: Row(
                mainAxisSize: MainAxisSize.max,
              ),
            ),
            SwitchListTile.adaptive(
              title: const Text('Show title'),
              value: showTitle,
              onChanged: setTitle,
            ),
            SwitchListTile.adaptive(
              title: const Text('Show title bar'),
              value: showTitleBar,
              onChanged: setTitleBar,
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  crayola: ^1.0.0+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:crayola/crayola.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
40
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform android

Because:

  • package:crayola/crayola.dart that declares support for platforms: macos

Package does not support Flutter platform ios

Because:

  • package:crayola/crayola.dart that declares support for platforms: macos

Package does not support Flutter platform linux

Because:

  • package:crayola/crayola.dart that declares support for platforms: macos

Package does not support Flutter platform web

Because:

  • package:crayola/crayola.dart that declares support for platforms: macos

Package does not support Flutter platform windows

Because:

  • package:crayola/crayola.dart that declares support for platforms: macos

Package not compatible with SDK dart

Because:

  • crayola that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test