Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

Conversation

JohnSteck9
Copy link
Collaborator

@JohnSteck9 JohnSteck9 commented Nov 9, 2021

Added Maxim's local state:
This state allows us to add and remove our custom playlists on the library screen by tap on + New playlist

image

image

Added Mykhailo's local state:
This state allows us to increase the number of views by tap on them

image

image

Added Maxim's global state:
This global state allows us to change the theme of the application on the light and on the dark by tap on the icon in the app bar

image

image

Added Mykhailo's global state:
This global state allows us to change the user icon to a random icon from the git hub by tap on the user icon in the user screen

image

image

Copy link

@igor-leshkevych igor-leshkevych left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnSteck9 @maksymbudzin well done, everything works and all the requirements are met.
10/10 for both of you.

const BottomNavigationBarThemeData(selectedItemColor: Colors.white),
);

ThemeData secondTheme = ThemeData(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to use secondary

ThemeData get currentTheme => _currentTheme;

void toggleTheme() {
_currentTheme = _currentTheme == mainTheme ? secondTheme : mainTheme;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use something like this instead:

final themes = [primaryTheme, secondaryTheme];
int currentTheme = 0;

Theme get currentTheme => themes[currentTheme];

void toggle() {
  currentTheme = (currentTheme + 1) % themes.length;
}

this will allow you to cycle through themes, and adding new themes to themes array without changing a code inside your toggle


void generateRandomImage() {
var random = new Random();
int min = 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many variables, just use

var randomIndex = 1 + Random().nextInt(63707306);

}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
// var incrementValue = context.watch<Increment>().count;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont leave commented blocks of code

}

class LibraryState extends State<LibraryTab> {
late String temp;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just use
String newPlaylist = '';

void initState() {
super.initState();

playList.addAll(['maks_playlist', 'vika_playlist', 'mykhailo_playlist']);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just use

List playList = ['maks_playlist', 'vika_playlist', 'mykhailo_playlist'];

when declaring the field

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants