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

A new flutter plugin project.

example/lib/main.dart

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

import 'package:ccms_des/ccms_des.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _string = "testMessage";
  final _key = "12345678";

  var _encrytString;
  var _decrytString;

  @override
  void initState() {
    super.initState();
    example();
  }

  Future<void> example() async {
    _encrytString = await CcmsDes.encryptToHex(_string, _key);
    _decrytString = await CcmsDes.decryptFromHex(_encrytString, _key);

    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('des example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Padding(padding: EdgeInsets.all(10)),
              Text('_string : $_string'),
              Text('_key : $_key'),
              Padding(padding: EdgeInsets.all(10)),
              Text('encrytString : $_encrytString'),
              Text('decrytString : $_decrytString'),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
110
pub points
0%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on ccms_des