Skip to content

Instantly share code, notes, and snippets.

@WenhaoWu
Created May 20, 2022 07:53
Show Gist options
  • Save WenhaoWu/268fc95342c1f92c36e6a2c96692022d to your computer and use it in GitHub Desktop.
Save WenhaoWu/268fc95342c1f92c36e6a2c96692022d to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBlue,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: const Text('BottomNavigationBar Sample'),
),
body: Placeholder(),
bottomNavigationBar: BottomNavigationBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: '',
activeIcon: activeIcon,
),
BottomNavigationBarItem(
icon: Icon(Icons.business),
label: '',
),
BottomNavigationBarItem(
icon: Icon(Icons.school),
label: '',
),
],
currentIndex: 0,
showSelectedLabels: false,
showUnselectedLabels: false,
selectedFontSize: 0,
selectedItemColor: Colors.amber[800],
type: BottomNavigationBarType.fixed,
onTap: (index) {},
),
),
);
}
Widget get activeIcon {
return Container(
decoration: BoxDecoration(
color: Colors.red,
border: Border(
top: BorderSide(
width: 1,
color: Colors.lightBlue.shade600,
),
),
),
child: const Icon(Icons.home),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Icon(Icons.check_box, textDirection: TextDirection.rtl);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment