Skip to content

Commit

Permalink
Add theme for elevated button
Browse files Browse the repository at this point in the history
  • Loading branch information
sinasystem committed Jun 6, 2022
1 parent 92adc28 commit d08d071
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
20 changes: 16 additions & 4 deletions lib/core/app_theme.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
import 'package:flutter/material.dart';

class AppTheme{
import 'app_color.dart';

class AppTheme {
const AppTheme();

static ThemeData lightTheme = ThemeData(
appBarTheme: const AppBarTheme(
backgroundColor: Colors.transparent,
elevation: 0,
centerTitle: true,
)
);
}
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
primary: AppColor.lightBlack,
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 15),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
),
);
}
11 changes: 3 additions & 8 deletions lib/src/view/widget/bottom_bar.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import '../../../core/app_color.dart';
import '../../../core/app_style.dart';

class BottomBar extends StatelessWidget {
Expand Down Expand Up @@ -33,16 +32,12 @@ class BottomBar extends StatelessWidget {
color: Colors.black45, fontWeight: FontWeight.bold)),
),
const SizedBox(height: 5),
FittedBox(child: Text(priceValue, style: h2Style))
FittedBox(
child: Text(priceValue, style: h2Style),
)
],
),
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: AppColor.lightBlack,
padding:
const EdgeInsets.symmetric(horizontal: 40, vertical: 15),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10))),
onPressed: onTap,
child: Text(buttonLabel),
)
Expand Down

0 comments on commit d08d071

Please sign in to comment.