mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-11-03 23:03:29 +01:00 
			
		
		
		
	Added strechy appbars to all pages
This commit is contained in:
		
							
								
								
									
										29
									
								
								lib/components/custom_app_bar.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								lib/components/custom_app_bar.dart
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
class CustomAppBar extends StatefulWidget {
 | 
			
		||||
  const CustomAppBar({super.key, required this.title});
 | 
			
		||||
 | 
			
		||||
  final String title;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  State<CustomAppBar> createState() => _CustomAppBarState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _CustomAppBarState extends State<CustomAppBar> {
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return SliverAppBar(
 | 
			
		||||
      pinned: true,
 | 
			
		||||
      automaticallyImplyLeading: false,
 | 
			
		||||
      expandedHeight: 100,
 | 
			
		||||
      flexibleSpace: FlexibleSpaceBar(
 | 
			
		||||
        titlePadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
 | 
			
		||||
        title: Text(
 | 
			
		||||
          widget.title,
 | 
			
		||||
          style:
 | 
			
		||||
              TextStyle(color: Theme.of(context).textTheme.bodyMedium!.color),
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user