Skip to content

Commit

Permalink
components/buttons: implement all buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
arnemolland committed Dec 20, 2022
1 parent 2fbdb75 commit 4ca3bce
Show file tree
Hide file tree
Showing 10 changed files with 2,156 additions and 3 deletions.
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

0 comments on commit 4ca3bce

Please sign in to comment.