Create form-driven mobile apps on top of BizDoc workflow engine.

Features

  • Authentication: Okta, AzureActiveDirectory or DirectortServices.
  • Online messages and notifications.
  • Analysis charts.
  • Dashboard widgets.
  • Capture and attach file from camera.
  • Location sensitive forms.
  • Geo location services.

Getting started

flutter pub add bizdoc

If you are going to access self owned server APIs, install dio.

flutter pub add dio

BizDoc mobile app relays on Firebase messaging. To fully take advantage of BizDocApp you'll need to create a Firebase project and provide it's settings to BizDoc.

Usage

Add BizDocApp to main.dart.

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BizDocApp(
      serverAddress: 'https://bizdoc-server-here',
      authentication: FormIdentity());
  }
}

BizDocApp can be provided with certificate, Firebase settings for communication and title.

Set authentication

Set method according to server configuration.

Provider Usage
Okta Okta.
FormIdentity Username password authentication.
DirectoryServices
AzureActiveDirectory

Declare components

BizDoc components are widgets which can access app state and services. Flutter support two types of BizDoc components: form and widget.

First, declare a stateful widget.

class MyComponent extends StatefulWidget {
  @override
  _MyComponentState createState() => _MyComponentState();
}
class _MyComponentState extends State<MyComponent> {

}

Register components

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

Forms

A form is a component type which offers a user to fill a series of inputs.

Declare 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;
}

Here we use a getter and setter for each property. You can deserialize json using fromJson() pattern.

Manage state

Access form state using BizDocFormState.

class _MyComponentState extends State<MyComponent> {
  late BizDocFormState _state;
  late MyModel _model;
  @override initState() {
    _state = Provider.of<BizDocFormState>(context, listen: false);
    _model = MyModel(_state.data);
    super.initState();
  }
}

Update state on input change.

    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();
      },
    ),

Control widgets

Embed BizDoc control in your components to gain simplification of API use.

Name Usage
CombinationPicker Combination input.
CombinationPool Combination input.
SelectTypeField Picker for datatype.
AutocompleteTypeField Autocomplete picker for datatype.
AddressField Autocomplete address input.
DateFormField Date picker
DateRangeField Date range picker
Set GoogleMapsSettings property in BizDocApp.

Integrate APIs

Use extension or singleton to access BizDoc services.

Services available:

Name Usage
DataSource Retrieve BizDoc datatype values.
Geo Geo location services. Set GoogleMapsSettings property in BizDocApp.
Session Current session state.
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'];
}

Use dio property to send an HTTP request to server /api.

Utilize in widgets.

  let vendors = await dataSource.vendors();

Dashboard widgets

Use BizDocWidgetState to get remote data.

class CubeAnalysisWidget extends StatefulWidget implements IDashboardWidget {
  const CubeAnalysisWidget({Key? key}) : super(key: key);

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

class _CubeAnalysisWidgetState extends State<CubeAnalysisWidget> {
  @override
  Widget build(BuildContext context) {
    return Consumer<BizDocWidgetState>(builder: (context, value, child) {
      if (value.hasData)
      for (var item in value.data!) {
        ...
      }
    }
  }
}

Register component in BizDocApp resolve.

Settings

To fully take advantage of BizDoc app, add messaging and APIs settings.

Push messages

Firebase project FirebaseSettings of BizDocApp main.dart.

Geo location services

Google maps API in GoogleMapsSettings of BizDocApp in main.dart.

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) => BizDocApp(
        firebaseSettings: FirebaseSettings(
            apiKey: '...',
            projectId: '...',
            senderId: '...',
            vapidKey: '...',
            appId: '...'),
        googleMapsSettings: GoogleMapsSettings(apiKey: '...'),
      );
}

Additional information

Getting started development guide, and wiki.

Contact Moding team on support@moding.com.

Libraries

authenticate/aad
services/accounts
controls/address
generics/controls/address
generics/widgets/analysis
l10n/app_localizations
l10n/app_localizations_en
screens/attachments
screens/authorize
controls/autocomplete
authenticate/base
core/extensions
controls/select
core/form_state
core/configuration
bizdoc_app
bizdoc
core/app_state
controls/combination_picker
controls/combination_pool
generics/forms/box
generics/forms/box.metadata
generics/forms/box.model
screens/browse
services/chat
models/chat
generics/controls/checkbox
generics/controls/checklist
generics/controls/chips
controls/chips_field
screens/comments
screens/compose
screens/contacts
models/contracts
core/control_state
screens/conversation
services/cube
models/cube
screens/cube
screens/dashboard
core/dashboard_state
models/data
services/datasource
controls/date
generics/controls/date
generics/controls/date_range
controls/date_range
authenticate/directory_services
screens/drawer
screens/explore
screens/fields
generics/controls/file
authenticate/form_identity
services/geo
screens/home
core/hub
core/icon
controls/input_chips
generics/controls/localized_string
screens/location_map
models/log
services/mailbox
services/network
core/notification
screens/notifications
models/notifications
generics/controls/number
authenticate/okta
generics/controls/options
models/profile
generics/controls/radio
generics/controls/select
screens/server_url
services/session
screens/settings
generics/controls/signature
screens/splash
generics/forms/survey
generics/controls/switch
generics/controls/text
generics/controls/textarea
generics/controls/time
controls/time_form_field
generics/controls/yes_no