Skip to content

Instantly share code, notes, and snippets.

@Lxxyx
Created February 14, 2025 11:27
Show Gist options
  • Save Lxxyx/fe7710c751abb98a9165e3caf22d665c to your computer and use it in GitHub Desktop.
Save Lxxyx/fe7710c751abb98a9165e3caf22d665c 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 technology.'},
{'term': 'Smart Contract', 'definition': 'Self-executing contracts with the terms of the agreement written directly into lines of code.'},
{'term': 'Decentralized Application (dApp)', 'definition': 'An application that operates on a blockchain, Outside of centralized control.'},
{'term': 'Cryptocurrency', 'definition': 'A digital or virtual currency that uses cryptography for security and is decentralized.'},
{'term': 'Ethereum', 'definition': 'An open-source, blockchain-based, decentralized software platform.'},
];
@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