fc_components 0.5.8 fc_components: ^0.5.8 copied to clipboard
My common custom component collection.
import 'package:example/cell.dart';
import 'package:example/sort_button.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'FC Components Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'FC Components Example'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: ListView(
children: [
Card(
child: ListTile(
title: const Text('FcCell'),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return const Cell();
}));
},
),
),
Card(
child: ListTile(
title: const Text('FcButton(未完工)'),
onTap: () {
// Navigator.push(context, MaterialPageRoute(builder: (context) {
// return const Button();
// }));
},
),
),
Card(
child: ListTile(
title: const Text('FcEmpty(未完工)'),
onTap: () {
// Navigator.push(context, MaterialPageRoute(builder: (context) {
// return const Cell();
// }));
},
),
),
Card(
child: ListTile(
title: const Text('FcSortButton'),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return const SortButton();
}));
},
),
),
Card(
child: ListTile(
title: const Text('FcNavigationBar'),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return NavigationBar(destinations: const [],);
}));
},
),
),
],
),
);
}
}