iOS Development

ios – Issues with theming scaffold in flutter

I encountered 2 fundamental issues when theming the scaffold of my app:

Look first on the app bar and you may see it is a colour totally different from the scaffold (one thing like my main colour with opacity) though I designed it to be just like the scaffold. The second downside is that on the backside of the scaffold there’s a part not styled (perhaps as a result of I am utilizing a SafeArea idk).

Right here is the Theme information I am utilizing:

last theme = ThemeData(

  useMaterial3: true,
  colorScheme: const ColorScheme(
    brightness: Brightness.mild,
    main: Colour.fromRGBO(248, 95, 106, 1),
    onPrimary: Colours.white,
    secondary: Colour.fromRGBO(167, 183, 216, 1),
    onSecondary: Colours.white,
    error: Colours.pink,
    onError: Colours.white,
    background: Colour.fromARGB(240, 252, 251, 244),
    onBackground: Colours.black,
    floor: Colours.black45,
    onSurface: Colours.black,
  ),
);

And right here is the code of the display:

import 'package deal:flutter/materials.dart';
import 'package deal:jimprova/fashions/workout_model.dart';
import 'package deal:jimprova/widgets/coaching/exercise_training_card.dart';

class TrainingScreen extends StatefulWidget {
  const TrainingScreen({
    tremendous.key,
    required this.exercise,
  });

  last Exercise exercise;

  @override
  State<TrainingScreen> createState() => _TrainingScreenState();
}

class _TrainingScreenState extends State<TrainingScreen> {
  int indexEx = 0;

  @override
  Widget construct(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.background,
        title: Textual content(
          widget.exercise.title,
          type: Theme.of(context).textTheme.titleLarge!.copyWith(
                colour: Theme.of(context).colorScheme.onBackground,
                fontWeight: FontWeight.daring,
              ),
        ),
      ),
      physique: SafeArea(
        youngster: Stack(
          youngsters: [
            SingleChildScrollView(
                    // rest of the code... (there are only rows, columns and a listview.builder)
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Credit: www.ismmailgsm.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button