-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from CosmicRaptor/main
Added a new common appbar for all screens opened via the drawer.
- Loading branch information
Showing
6 changed files
with
81 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
lib/new_ui/screens/main_screen/widgets/common_basic_appbar.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:tsec_app/provider/appbar_title_provider.dart'; | ||
|
||
class CommonAppbar extends ConsumerWidget implements PreferredSizeWidget{ | ||
const CommonAppbar({super.key}); | ||
|
||
@override | ||
Size get preferredSize => Size.fromHeight(kToolbarHeight); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
final title = ref.read(titleProvider); | ||
return AppBar( | ||
shadowColor: Colors.transparent, | ||
backgroundColor: Colors.transparent, | ||
toolbarHeight: 80, | ||
title: Text(title, | ||
style: Theme.of(context) | ||
.textTheme | ||
.headlineLarge! | ||
.copyWith(fontSize: 15, color: Colors.white), | ||
maxLines: 1, | ||
overflow: TextOverflow.fade,), | ||
centerTitle: true, | ||
iconTheme: IconThemeData(color: Colors.white), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
||
final titleProvider = StateProvider<String>((ref) => 'Default'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters