Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

components/buttons: implement all buttons #14

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:flume_example/pages/ambiance.dart';
import 'package:flume_example/pages/components.dart';
import 'package:flume_example/pages/components/buttons.dart';
import 'package:flume_example/pages/foundation.dart';
import 'package:flume_example/pages/foundation/breakpoints.dart';
import 'package:flume_example/pages/foundation/colors.dart';
Expand Down Expand Up @@ -38,6 +40,8 @@ class FlumeExample extends StatelessWidget {
'/foundation/shadows': (context) => const ShadowsPage(),
'/foundation/shapes': (context) => const ShapesPage(),
'/foundation/typography': (context) => const TypographyPage(),
'/components': (context) => const ComponentsPage(),
'/components/buttons': (context) => const ButtonsPage(),
},
home: Ambiance(
builder: (context, ambiance) {
Expand Down Expand Up @@ -66,7 +70,7 @@ class FlumeExample extends StatelessWidget {
),
Cell(
title: const Text('Components'),
onTap: () => Navigator.pushNamed(context, '/ambiance'),
onTap: () => Navigator.pushNamed(context, '/components'),
),
]
.map(
Expand Down
41 changes: 41 additions & 0 deletions example/lib/pages/components.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import 'package:flume/flume.dart';
import 'package:flutter/material.dart';

class ComponentsPage extends StatelessWidget {
const ComponentsPage({super.key});

@override
Widget build(BuildContext context) {
final theme = Flume.of(context);

return Ambiance(
builder: (context, ambiance) {
return Scaffold(
backgroundColor: ambiance.color,
appBar: TopBar(
title: const Text('Components'),
),
body: ListView(
children: [
Cell(
title: const Text('Buttons'),
onTap: () =>
Navigator.pushNamed(context, '/components/buttons'),
),
]
.map(
(e) => Padding(
padding: EdgeInsets.symmetric(
horizontal: theme.spacing.xs,
vertical: theme.spacing.xxs,
),
child: e,
),
)
.toList(),
),
);
},
);
}
}
Loading