bizdoc 0.0.3 copy "bizdoc: ^0.0.3" to clipboard
bizdoc: ^0.0.3 copied to clipboard

outdated

Workflow forms for corporate.

Flutter for BizDoc is a framework for creating form-driven mobile apps.

Features #

  • Authentication
  • Attachments

Getting started #

flutter pub add provider
copied to clipboard

Usage #

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BizDocApp(
      serverUrl: 'https://bizdoc-server-here',
      authentication: Credentials());
  }
}
copied to clipboard

Set authentication #

Provider Usage
Okta
Credentials

Declare components #

class MyComponent extends StatefulWidget {
  @override
  _MyComponentState createState() => _MyComponentState();
}
copied to clipboard

Register components #

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BizDocApp(
        resolve: {'my-component': (context) => MyComponent()},
  }
}
copied to clipboard

Forms #

Declare data model #

class MyModel {
  final Map<String, dynamic> _json;
  MyModel(this._json);

  String? get subject => _json['subject'];
  set subject(String? val) => _json['subject'] = val;
  num? get price => _json['price'];
  set price(num? val) => _json['price'] = val;
}
copied to clipboard

Manage state #

class _MyComponentState extends State<MyComponent> {
  late BizDocFormState _state;
  late _model MyModel;
  @override initState() {
    _state = Provider.of<BizDocFormState>(context, listen: false);
    _model = MyModel(_state.data);
    super.initState();
  }
}
copied to clipboard
    TextFormField(
      keyboardType: TextInputType.text,
      controller: new TextEditingController(text: _model.subject),
      onChanged: (value) {
        _model.subject = value;
        _state.setDirty();
      },
      validator: (value) {
        if (value != null && value != '') _state.setInvalid();
        else if (_model.isValid) _state.setValid();
      },
    ),
copied to clipboard

Integrate APIs #

Name Usage
Session
DataSource
Users
Geo Geo location services. Set GoogleMaps property in BizDocApp.
Cube Analysis
extension MyModel on DataSource {
   Future<Map<String, dynamic>> companies(){
      return map('countries');
   }
   Future<Iterable<VendorInfo>> vendors(String? name){
      final response = dio.get('/vendors/', queryParameters: {'name': name });
      return response.data.map((e)=> VendorInfo(e));
   }
}

class VendorInfo {
  final Map<String, dynamic> _json;
  VendorInfo(this._json);
  String? get name => _json['name'];
}
copied to clipboard

dio

Dashboard widgets #

copied to clipboard

Additional information #

Server development guide, and wiki.

Contact Moding team.