funky_base 0.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 43

funky_base #

base for develop

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

0.0.1 #

  • TODO: Describe initial release.

0.0.2 #

  • remove happypass

0.0.3 #

  • allow expand PageInterface
  • build -> doBuild

0.0.4 #

  • Upgrade BroadcastManager 1.0.0 => 1.0.1

example/lib/main.dart

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

void main() {
  runApp(MaterialApp(
    routes: {
      '/1234': (context) => Page2()
    },
    home: Page(),
  ));
}

class Page extends BasePage {
  Page() : super("/123");
  
  
  BasePageState createState() => PageState();
}

class PageState extends BasePageState<Page> {
  
  @override
  void onInit() {
  
  }
  
  @override
  Widget onBuildUI(BuildContext context) {
    return Scaffold(
      body: GestureDetector(
        onTap: () {
//          PageManager.getInstance().pushTo((context) => Page2());
//          pageInterface.pushPage(Page2());
  

        },
        child: Container(
          color: Colors.red,
          child: Column(
            mainAxisSize: MainAxisSize.max,
            children: <Widget>[
              RaisedButton(
                  onPressed: () {
//                    FunkyBase.test(1).then((version) {
//                      print('1 $version');
//                    });
                  }),
              RaisedButton(
                  onPressed: () {
//                    FunkyBase.test(1).then((version) {
//                      print('2 $version');
//                    });
                  }),
              RaisedButton(
                  onPressed: () {
//                    FunkyBase.test(1).then((version) {
//                      print('3 $version');
//                    });
                  }),
              RaisedButton(
                  onPressed: () {
//                    FunkyBase.test(2).then((version) {
//                      print('4 $version');
//                    });
                  }),
              RaisedButton(
                  onPressed: () {
//                    FunkyBase.test(2).then((version) {
//                      print('5 $version');
//                    });
                  }),
            ],
          ),
        ),
      ),
    );
  }
  
  @override
  void onDestroy() {
  
  }
}


class Page2 extends BasePage {
  Page2() : super("/1234");
  
  
  BasePageState createState() => PageState2();
}

class PageState2 extends BasePageState<Page2> {
  
  @override
  void onInit() {
    
  }
  
  @override
  Widget onBuildUI(BuildContext context) {
    return Scaffold(
      body: GestureDetector(
        onTap: () {
          pageInterface.pushPage(Page3());
        },
        child: Container(
          color: Colors.green,
        ),
      ),
    );
  }
  
  @override
  void onDestroy() {
    
  }
}

class Page3 extends BasePage {
  Page3() : super("/12345");
  
  
  BasePageState createState() => PageState3();
}

class PageState3 extends BasePageState<Page3> {
  
  @override
  void onInit() {
    
  }
  
  @override
  Widget onBuildUI(BuildContext context) {
    return Scaffold(
      body: TextTest()
    );
  }
  
  @override
  void onDestroy() {
    
  }
}

class TextTest extends StatefulWidget {
  @override
  _TextTestState createState() => _TextTestState();
}

class _TextTestState extends State<TextTest> with PageInterfaceChildMixin {
  
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        pageInterface.popupUntil('/1234');
      },
      child: Container(
        color: Colors.black,
      ),
    );
  }
}


//void main() => runApp(MyApp());
//
//class MyApp extends StatefulWidget {
//  @override
//  _MyAppState createState() => _MyAppState();
//}
//
//class _MyAppState extends State<MyApp> {
//  String _platformVersion = 'Unknown';
//
//  @override
//  void initState() {
//    super.initState();
//    initPlatformState();
//  }
//
//  // Platform messages are asynchronous, so we initialize in an async method.
//  Future<void> initPlatformState() async {
//    String platformVersion;
//    // Platform messages may fail, so we use a try/catch PlatformException.
//    try {
//      platformVersion = await FunkyBase.platformVersion;
//    } on PlatformException {
//      platformVersion = 'Failed to get platform version.';
//    }
//
//    // If the widget was removed from the tree while the asynchronous platform
//    // message was in flight, we want to discard the reply rather than calling
//    // setState to update our non-existent appearance.
//    if (!mounted) return;
//
//    setState(() {
//      _platformVersion = platformVersion;
//    });
//  }
//
//  @override
//  Widget build(BuildContext context) {
//    return MaterialApp(
//      home: Scaffold(
//        appBar: AppBar(
//          title: const Text('Plugin example app'),
//        ),
//        body: Center(
//          child: Text('Running on: $_platformVersion\n'),
//        ),
//      ),
//    );
//  }
//}

Use this package as a library

1. Depend on it

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


dependencies:
  funky_base: ^0.0.4

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

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

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Health suggestions

Fix lib/src/base/page.dart. (-1 points)

Analysis of lib/src/base/page.dart reported 2 hints:

line 1 col 8: Unused import: 'dart:io'.

line 105 col 39: 'inheritFromWidgetOfExactType' is deprecated and shouldn't be used. Use dependOnInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1..

Fix lib/funky_base.dart. (-0.50 points)

Analysis of lib/funky_base.dart reported 1 hint:

line 1 col 8: Unused import: 'dart:async'.

Fix lib/src/core/page_manager.dart. (-0.50 points)

Analysis of lib/src/core/page_manager.dart reported 1 hint:

line 3 col 8: Unused import: 'package:tea/tea.dart'.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/base/exceptions.dart (Run flutter format to format lib/src/base/exceptions.dart.)
  • lib/src/base/state_mixin.dart (Run flutter format to format lib/src/base/state_mixin.dart.)
  • lib/src/core/global_data_source.dart (Run flutter format to format lib/src/core/global_data_source.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
broadcast_manager ^1.0.1 1.0.1
flutter 0.0.0
taskpipeline ^0.0.3 0.0.3
tea ^1.0.2 1.0.2
Transitive dependencies
collection 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