cupertino_controllers 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

Buy Me A Coffee Donate

cupertino_controllers #

A Flutter plugin with Cupertino Controller Examples

Getting Started #

See Example for Documentation

Completed:

  • Master Detail Controller
  • Table View Controller

0.1.0 - 04.06.2019 #

  • Updating Example for Desktop

0.0.3 #

  • Now Just Pure Dart

0.0.2 #

  • Added Master Detail Controller
  • Added Table View Controller
  • Updated Example

0.0.1 #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'tabs/master_detail_controller.dart';

import 'tabs/table_view_controller.dart';

import 'dart:io' show Platform;
import 'package:flutter/foundation.dart';

// The existing imports
// !! Keep your existing impots here !!

/// main is entry point of Flutter application
void main() {
  // Desktop platforms aren't a valid platform.
  _setTargetPlatformForDesktop();

  return runApp(MyApp());
}

/// If the current platform is desktop, override the default platform to
/// a supported platform (iOS for macOS, Android for Linux and Windows).
/// Otherwise, do nothing.
void _setTargetPlatformForDesktop() {
  TargetPlatform targetPlatform;
  if (Platform.isMacOS) {
    targetPlatform = TargetPlatform.iOS;
  } else if (Platform.isLinux || Platform.isWindows) {
    targetPlatform = TargetPlatform.android;
  }
  if (targetPlatform != null) {
    debugDefaultTargetPlatformOverride = targetPlatform;
  }
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: CupertinoControllersApp(),
    );
  }
}

class CupertinoControllersApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return CupertinoTabScaffold(
      tabBar: CupertinoTabBar(
        items: [
          BottomNavigationBarItem(
            icon: Icon(Icons.list),
            title: Text("Table"),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.layers),
            title: Text("Mater Detail"),
          ),
        ],
      ),
      tabBuilder: (BuildContext context, int index) {
        final pages = [
          _Page(title: "Table View", child: TableViewScreen()),
          _Page(title: "Master Detail", child: MasterDetailScreen()),
        ];
        return CupertinoTabView(
          builder: (BuildContext context) {
            return pages[index]?.child;
          },
          defaultTitle: pages[index]?.title,
        );
        ;
      },
    );
  }
}

class _Page {
  final Widget child;
  final String title;

  _Page({
    this.title,
    this.child,
  });
}

Use this package as a library

1. Depend on it

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


dependencies:
  cupertino_controllers: ^0.1.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:cupertino_controllers/cupertino_controllers.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
55
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

We analyzed this package on Mar 27, 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

Fix lib/table_view_controller/controller.dart. (-0.50 points)

Analysis of lib/table_view_controller/controller.dart reported 1 hint:

line 5 col 27: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/AppleEducate/plugins/tree/master/packages/cupertino_controllers was unreachable.

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
flutter_slidable ^0.5.3 0.5.4
flutter_sticky_header ^0.4.0 0.4.2
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