nuntio_mercury 0.0.2 copy "nuntio_mercury: ^0.0.2" to clipboard
nuntio_mercury: ^0.0.2 copied to clipboard

A secure chat built on Nuntio Cloud designed to scale massively.

example/lib/main.dart

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:nuntio_hera/hera/hera.dart';
import 'package:nuntio_hera/hera_app/hera_app.dart';
import 'package:nuntio_mercury/mercury-ui/mercury_localizations.dart';
import 'package:nuntio_mercury/mercury-ui/mercury_ui.dart';
import 'package:nuntio_mercury/mercury/mercury.dart';
import 'package:nuntio_core/models/hera.pb.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Hera.initialize(
    apiUrl: 'https://fr-par-1.mercury.nuntio.cloud:443',
    namespace: '',
  );
  await Mercury.initialize(
    apiUrl: 'fr-par-1.mercury.nuntio.cloud',
    namespace: '',
    auth: HeraAuth(),
  );
  runApp(
    HeraApp(
      localizationsDelegates: [DefaultMercuryLocalizations.delegate],
      child: MercuryUI(),
      theme: ThemeData(
        textTheme: TextTheme(
          headline1: TextStyle(
            fontSize: 90,
            fontWeight: FontWeight.w900,
            letterSpacing: 0,
          ),
          headline2: TextStyle(
            fontSize: 67,
            fontWeight: FontWeight.w800,
            letterSpacing: 0,
          ),
          headline3: TextStyle(
            fontSize: 51,
            fontWeight: FontWeight.w700,
            letterSpacing: 0,
          ),
          headline4: TextStyle(
            fontSize: 38,
            fontWeight: FontWeight.w700,
            letterSpacing: 0,
          ),
          headline5: TextStyle(
            fontSize: 28,
            fontWeight: FontWeight.w700,
            letterSpacing: 0,
          ),
          headline6: TextStyle(
            fontSize: 21,
            fontWeight: FontWeight.w700,
            letterSpacing: 0,
          ),
          subtitle1: TextStyle(
            fontSize: 14,
            fontWeight: FontWeight.w600,
            letterSpacing: 0,
          ),
          subtitle2: TextStyle(
            fontSize: 14,
            fontWeight: FontWeight.w400,
            letterSpacing: 0,
          ),
          bodyText1: TextStyle(
            fontSize: 16,
            fontWeight: FontWeight.w700,
            letterSpacing: 0,
          ),
          bodyText2: TextStyle(
            fontSize: 16,
            fontWeight: FontWeight.w400,
            letterSpacing: 0,
          ),
          button: TextStyle(
            fontSize: 16,
            fontWeight: FontWeight.w500,
            color: Color(0xFF127ADA),
            letterSpacing: 0,
          ),
          caption: TextStyle(fontSize: 12, fontWeight: FontWeight.w400),
          overline: TextStyle(
            fontSize: 9,
            fontWeight: FontWeight.w400,
            letterSpacing: 0,
          ),
        ),
      ),
    ),
  );
}

class HeraAuth implements UserAuth {
  @override
  Future<String> getToken() => Hera.getAccessToken();

  @override
  User getCurrentUser() => Hera.currentUser();
}
0
likes
80
pub points
0%
popularity

Publisher

verified publishernuntio.io

A secure chat built on Nuntio Cloud designed to scale massively.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

emojis, flutter, grpc, image_picker, intl, nuntio_core, nuntio_hera, photo_gallery

More

Packages that depend on nuntio_mercury