agent_dart 1.0.0-dev.29 agent_dart: ^1.0.0-dev.29 copied to clipboard
An agent library built for Internet Computer, a plugin package for dart and flutter apps. Developers can build ones to interact with Dfinity's blockchain directly.
import 'package:agent_dart/agent_dart.dart' as agent_dart;
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String phrase = agent_dart.generateMnemonic();
void _refreshMnemonic() {
phrase = agent_dart.generateMnemonic();
}
@override
Widget build(BuildContext context) {
const textStyle = TextStyle(fontSize: 25);
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Native Packages'),
),
body: SingleChildScrollView(
child: Container(
padding: const EdgeInsets.all(10),
child: Column(
children: [
Text(
'Phrase: $phrase',
style: textStyle,
textAlign: TextAlign.center,
),
],
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
_refreshMnemonic();
},
child: const Icon(Icons.refresh),
),
),
);
}
}