Code Monkey home page Code Monkey logo

baydim / base_ui_m3 Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 21.24 MB

This is a Flutter application in UI development that refers to the base ThemeData of Flutter Material itself, from the use of textStyle to the selection of colors taken from the default ThemeData.

Home Page: https://base-ui-m3-web.vercel.app/

Kotlin 0.05% Swift 0.79% Objective-C 0.02% Dart 78.52% CMake 8.25% C++ 9.79% C 0.61% HTML 0.78% Ruby 1.19%
flutter flutter-apps flutter-examples flutter-ui flutter-web getx getx-cli getx-state-management getxpattern hotel

base_ui_m3's Introduction

THUMBNAIL

BASE MATERIAL 3 FLUTTER

This is a Flutter application in UI development that refers to the base ThemeData of Flutter Material itself, from the use of textStyle to the selection of colors taken from the default ThemeData.

core code

/// this file on 
/// lib/app/theme/app_theme.dart
import 'package:flutter/material.dart';

/// function to get textStyle
TextTheme appFont(BuildContext context) {
  var data = Theme.of(context).textTheme;
  return data;
}

/// function to get Color
ColorApp appColor(BuildContext context) {
  var scheme = Theme.of(context).colorScheme;
  var theme = Theme.of(context);
  return ColorApp(
    useScheme: scheme,
    useThemeData: theme,
  );
}

/// class return to collecting option color from base theme
class ColorApp {
  ColorApp({
    required this.useScheme,
    required this.useThemeData,
  });

  ColorScheme useScheme;
  ThemeData useThemeData;
}


/// default theme data
ThemeData appTheme(BuildContext context) {
  return ThemeData(
    appBarTheme: AppBarTheme(
      titleTextStyle: appFont(context).titleMedium?.copyWith(
            fontWeight: FontWeight.bold,
            color: Theme.of(context).brightness == Brightness.dark
                ? Colors.white
                : Colors.black,
          ),
    ),
    navigationBarTheme: NavigationBarThemeData(
      labelTextStyle: MaterialStatePropertyAll(
        appFont(context).labelSmall?.copyWith(
              color: Theme.of(context).brightness == Brightness.dark
                  ? Colors.white
                  : Colors.black,
            ),
      ),
    ),
    fontFamily: "google",
    colorScheme: ColorScheme.fromSeed(

    /// core goal of this project in here
      seedColor: Colors.blue,
      brightness: Brightness.light,
    ///
    ),
    useMaterial3: true,
  );
}

implement code

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations(
    [
      DeviceOrientation.portraitUp,
      DeviceOrientation.portraitDown,
    ],
  );
  await SharedPreferences.getInstance();
  runApp(
    const App(),
  );
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    WrapperMenuController wrapperMenuController =
        Get.put(WrapperMenuController());

    return !kIsWeb
        ? Obx(
            () {
              return GestureDetector(
                onTap: () {
                  Get.focusScope?.unfocus();
                },
                child: GetMaterialApp(
                  debugShowCheckedModeBanner: false,
                  localizationsDelegates: const [
                    GlobalMaterialLocalizations.delegate,
                    GlobalWidgetsLocalizations.delegate,
                    GlobalCupertinoLocalizations.delegate,
                  ],
                  supportedLocales: const [
                    Locale('id', 'ID'),
                  ],
                  title: "BASE_UI_M3",
                  initialRoute: AppPages.INITIAL,
                  getPages: AppPages.routes,
                  theme: appTheme(context,
                      useDark: wrapperMenuController.isDark.value),
                  darkTheme: appTheme(context,
                      useDark: wrapperMenuController.isDark.value),
                ),
              );
            },
          )
        : Obx(() {
            return Theme(
              data: appTheme(
                context,
                useDark: wrapperMenuController.isDark.value,
              ),
              child: FlutterWebFrame(
                builder: (_) {
                  return GetMaterialApp(
                    debugShowCheckedModeBanner: false,
                    localizationsDelegates: const [
                      GlobalMaterialLocalizations.delegate,
                      GlobalWidgetsLocalizations.delegate,
                      GlobalCupertinoLocalizations.delegate,
                    ],
                    supportedLocales: const [
                      Locale('id', 'ID'),
                    ],
                    title: "BASE_UI_M3",
                    initialRoute: AppPages.INITIAL,
                    getPages: AppPages.routes,
                    theme: appTheme(context,
                        useDark: wrapperMenuController.isDark.value),
                    darkTheme: appTheme(context,
                        useDark: wrapperMenuController.isDark.value),
                  );
                },
                maximumSize: wrapperMenuController.size.value,
                enabled: kIsWeb,
                backgroundColor: wrapperMenuController.isDark.value
                    ? Colors.black
                    : Colors.white,
                clipBehavior: Clip.antiAlias,
              ),
            );
          });

    ///
    ///
    ///
    ///
  }
}

LIGHT MODE

LIGHT MODE

DARK MODE

DARK MODE

DEMO MODE

APK BASE WEB BASE

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

base_ui_m3's People

Contributors

baydim avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

dhenjo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.