Skip to content

Instantly share code, notes, and snippets.

@just1984
Created December 1, 2022 10:16
Show Gist options
  • Save just1984/900c7861a28ff36a885644e9e38f51e7 to your computer and use it in GitHub Desktop.
Save just1984/900c7861a28ff36a885644e9e38f51e7 to your computer and use it in GitHub Desktop.
adi_share
import 'package:flutter/material.dart';
void main() {
runApp(const BorisFirstAppClass());
}
class BorisFirstAppClass extends StatelessWidget {
const BorisFirstAppClass({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'MyAppCompassCourse',
theme: ThemeData(
primarySwatch: Colors.blueGrey,
),
home: const HomeBodyClass());
}
}
class HomeBodyClass extends StatelessWidget {
const HomeBodyClass({super.key});
@override
Widget build(BuildContext context) {
final ButtonStyle style = TextButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.onPrimary,
);
return Scaffold(
backgroundColor: Colors.white70,
appBar: AppBar(
leading: const Icon(Icons.favorite),
title: const Text('The Title'),
actions: <Widget>[
TextButton(
style: style,
onPressed: () {},
child: const Text('RED'),
),
TextButton(
style: style,
onPressed: () {},
child: const Text('GREEN'),
),
TextButton(
style: style,
onPressed: () {},
child: const Text('BLUE'),
),
],
),
body: const Center(
child: Text(
'This is me, coding my first app.',
style: TextStyle(height: 5, fontSize: 15),
),
),
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
backgroundColor: Colors.black,
selectedItemColor: Colors.blueAccent,
unselectedItemColor: Colors.grey,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.phone),
label: 'View 1',
),
BottomNavigationBarItem(
icon: Icon(Icons.message_rounded),
label: 'View 2',
),
BottomNavigationBarItem(
icon: Icon(Icons.settings),
label: 'View 3',
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment