Skip to content

Instantly share code, notes, and snippets.

@Lxxyx
Created February 14, 2025 11:20
Show Gist options
  • Save Lxxyx/472e223668cede5f902e89e0016a96b3 to your computer and use it in GitHub Desktop.
Save Lxxyx/472e223668cede5f902e89e0016a96b3 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Web3 Dictionary',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorSchemeSeed: Colors.blue,
),
home: const MyHomePage(title: 'Web3 Dictionary'),
);
}
}
class MyHomePage extends StatefulWidget {
final String title;
const MyHomePage({
super.key,
required this.title,
});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final List<Map<String, dynamic>> _web3Terms = [
{
'term': 'Blockchain',
'definition': 'A decentralized, distributed ledger that records transactions across a network of computers.',
},
{
'term': 'Cryptocurrency',
'definition': 'A digital or virtual currency that uses cryptography for security and is decentralized.',
},
{
'term': 'Smart Contract',
'definition': 'A self-executing program that automates the enforcement and execution of a specific agreement or contract.',
},
// Add more web3 terms here
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: ListView.builder(
itemCount: _web3Terms.length,
itemBuilder: (context, index) {
return Card(
child: ListTile(
title: Text(_web3Terms[index]['term']),
subtitle: Text(_web3Terms[index]['definition']),
),
);
},
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment