appback_sdk 0.0.1+1 copy "appback_sdk: ^0.0.1+1" to clipboard
appback_sdk: ^0.0.1+1 copied to clipboard

Library to implement AppBack services in Flutter applications.

example/lib/main.dart

import 'package:appback_sdk/app_back.dart';
import 'package:flutter/material.dart';
import 'package:hello_example/event_logs_view.dart';

import 'toggles_view.dart';
import 'translations_view.dart';

void main() async {
    AppBack.instance.configure("YOUR_API_KEY");
    runApp(AppBackExample());
}

class AppBackExample extends StatefulWidget {
    @override
    _AppBackExampleState createState() => _AppBackExampleState();
}

class _AppBackExampleState extends State<AppBackExample> {
    
    int _currentIndex = 0;
    
    @override
    Widget build(BuildContext context) {
        return MaterialApp(
            home: Scaffold(
                body: _getCurrentScreen(),
                bottomNavigationBar: BottomNavigationBar(
                    items: <BottomNavigationBarItem>[
                        BottomNavigationBarItem(
                            icon: Icon(Icons.translate),
                            title: Text('Translations'),
                        ),
                        BottomNavigationBarItem(
                            icon: Icon(Icons.power_settings_new),
                            title: Text('Toggles'),
                        ),
                        BottomNavigationBarItem(
                            icon: Icon(Icons.event_note),
                            title: Text('Event Log'),
                        ),
                    ],
                    currentIndex: _currentIndex,
                    onTap: (newIndex) => setState(() => _currentIndex = newIndex),
                ),
            ),
        );
    }
    
    Widget _getCurrentScreen() {
        switch(_currentIndex) {
            case 0:
                return TranslationsView();
            case 1:
                return TogglesView();
            case 2:
                return EventLogsView();
            default:
                return TranslationsView();
        }
    }
}
1
likes
40
pub points
0%
popularity

Publisher

verified publisherappback.io

Library to implement AppBack services in Flutter applications.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, http, json_annotation

More

Packages that depend on appback_sdk