Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme of the app dark and light mode added #7

Merged
merged 6 commits into from
Dec 31, 2020

Conversation

savagecarol
Copy link

What is the change?

use of the provider

Related issue?

*issue #4

Screenshots:

Screenshot_1609404603
Screenshot_1609404610

@littleironical littleironical changed the base branch from master to develop December 31, 2020 11:09
Copy link
Member

@littleironical littleironical left a comment

Choose a reason for hiding this comment

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

A few changes needed to be done before I approve this PR:

  1. Keep the debugShowCheckedModeBanner to true in main.dart,
  2. Change the variable name from lightDark to isLightTheme in theme.dart for better understanding,
  3. Change the primary color from blue to white, and
  4. You are creating Row inside title and then adding Switch
Row(
  mainAxisAlignment: MainAxisAlignment.spaceBetween,
  children: [
    Text('Dashboard'),
     Switch(
       value: _themeChanger.lightDark,
       onChanged: (lightDark) {
         if (lightDark)
           _themeChanger.setTheme(ThemeData.light());
         else
           _themeChanger.setTheme(ThemeData.dark());
       }
     )
  ],
),

You can add Switch inside actions property instead, like this:

actions: [
  Switch(
    value: _themeChanger.lightDark,
      onChanged: (lightDark) {
        if (lightDark)
          _themeChanger.setTheme(ThemeData.light());
        else
          _themeChanger.setTheme(ThemeData.dark());
      }
    ),
    SizedBox(width: 8.0),
    GestureDetector(
      onTap: () {
        Navigator.push(context, SlideLeftRoute(page: Lessons()));
      },
      child: CircleAvatar(
        backgroundColor: Colors.white70,
        backgroundImage: NetworkImage(
          'https://i.pinimg.com/originals/da/51/c2/da51c26fe3398b0f8314fee17a98e0e7.jpg',
        ),
      ),
    ),
    SizedBox(width: 10.0),
  ],
),

@savagecarol
Copy link
Author

Screenshot_1609420535
all the thing fixed

@littleironical littleironical linked an issue Dec 31, 2020 that may be closed by this pull request
Copy link
Member

@littleironical littleironical left a comment

Choose a reason for hiding this comment

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

Now it's looking great

@littleironical littleironical merged commit e6620c1 into inaxia:develop Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI update
2 participants