flutter_multi_window 0.1.0+2

  • Readme
  • Changelog
  • Example
  • Installing
  • new67

Buy Me A Coffee Donate Pub

flutter_multi_window #

A Flutter package to create new windows on supported platforms.

Online Demo: https://rodydavis.github.io/flutter_multi_window/

Only supports web at the moment!

Getting Started #

final window = NewWindow(
  url: 'https://flutter.dev',
  width: 400,
  height: 400,
);
if (kIsWeb) {
  window.create(); // Show the window
}

[0.0.1] - TODO: Add release date. #

  • TODO: Describe initial release.

example/lib/main.dart

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

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

final Color darkBlue = Color.fromARGB(255, 18, 32, 47);

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'flutter_multi_window',
      debugShowCheckedModeBanner: false,
      theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({
    Key key,
  }) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String _url = 'https://flutter.dev';
  double _width = 0.5;
  double _height = 0.5;

  @override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;
    final height = size.height * _height;
    final width = size.width * _width;
    return Scaffold(
      body: Center(
        child: Container(
          width: 300,
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              ListTile(
                title: TextFormField(
                  initialValue: _url,
                  onChanged: (val) {
                    _url = val;
                  },
                  decoration: InputDecoration(
                    labelText: "URL",
                  ),
                ),
              ),
              ListTile(
                title: Text('Width % = ${width.toStringAsFixed(1)}'),
                subtitle: Slider(
                  value: _width,
                  onChanged: (val) {
                    if (mounted)
                      setState(() {
                        _width = val;
                      });
                  },
                ),
              ),
              ListTile(
                title: Text('Height % = ${height.toStringAsFixed(1)}'),
                subtitle: Slider(
                  value: _height,
                  onChanged: (val) {
                    if (mounted)
                      setState(() {
                        _height = val;
                      });
                  },
                ),
              ),
              RaisedButton.icon(
                icon: Icon(Icons.desktop_windows),
                label: Text('Create Window'),
                onPressed: () {
                  NewWindow(
                    url: _url,
                    width: width,
                    height: height,
                  )..create();
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_multi_window: ^0.1.0+2

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:flutter_multi_window/flutter_multi_window.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
34
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]
67
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/flutter_multi_window.dart.

Run flutter format to format lib/flutter_multi_window.dart.

Format lib/src/new_window/new_window.dart.

Run flutter format to format lib/src/new_window/new_window.dart.

Dependencies

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