I followed @5ton3's approach of removing .gcloudignore from and adding the virtual env dir. to .gcloudignore. It also worked strangely enough.
no troll why does my brick look like this?
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController
app = Ursina()
player = FirstPersonController()
ground = Entity(model='plane', texture='grass', scale=20, collider='box')
house = Entity(model='cube', texture='brick', scale=2, collider='box')
app.run()
I have same issue in chorma only. I reslove this issued by Reactime26.1 extension use in react when i make it disabled its sloved the error i hope some one help
Did you get any answer for this problem. Even i have a similar issue where i want to know which test case is covering a particular scenario , which is essentially a bug.
I want to Add Camera preview to my project ,but not in Xcode I want to do it on Swift play ground, can anyone guide me thru it ?
Having the same problem, did you ever get this resolved?
Please can you give me the link where to find the Growatt API documentation
Please don’t react to these offer.
Exactly same issue, any solutions to this?
they removed the dl link, 2025 week 8
I'm getting the error the question author says, but I'm not getting the error in the logs pointed here: https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues. I followed your approach, but I have gnome-keyring running, I installed sudo apt install libsecret-1-0 libsecret-1-dev
, and "security.workspace.trust.enabled"
was already true. But I'm still getting the same error when trying to login to GitHub.
don’t react to these offer please.
did you solve the problem? i m facing the same issue when googling from digital ocean droplet. got 403. On terminal works
Comment saisir un dropdown au clavier sur smartphone? Cordialement
If you wants to load llama model locally , you can check out this article where proper steps are mentioned.
اسم رب الأسرة رباعغ عدلي علي احمد بشارة ،تاريخ الميلاد17/11/1994 شمال دارفور الفاشر السكن/الحي النخيل الرقم الوطني 19209321512،الهاتف +24990524507 عدد أفراد الأسرة 2،زوجةحاملة نعم،عدداطفال أقل من6اشهر لايوجد،عدداطفال أقل من 5اشهر لايوجد ،رقم بنكك2798117 , إسم صاحب رقم الحساب عدلي علي احمد بشارة ،رقم وطني صاحب الحساب 19209321512
Any update on this? I am facing the same issue. Happens only for certain regions (numbers with certain country code - in my case Libyan numbers) and works as expected for numbers with other country codes.
Thank you so much for your help. More details are given below:
base.html :
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:fragment="layout(content)"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head th:fragment="title">
<meta charset="UTF-8">
<title>StokSense</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet"
th:href="@{https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css}" />
<!-- Bootstrap Icons -->
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" />
<!-- Custom CSS -->
<link rel="stylesheet" th:href="@{/css/custom.css}" />
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
body {
display: flex;
flex-direction: column;
}
main {
flex: 1;
}
</style>
</head>
<body
th:with="
currentUser=
${(#authentication != null and #authentication.name != 'anonymousUser')
? @userService.findByEmail(#authentication.name)
: null}
"
th:classappend="${currentUser != null and currentUser.theme=='dark'} ? ' dark-mode' : ''"
>
<!-- NAVBAR -->
<header th:fragment="header">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<!-- Logo -->
<a class="navbar-brand" th:href="@{/}">
<i class="bi bi-box-seam me-1"></i> StokSense
</a>
<button class="navbar-toggler" type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Menu">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto">
<!-- Ürünler -->
<li class="nav-item" sec:authorize="isAuthenticated()">
<a class="nav-link" th:text="#{menu.products}" th:href="@{/products}"></a>
</li>
<!-- Kategoriler -->
<li class="nav-item" sec:authorize="isAuthenticated()">
<a class="nav-link" th:text="#{menu.categories}" th:href="@{/categories}"></a>
</li>
<!-- Satın Alma -->
<li class="nav-item" sec:authorize="isAuthenticated()">
<a class="nav-link" th:text="#{menu.purchases}" th:href="@{/purchases}"></a>
</li>
<!-- Tedarikçiler -->
<li class="nav-item" sec:authorize="isAuthenticated()">
<a class="nav-link" th:text="#{menu.suppliers}" th:href="@{/suppliers}"></a>
</li>
<!-- Müşteriler -->
<li class="nav-item" sec:authorize="isAuthenticated()">
<a class="nav-link" th:text="#{menu.customers}" th:href="@{/customers}"></a>
</li>
<!-- Satış -->
<li class="nav-item" sec:authorize="isAuthenticated()">
<a class="nav-link" th:text="#{menu.sales}" th:href="@{/sales}"></a>
</li>
<!-- Raporlar -->
<li class="nav-item" sec:authorize="isAuthenticated()">
<a class="nav-link" th:text="#{menu.reports}" th:href="@{/reports}"></a>
</li>
<!-- Admin Panel -->
<li class="nav-item" sec:authorize="hasRole('ADMIN')">
<a class="nav-link" th:text="#{menu.adminPanel}" th:href="@{/admin/index}"></a>
</li>
<!-- Forecast -->
<li class="nav-item" sec:authorize="hasRole('ADMIN') or hasRole('PREMIUM')">
<a class="nav-link" th:text="#{menu.forecast}" th:href="@{/premium/forecast}"></a>
</li>
<!-- Kullanıcı Panelim -->
<li class="nav-item" sec:authorize="hasAnyRole('STANDARD','PREMIUM')">
<a class="nav-link" th:text="#{menu.dashboard}" th:href="@{/user/dashboard}"></a>
</li>
<!-- Plan Yükselt -->
<li class="nav-item" sec:authorize="hasRole('STANDARD')">
<a class="nav-link" th:text="#{menu.planUpgrade}" th:href="@{/user/plans}"></a>
</li>
</ul>
<!-- Sağ kısım (Giriş / Profil) -->
<ul class="navbar-nav ms-auto">
<!-- Giriş -->
<li class="nav-item" sec:authorize="!isAuthenticated()">
<a class="nav-link" th:href="@{/login}" th:text="#{menu.login}"></a>
</li>
<!-- Kayıt -->
<li class="nav-item" sec:authorize="!isAuthenticated()">
<a class="nav-link" th:href="@{/register}" th:text="#{menu.register}"></a>
</li>
<!-- Dil Seçimi (icon ekledik) -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle"
href="#"
role="button"
data-bs-toggle="dropdown"
aria-expanded="false">
<i class="bi bi-translate me-1"></i>
Dil Seçenekleri
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="?lang=tr">Türkçe</a>
</li>
<li>
<a class="dropdown-item" href="?lang=en">English</a>
</li>
</ul>
</li>
<!-- Profil Dropdown (giriş yapmış) -->
<li class="nav-item dropdown" sec:authorize="isAuthenticated()">
<a class="nav-link dropdown-toggle" href="#"
role="button" data-bs-toggle="dropdown"
aria-expanded="false"
th:text="#{menu.profile}"></a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" th:href="@{/profile}">
<i class="bi bi-gear-wide-connected me-1"></i>
[[#{menu.profile}]]
</a>
</li>
<li>
<form th:action="@{/logout}" method="post" class="m-0">
<button class="dropdown-item" type="submit">
<i class="bi bi-box-arrow-right me-1"></i>
[[#{menu.logout}]]
</button>
</form>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main>
<div th:replace="${content}"></div>
</main>
<!-- FOOTER -->
<footer class="bg-light text-center text-lg-start mt-5" th:fragment="footer">
<div class="text-center p-3">
[[#{footer.copyright}]]
</div>
</footer>
<!-- Bootstrap JS -->
<script th:src="@{https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js}"></script>
</body>
</html>
4. Order Form Template
order-form.html :
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Ön Sipariş Oluştur - Naaaa</title>
</head>
<body th:replace="~{base :: layout(~{::content})}">
<div th:fragment="content" class="container mt-4">
<h2>Ön Sipariş Oluştur</h2>
<!-- Basit form (Spring MVC) -> method="post" -->
<form th:action="@{/orders/save}"
th:object="${order}"
method="post"
class="needs-validation"
novalidate>
<!-- Sipariş ID (hidden) -->
<input type="hidden" th:field="*{id}" />
<!-- Müşteri Seçimi -->
<div class="mb-3">
<label for="customerSelect" class="form-label">Müşteri Seçiniz</label>
<select id="customerSelect"
th:field="*{customer.id}"
class="form-select"
required>
<option value="" disabled selected>Seçiniz</option>
<option th:each="c : ${customers}"
th:value="${c.id}"
th:text="${c.name}">
</option>
</select>
<div class="invalid-feedback">Lütfen bir müşteri seçiniz.</div>
</div>
<!-- Ürün Seçimi -->
<div class="mb-3">
<label for="productSelect" class="form-label">Ürün Seçiniz</label>
<select id="productSelect"
th:field="*{product.id}"
class="form-select"
required>
<option value="" disabled selected>Seçiniz</option>
<!--
data-price: Her ürünün "price" değerini HTML5 data attribute olarak tutuyoruz.
Seçilen üründe bu attribute'u JS ile okuyup "Net Birim Fiyat" alanına set edeceğiz.
-->
<option th:each="p : ${products}"
th:value="${p.id}"
th:attr="data-price=${p.price}"
th:text="${p.name}">
</option>
</select>
<div class="invalid-feedback">Lütfen bir ürün seçiniz.</div>
</div>
<!-- Net Birim Fiyat -->
<div class="mb-3">
<label for="netUnitPrice" class="form-label">Net Birim Fiyat</label>
<input type="number"
step="0.01"
th:field="*{netUnitPrice}"
class="form-control"
id="netUnitPrice"
placeholder="The price of the selected product will appear automatically"
required />
<div class="invalid-feedback">Net birim fiyat alanı zorunlu.</div>
</div>
<div class="mb-3">
<label for="taxRate" class="form-label">Vergi Oranı</label>
<input type="number"
step="0.01"
th:field="*{taxRate}"
class="form-control"
id="taxRate"
placeholder="0.18 => %18"
required />
<div class="invalid-feedback">Lütfen geçerli bir vergi oranı giriniz.</div>
</div>
<!-- Miktar -->
<div class="mb-3">
<label for="quantity" class="form-label">Miktar (Adet)</label>
<input type="number"
th:field="*{quantity}"
class="form-control"
id="quantity"
value="1"
min="1"
required />
<div class="invalid-feedback">En az 1 adet olmalıdır.</div>
</div>
<button type="submit" class="btn btn-primary">Kaydet</button>
<a th:href="@{/orders/my}" class="btn btn-secondary">İptal</a>
</form>
</div>
<!-- JS (Bootstrap ve script) -->
<script th:src="@{https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js}"></script>
<script>
(function () {
'use strict';
const forms = document.querySelectorAll('.needs-validation');
Array.from(forms).forEach(form => {
form.addEventListener('submit', function (event) {
if (!form.checkValidity()) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
})();
document.addEventListener('DOMContentLoaded', function() {
const productSelect = document.getElementById('productSelect');
const netPriceInput = document.getElementById('netUnitPrice');
productSelect.addEventListener('change', function() {
const selectedOption = productSelect.options[productSelect.selectedIndex];
const price = selectedOption.getAttribute('data-price');
if (price) {
netPriceInput.value = price;
}
});
});
</script>
</body>
</html>
5. Behavior Observed
6. Browser / Tools
Maybe you want to see it;
OrderController.java :
package com.stoksense.controller;
import com.stoksense.model.*;
import com.stoksense.service.*;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
@Controller
@RequestMapping("/orders")
public class OrderController {
private final OrderService orderService;
private final ProductService productService;
private final CustomerService customerService;
private final UserService userService;
private final SaleService saleService;
public OrderController(OrderService orderService,
ProductService productService,
CustomerService customerService,
UserService userService,
SaleService saleService) {
this.orderService = orderService;
this.productService = productService;
this.customerService = customerService;
this.userService = userService;
this.saleService = saleService;
}
@GetMapping("/my")
public String myOrders(Authentication auth, Model model) {
User user = userService.findByEmail(auth.getName());
if (user == null) {
return "redirect:/login?notAllowed";
}
// Customer
Customer cust = customerService.findByEmail(user.getEmail());
if (cust == null) {
model.addAttribute("orders", List.of());
return "orders/my-orders";
}
// siparişleri al
List<Order> orders = orderService.getOrdersByCustomer(cust);
model.addAttribute("orders", orders);
return "orders/my-orders";
}
@GetMapping("/add")
public String showAddOrderForm(Model model, Authentication auth) {
Order order = new Order();
order.setOrderDate(LocalDateTime.now());
order.setStatus(OrderStatus.PENDING);
// Giriş yapan user => Customer
User user = userService.findByEmail(auth.getName());
if (user != null) {
Customer c = customerService.findByEmail(user.getEmail());
if (c != null) {
order.setCustomer(c);
}
List<Product> userProducts = productService.getAllProductsByEmail(user.getEmail());
model.addAttribute("products", userProducts);
} else {
model.addAttribute("products", List.of());
}
model.addAttribute("customers", customerService.getAllCustomers());
model.addAttribute("order", order);
return "orders/order-form"; // templates/orders/order-form.html
}
@PostMapping("/save")
public String saveOrder(@ModelAttribute("order") Order order,
Authentication auth) {
User user = userService.findByEmail(auth.getName());
if (user == null) {
return "redirect:/login?notAllowed";
}
// Müşteri atanmamışsa
if (order.getCustomer() == null || order.getCustomer().getId() == null) {
Customer c = customerService.findByEmail(user.getEmail());
if (c == null) {
return "redirect:/orders/my?noCustomer";
}
order.setCustomer(c);
}
// Ürün stok kontrol & stok düş
if (order.getProduct() != null && order.getProduct().getId() != null) {
Product p = productService.getProductById(order.getProduct().getId()).orElse(null);
if (p == null) {
return "redirect:/orders/my?productNotFound";
}
if (p.getStockQuantity() < order.getQuantity()) {
return "redirect:/orders/my?insufficientStock";
}
p.setStockQuantity(p.getStockQuantity() - order.getQuantity());
productService.saveProduct(p);
// netUnitPrice boşsa => product.price
if (order.getNetUnitPrice() == null || order.getNetUnitPrice() == 0) {
order.setNetUnitPrice(p.getPrice());
}
}
// totalAmount
double net = (order.getNetUnitPrice() != null) ? order.getNetUnitPrice() : 0;
double tax = (order.getTaxRate() != null) ? order.getTaxRate() : 0;
int qty = (order.getQuantity() != null) ? order.getQuantity() : 1;
double total = (net * qty) * (1 + tax);
order.setTotalAmount(total);
// Durum => PENDING
if (order.getStatus() == null) {
order.setStatus(OrderStatus.PENDING);
}
orderService.save(order);
return "redirect:/orders/my?created";
}
@GetMapping("/complete/{id}")
public String completeOrder(@PathVariable("id") Long id, Authentication auth) {
Order order = orderService.getOrderById(id);
if (order == null) {
return "redirect:/orders/my?notfound";
}
User user = userService.findByEmail(auth.getName());
if (user == null) {
return "redirect:/login?error";
}
Customer cust = customerService.findByEmail(user.getEmail());
if (cust == null || !order.getCustomer().getId().equals(cust.getId())) {
return "redirect:/orders/my?unauthorized";
}
if (order.getStatus() != OrderStatus.CONFIRMED) {
order.setStatus(OrderStatus.CONFIRMED);
orderService.save(order);
// Satışa dönüştür
saleService.createSaleFromOrder(order);
}
return "redirect:/orders/my?completed";
}
}
ProductController.java :
package com.stoksense.controller;
import com.stoksense.model.Product;
import com.stoksense.service.CategoryService;
import com.stoksense.service.ProductService;
import com.stoksense.service.UserService;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Controller
@RequestMapping("/products")
public class ProductController {
private final ProductService productService;
private final UserService userService;
private final CategoryService categoryService;
public ProductController(ProductService productService,
UserService userService,
CategoryService categoryService) {
this.productService = productService;
this.userService = userService;
this.categoryService = categoryService;
}
@GetMapping
public String listProducts(@RequestParam(value = "search", required = false) String search,
Model model,
Authentication authentication) {
// Eskisi gibi ürün liste mantığı
if (authentication == null) {
model.addAttribute("products", List.of());
return "product-list";
}
String email = authentication.getName();
var products = productService.getAllProductsByEmail(email);
if (search != null && !search.trim().isEmpty()) {
String lower = search.trim().toLowerCase();
products = products.stream()
.filter(p -> p.getName() != null &&
p.getName().toLowerCase().contains(lower))
.toList();
model.addAttribute("search", search);
}
long totalUserProducts = productService.countAllProductsByEmail(email);
long totalStock = products.stream().mapToLong(Product::getStockQuantity).sum();
double averagePrice = 0.0;
if (!products.isEmpty()) {
double sumPrices = products.stream()
.mapToDouble(p -> (p.getPrice() != null ? p.getPrice() : 0.0))
.sum();
averagePrice = sumPrices / products.size();
}
model.addAttribute("products", products);
model.addAttribute("totalUserProducts", totalUserProducts);
model.addAttribute("totalStock", totalStock);
model.addAttribute("averagePrice", averagePrice);
return "product-list";
}
/**
* GET /products/add
* Yeni ürün ekleme formu (Kategorileri de modele ekleyelim).
*/
@GetMapping("/add")
public String showAddProductForm(Model model, Authentication authentication) {
model.addAttribute("product", new Product());
// Kullanıcının kategorilerini bul
if (authentication != null) {
var user = userService.findByEmail(authentication.getName());
if (user != null) {
// Tüm kategoriler
var categories = categoryService.getAllCategoriesByEmail(user.getEmail());
model.addAttribute("categories", categories);
} else {
model.addAttribute("categories", List.of());
}
} else {
model.addAttribute("categories", List.of());
}
return "product-form";
}
@PostMapping("/save")
public String saveProduct(@ModelAttribute("product") Product product,
Authentication authentication) {
if (authentication != null) {
var user = userService.findByEmail(authentication.getName());
product.setOwner(user);
}
productService.saveProduct(product);
return "redirect:/products?success";
}
/**
* GET /products/edit/{id}
* Düzenleme formu (Kategori listesi de ekleyelim).
*/
@GetMapping("/edit/{id}")
public String showEditProductForm(@PathVariable("id") Long id,
Model model,
Authentication authentication) {
var opt = productService.getProductById(id);
if (opt.isEmpty()) {
return "redirect:/products?notfound";
}
Product product = opt.get();
model.addAttribute("product", product);
// Kullanıcının kategorilerini bul
if (authentication != null) {
var user = userService.findByEmail(authentication.getName());
if (user != null) {
var categories = categoryService.getAllCategoriesByEmail(user.getEmail());
model.addAttribute("categories", categories);
} else {
model.addAttribute("categories", List.of());
}
} else {
model.addAttribute("categories", List.of());
}
return "product-form";
}
@GetMapping("/delete/{id}")
public String deleteProduct(@PathVariable("id") Long id) {
productService.deleteProduct(id);
return "redirect:/products?deleted";
}
@GetMapping("/bulk-update")
public String showBulkUpdateForm(Model model, Authentication authentication) {
if (authentication == null) {
model.addAttribute("products", List.of());
return "bulk-update";
}
var user = userService.findByEmail(authentication.getName());
var products = productService.getAllProductsByEmail(user.getEmail());
model.addAttribute("products", products);
return "bulk-update";
}
@PostMapping("/bulk-update")
public String processBulkUpdate(@RequestParam("productIds") List<Long> productIds,
@RequestParam("newStock") List<Integer> newStockValues) {
for (int i = 0; i < productIds.size(); i++) {
productService.updateStockQuantity(productIds.get(i), newStockValues.get(i));
}
return "redirect:/products?bulkUpdated";
}
}
Thank you very much in advance for your help, if there is anything else you would like to see, please let me know.
I don't have enough reputation to comment. As another person said, I also resolved this problem on Thonny/Pico by removing "freq = 40000' from the I2C object statement.
I'm having the same issue but with C#. Should I assume that this isn't a bug, but that it's just not supported yet in the C# extension?
I am facing the same problem. en_US language works fine. My template is in another language, approved by Meta for the test given telephone number. The issue should be for the demo telephone number is tight to the English (en_US) language.
Файл написан кириллицей та же ошибка, надо переименовать в латиницу
Anyone now if it is possible to get the click callback link on this windows toast notification ?
Here's a nice description from Microsoft on that topic: https://learn.microsoft.com/en-us/previous-versions/office/troubleshoot/office-developer/set-up-vb-project-using-class
Sorry, no answer, but I am having a similar problem. I am trying to use adafruit-blinka on a Pi Zero W. Starting from a clean SD card I have installed the Rpi OS and I have done a manual blinky install as documented by Adafruit.
I am using a virtual environment. If I run a python3 "shell" then import board and dir(board) seem to work just fine.
If I create a python script containing "import board" it fails reporting "module board not found".
Any Clues, Cheers
I hope everyone is fine. I also searched on stackoverflow but couldn't find it. Or maybe I didn't call correctly. I cannot send the reordering here to the back-end. I added SS. I would be very happy if you could help. I couldn't find where I made a mistake.
I handle gamebutton presses in my bar.
https://developer.android.com/about/versions/15/behavior-changes-15#ux The easiest and temporary workaround is to target Android 14.
I jave just found prop-types are no longer validated in React 19.
The crash in iOS 12 is solved by setting the Optimization Level from "Optimize for Speed" to "No Optimizaiton"
facing same issue! did you find solution for this?
The answer was defineSlots
As a last resort, reboot your computer.
I have fixed it now... all I needed to do was to reinstall godot-cpp.
Everyone
Option to choose table is good and it work absolutely correct but didn't work correctly when my table header height is too large it just stop printing header from the next page.
I read about this and found the the height of the header to work correctly is about 234 px and above that it will not get printed from the next page this is default behaviour of the browser bit how do I surpass thia I don't want to put and height contrain on my header height
Thank in advance for the solution
Since I have the same problem I wonder you were able to fix the problem, and if so how :-)
I tried the recommendations, and it's even worse. I had to rewrite the whole thing enter image description here
Follow This: https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/studio-versions and go back a version.
@LoicTheAztec Sorry, but my client was on a trip and I couldn't test the comments. Can you please send the comment that was deleted?
It might be bugged in an update process by Microsoft, creating a new environment pointing to the newest version allows me coding again:
I'm also getting the same error. Can anyone help me with this issue to resolve?
The "pkceCodeVerifier value could not be parsed" issue occurs when a user accepts an invitation. However, for normal sign-in or sign-up, it works fine.
I have created a regular app in Auth0 and also set all the required URLs.
Below is the code for the NextAuth configuration file and provider configuration for Auth0:
const authConfig = {
debug: true, // Enabled because we are in development
providers: [
Auth0Provider({
clientId: process.env.AUTH0_CLIENT_ID,
clientSecret: process.env.AUTH0_CLIENT_SECRET,
issuer: process.env.AUTH0_ISSUER,
authorization: {
params: {
prompt: "login",
},
},
}),
],
adapter: DrizzleAdapter(db, {
usersTable: users,
accountsTable: accounts,
sessionsTable: sessions,
verificationTokensTable: verificationTokens,
}),
callbacks: {
async signIn({ user, account, profile }: ISigninAuth0) {
const updates: IUpdateUser = {};
if (profile?.email_verified && !user?.emailVerified) {
updates.emailVerified = new Date();
}
if (Object.keys(updates).length > 0) {
await updateUserByEmail(user.email!, updates);
}
return true;
},
session: async ({ session, user }) => {
const userData = await getUser(user.id);
if (!userData) {
throw new Error("User data not found");
}
return {
...session,
user: {
id: user.id,
...{
name: userData.name,
email: userData.email,
emailVerified: userData.emailVerified,
}
},
};
},
},
trustHost: true,
} satisfies NextAuthConfig;
const { auth: uncachedAuth, handlers, signIn, signOut } = NextAuth(authConfig);
const auth = cache(uncachedAuth);
export { auth, handlers, signIn, signOut };
Organization admin invites user to join the organization by using Auth0 management API.
POST /api/v2/organizations/{id}/invitations
Body: {
"inviter": {
"name": "string"
},
"invitee": {
"email": "[email protected]"
},
"client_id": "string",
"user_metadata": {},
"ttl_sec": 0,
"roles": [
"string"
],
"send_invitation_email": true
}
The user receives an email with a link to join the organization. The user clicks on the link (which looks like https://example.com/api/authorize?invitation={invitation_id}&organization={organization_id}) and is redirected to our website.
There, we extract the invitation_id and organization_id from the query params and generate a new invitation link with the following code:
const baseUrl = `https://myauth0domain.com/authorize`;
const url = new URL(baseUrl);
url.searchParams.append("response_type", "code");
url.searchParams.append("client_id", clientId);
url.searchParams.append("redirect_uri", redirectUri);
url.searchParams.append("invitation", invitation);
url.searchParams.append("organization", organizationId);
url.searchParams.append("scope", "openid profile email");
const finalUrl = url.toString();
return NextResponse.redirect(new URL(finalUrl as string, baseURL));
The user is then redirected to the Auth0 login page, and after successful login, the user is redirected back to our website with the code in the query params. However, I get the error "pkceCodeVerifier can not be parsed," and the user is not logged in. I have checked the logs in Auth0, and all logs are fine. I'm using the regular Auth0 application, and the pkceCodeVerifier flow is handled by Auth0 itself in regular application.
I have also passed the code challenge, code challenge method, and state in the URL but am still getting the same error. Below is the code for the same:
Ref to create code verifier and code challenge: https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce/add-login-using-the-authorization-code-flow-with-pkce#create-code-verifier
// code verifier
function base64URLEncode(str: any) {
return str.toString('base64')
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '');
}
const verifier = base64URLEncode(crypto.randomBytes(32));
// code challenge
function sha256(buffer) {
return crypto.createHash('sha256').update(buffer).digest();
}
const challenge = base64URLEncode(sha256(verifier));
url.searchParams.append('code_challenge', challenge);
url.searchParams.append('code_challenge_method', 'S256');
url.searchParams.append('state', state);
I have also tried to set the cookie options in the NextAuth configuration file but am still getting the same error. Below is the code for the same:
cookies: {
pkceCodeVerifier: {
name: "authjs.pkce.code_verifier",
options: {
httpOnly: true,
sameSite: "none",
path: "/",
secure: true, // Set to true in production
},
},
},
I have also added the code verifier in the cookies below is the code
const baseUrl = `https://myauth0domain.com/authorize`;
const url = new URL(baseUrl);
url.searchParams.append("response_type", "code");
url.searchParams.append("client_id", clientId);
url.searchParams.append("redirect_uri", redirectUri);
url.searchParams.append("invitation", invitation);
url.searchParams.append("organization", organizationId);
url.searchParams.append("scope", "openid profile email");
const finalUrl = url.toString();
const response = NextResponse.redirect(new URL(finalUrl as string, baseURL));
const cookieOptions = {
httpOnly: true,
secure: false,
maxAge: 900, // 15 minutes
path: '/',
};
response.headers.set(
'Set-Cookie',
serialize('authjs.pkce.code_verifier', verifier, cookieOptions)
);
return response
Simple signUp/signIn Works fine but when I try to log in with the invitation link then i get the error.
in later version there is a thing called sync project that should resolve it enter image description here
Did you figure out a solution for this? If yes can you please share it here? thanks
Somebody has been tested this on a repeatable field?
Thank you very much. I found that error was because I needed to have the compatible version between React/Chakra. I finilly used the 18.2.2 version React and 2.8.0 Chakra version.
How can I have all the programmed code together?
simply you can visit - https://base64pdf.com and you can convert your base64 to pdf and pdf to base64 data uri here you can also decode encode pdf files. base64pdf
Please explain your question? Are you trying to change default.xml and use yaml or anything else.
This is currently not possible as default.xml and other xml files are for keeping the configurations.
But if you want to change json or yaml input in request body to any other form like xml that is possible with an use JavaScript, transformers like xml transformer etc. for this.
You can respond to this thread with explanation. Feel free to contact.
This issue has been fixed in Flutter 3.29.0, which was released to the stable channel. https://github.com/flutter/flutter/issues/160442#issuecomment-2627839218
I'm also getting the same error. Can anyone help me with this issue?
The "pkceCodeVerifier value could not be parsed" issue occurs when a user accepts an invitation. However, for normal sign-in or sign-up, it works fine.
I have created a regular app in Auth0 and also set all the required URLs as referenced in the screenshot below.
I have also set the type of users in the Auth0 application.
Below is the code for the NextAuth configuration file and provider configuration for Auth0:
const authConfig = {
debug: true, // Enabled because we are in development
providers: [
Auth0Provider({
clientId: process.env.AUTH0_CLIENT_ID,
clientSecret: process.env.AUTH0_CLIENT_SECRET,
issuer: process.env.AUTH0_ISSUER,
authorization: {
params: {
prompt: "login",
},
},
}),
],
adapter: DrizzleAdapter(db, {
usersTable: users,
accountsTable: accounts,
sessionsTable: sessions,
verificationTokensTable: verificationTokens,
}),
callbacks: {
async signIn({ user, account, profile }: ISigninAuth0) {
const updates: IUpdateUser = {};
if (profile?.email_verified && !user?.emailVerified) {
updates.emailVerified = new Date();
}
if (Object.keys(updates).length > 0) {
await updateUserByEmail(user.email!, updates);
}
return true;
},
session: async ({ session, user }) => {
const userData = await getUser(user.id);
if (!userData) {
throw new Error("User data not found");
}
return {
...session,
user: {
id: user.id,
...{
name: userData.name,
email: userData.email,
emailVerified: userData.emailVerified,
}
},
};
},
},
trustHost: true,
} satisfies NextAuthConfig;
const { auth: uncachedAuth, handlers, signIn, signOut } = NextAuth(authConfig);
const auth = cache(uncachedAuth);
export { auth, handlers, signIn, signOut };
Organization admin invites user to join the organization by using Auth0 management API.
POST /api/v2/organizations/{id}/invitations
Body: {
"inviter": {
"name": "string"
},
"invitee": {
"email": "[email protected]"
},
"client_id": "string",
"user_metadata": {},
"ttl_sec": 0,
"roles": [
"string"
],
"send_invitation_email": true
}
The user receives an email with a link to join the organization. The user clicks on the link (which looks like https://example.com/api/authorize?invitation={invitation_id}&organization={organization_id}) and is redirected to our website.
There, we extract the invitation_id and organization_id from the query params and generate a new invitation link with the following code:
const baseUrl = `https://myauth0domain.com/authorize`;
const url = new URL(baseUrl);
url.searchParams.append("response_type", "code");
url.searchParams.append("client_id", clientId);
url.searchParams.append("redirect_uri", redirectUri);
url.searchParams.append("invitation", invitation);
url.searchParams.append("organization", organizationId);
url.searchParams.append("scope", "openid profile email");
const finalUrl = url.toString();
return NextResponse.redirect(new URL(finalUrl as string, baseURL));
The user is then redirected to the Auth0 login page, and after successful login, the user is redirected back to our website with the code in the query params. However, I get the error "pkceCodeVerifier can not be parsed," and the user is not logged in. I have checked the logs in Auth0, and all logs are fine. I'm using the regular Auth0 application, and the pkceCodeVerifier flow is handled by Auth0 itself in regular application.
I have also passed the code challenge, code challenge method, and state in the URL but am still getting the same error. Below is the code for the same:
Ref to create code verifier and code challenge: https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce/add-login-using-the-authorization-code-flow-with-pkce#create-code-verifier
// code verifier
function base64URLEncode(str: any) {
return str.toString('base64')
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '');
}
const verifier = base64URLEncode(crypto.randomBytes(32));
// code challenge
function sha256(buffer) {
return crypto.createHash('sha256').update(buffer).digest();
}
const challenge = base64URLEncode(sha256(verifier));
url.searchParams.append('code_challenge', challenge);
url.searchParams.append('code_challenge_method', 'S256');
url.searchParams.append('state', state);
I have also tried to set the cookie options in the NextAuth configuration file but am still getting the same error. Below is the code for the same:
cookies: {
pkceCodeVerifier: {
name: "authjs.pkce.code_verifier",
options: {
httpOnly: true,
sameSite: "none",
path: "/",
secure: true, // Set to true in production
},
},
},
I have also added the code verifier in the cookies below is the code
const baseUrl = `https://myauth0domain.com/authorize`;
const url = new URL(baseUrl);
url.searchParams.append("response_type", "code");
url.searchParams.append("client_id", clientId);
url.searchParams.append("redirect_uri", redirectUri);
url.searchParams.append("invitation", invitation);
url.searchParams.append("organization", organizationId);
url.searchParams.append("scope", "openid profile email");
const finalUrl = url.toString();
const response = NextResponse.redirect(new URL(finalUrl as string, baseURL));
const cookieOptions = {
httpOnly: true,
secure: false,
maxAge: 900, // 15 minutes
path: '/',
};
response.headers.set(
'Set-Cookie',
serialize('authjs.pkce.code_verifier', verifier, cookieOptions)
);
return response
SignUp/SignIn flow Screenshot:
Invitation Screenshot:
Simple signUp/signIn Works fine but when I try to log in with the invitation link then i get the error.
It looks like it's not possible to edit the main.go file location so I am going to try change the docker file
RUN CGO_ENABLED=0 GOOS=linux go build -o main ./cmd/myapp/
I still get the same error
=> [builder 5/6] COPY . .
2.3s => ERROR [builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -o main ./cmd/myapp/
13.7s
[builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -o main ./cmd/myapp/: #13 13.28 stat /app/cmd/myapp: directory not found
I don't understand at all I. Andrea wisnesneski ur saying Ed wins what did ed win??e told me no one told me situation if it's about inherent then I would of did whatever needed to be done or if it had anything to do with child I would of done anything that needed to be done but because I wasn't informed of anything how is it far Ed wins???
Did you find anything related to this?? I am facing the exact same issue and was hoping for some help as I have been researching for days about this.
Why does everyone put "x" after the "Lamda" part of the formula?
LAMBDA(x; SUM(x)
What goes in leu of the x's?
Thx,
dgDG
I have same issue. Need to pass context in {children} and my context is also in CamelCase but no luck still undefined,
return (
<GoogleOAuthProvider clientId={clientID}>
<ProfileContext.Provider value={Profile}>
<html lang="en">
<body className={`${Font.variable}`}>
<Navbar />
{children}
<Footer />
<ProgressBar />
<button className={`scrollToTopButton ${isVisible ? "visible" : ""}`} onClick={scrollToTop}>
<FontAwesomeIcon icon={faAngleUp} style={{ width: "22px", height: "32px" }} />
</button>
</body>
</html>
</ProfileContext.Provider>
</GoogleOAuthProvider>
)
}
"use client"
// import Form from "next/form "
import { useState, useEffect, useContext } from "react"
import Button from "../Components/Button"
import ProfileContext from "../layout"
export default function Contact() {
const [name, setName] = useState()
const [email, setEmail] = useState()
const [message, setMessage] = useState()
const [mobile, setMobile] = useState()
const [service, setService] = useState()
const [isSubmitted, setiSSubmitted] = useState(false)
const [isLoading, setIsLoading] = useState(false)
const value = useContext(ProfileContext)
async function HandleSubmit(e) {
setIsLoading(true)
e.preventDefault()
let body = {
cred: process.env.NEXT_PUBLIC_CRED,
email: email,
mobile: mobile,
when: new Date().toLocaleDateString(),
message: message,
name: name,
service: service,
}
let res = await fetch("/api/contact", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(body),
}).then(function (response) {
console.info(response)
setIsLoading(false)
setiSSubmitted(true)
})
}
console.log(value)
Importing context in another component gives undefined. I don't need to switch to app router, any other solution you guys found ?
I got it :) I just had to remove the fixed width and ONLY have a max-width and min-width
how do I set home-brew thing I know nothing about terminal and what is ~/.bashrc or ~/.zshrc help pls
Error 4003: Media Codec VideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.64001F, 1284070, null, [1280, 720, 25.0, ColorInfo (Unset color space, Unset color range, Unset color transfer, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=YES???
can you please provide the solution for attachment of pkcs7 signature for multiple signature appearances so,that the same signature appearance appears on all pages in a customized location.
Got it working :-), Just follow the instructions here: https://blog.greggant.com/posts/2024/02/19/how-to-play-blu-rays-on-mac-vlc.html#:~:text=For%20Apple%20Silicon%20Macs%2C%20you,%2Fhomebrew%2Fcellar%2Flibaacs%20.
wow thats so sigma i cnat imagene so cool
i have same problem but i want read documentation that mentioned by @Thomas Potaire page not found
Can user create private dashboard? Is there any way to achieve it.
Is there a way to ensure that each user can only see their own dashboard while making certain dashboards accessible to all users?
Can you help me out? I'm facing a similar issue and I'd like help
check the link on how to use it for Raspberry Pi:
sudo apt-get install chromium-chromedriver
4fr9ui9wt0reu84tev098u04tv3c8u403vu89tcm03v894rum ?EWYDQHYEQDEHDHWQED? NAH BRUH áúíé
Hi My issue is that when I make a default credit card in Azure subscription, it also change my default cc in M365 subscription.
I want both M365 and Azure subscription, default cc different but thats not happening.
All cc in M365 subs shows up in Azure and vice versa Also default credit card in M365 get forced changed in Azure and vice versa.
How do I keep them separate ??
It was caused due to Google Analytics Service after turning off Google Analytics Service , the crashes have gone down.
Wanted to know if there were any changes done from Google End which could have caused this?
Folks if you have any idea on this kindly help here.
Can I use an ObservableAsPropertyHelper as a 'CanExecute' definition for a command? Say, my first command returns a result asynchronously and I created an OAPH for it, can I somehow use it for my second command to define its 'canExecute' property? Or it is not meant to work this way?
i'm facing the same problem but none of the above solved my problem...:(
[2025-02-22T18:29:48.403Z] A host error has occurred during startup operation '2eff64a0-b359-424b-8cfc-2eff64a0'.
[2025-02-22T18:29:48.407Z] Microsoft.Azure.WebJobs.Script: WorkerConfig for runtime: python not found.
[2025-02-22T18:29:48.416Z] Failed to stop host instance '12795099-41af-4d0e-9582-2795099'.
Value cannot be null. (Parameter 'provider')[2025-02-22T18:29:48.430Z] Microsoft.Azure.WebJobs.Host: The host has not yet started.
while i have this config;
local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "python",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
}
}
host.json:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
settings.json:
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.scmDoBuildDuringDeployment": true,
"azureFunctions.pythonVenv": ".venv",
"azureFunctions.projectLanguage": "Python",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.projectLanguageModel": 2
}
while
and pyenv.cfg
home = C:\uname\AppData\Local\Programs\Python\Python311
include-system-site-packages = false
version = 3.11.0
executable = C:\uname\AppData\Local\Programs\Python\Python311\python.exe
command = C:\uname\AppData\Local\Programs\Python\Python311\python.exe -m venv C:\uname\AppData\Local\Programs\Python\Python311\.venv
i've uninstall azure-functions-core-tools@4, reinstalled, restart the pc..etc nothing worked.
Ps: i've installed the azure function on zip and added it to my path..
can someone suggest me something to do? thanks
did someone able to fix or at least figured-out the issue on this ? I am facing of this crash as well on my android app but there is no crashes in iOS. It's expo project.
I have Made a flutter SDK for anyone trying to implement it now check it out. https://pub.dev/packages/ntt_atom_flutter/
Below code also not working for me.
.authorizeHttpRequests(authorizeRequests -> authorizeRequests .requestMatchers("/api/createUser/**").hasRole("ADMIN") .requestMatchers("/api/login/**").hasRole("USER") .requestMatchers("/api/**").authenticated()
The permission issue was resolved after authenticating through admin consent: https://login.microsoftonline.com/{tenantid}/adminconsent?client_id={client_id}
@Manish Kumar Thanks sir,So, should I store the JWT token in a cookie and then request the token from the cookie whenever I need to check permissions using various variables? Then, extract variables like user.role and userID from the token?
Right now, my website is trying to reduce API calls. When a user logs in for the first time, I store all the important variables, including the token, in localStorage. If I were to switch to using cookies instead, how should I implement the other variables correctly according to best practices?
السلام عليكم ورحمة الله وبركاته 😔🙏😔🙏😔 أخي الكريم داخلة على الله ثم عليك أسألك بالله لا تتكبر علينا وتطنش رسالتي مثل البقية 🙏 شهر رمضان المبارك أقبل والكل يستقبلونه بالفرح والسرور وكل الناس مستبشرين بقدومه ويستقبلونه بكل متطلباته وكل ما يحتاجونه من متطلباته يشترون من أشهى المأكولات وألذ المشروبات والفواكة والخضروات والتمر والبن والقهوة والعصير وكل ما تشتهيه أنفسهم😔 ونحن أخواتك اليتيمات نستقبل رمضان بالعبرات والدموع والقهر والألم والحزن حين نتذكر المرحوم والدنا يوم كان موجود معانا ويعولنا ويقدم لنا ما نحتاجه من مأكل ومشرب وملبس وغير ذلك من متطلبات الحياة واليوم بعد وفاته ها هو رمضان على الأبواب ونحن لا نملك شي 😭😔😥 كم شكينا وكم بكينا ولكن للأسف لا حياة لمن تنادي حتى في هذي الإيام المباركة
إذا تستطيع مساعدتنا هذا رقمنا واتساب وإتصال تواصل معانا نرسلك البيانات كاملة +967713411540
00967713411540 👇👇👇👇👇😔😥 أسألك بالله ياأخي أقرأ رسالتي وأفهمها من البداية ولا تردني خائبة ذليلة
Can you post the query that is build by hibernate when you are trying to fetch data? I think it will be easier to recognize the issue. Thanks
pw.var.get(key)
pw.var.set(key, value)
https://shopify.dev/docs/api/admin-graphql/2025-01/mutations/productVariantsBulkCreate
You should try productVariantsBulkCreate to create multiple variants
I am having a similar challenge with data not reflecting on the snowflake side for a external table although there is data within the source file. Did you manage to fix your issue?
Still today we have same issues. Any solutions so far?
The issue was likely CX for retries and AX for ES. Using SI for retries kept CX free, and BX for ES avoided overwrites. These tweaks fixed the bootloader!
I Thank you vert much for this answer @hdump though I didn't ask the question :) It helped me a bit in my struggle in makeing my site :)
Thank you!
for anyone having same problem in 2025 my solution based on Aerials code
from your google docs view on top ribon find: extensions-> apps scripts (that will open script editor in new tab with active bound to your doc)
paste below script
adjust row limit (2016 in my case)
click run above script (it should save automatically if script has no errors)
authenticate with google use of your scripts (akcnowledge that you take risk upon yourself if you run malicious code)
go back to your google docs tab and there click "ok" to allow script to run
depending on size of document it may take a while to see effect, in my case, on 2k+ row table took about 2-3 minutes
function fixCellSize() { DocumentApp.getUi().alert("All row heights will be minimized to content height."); var doc = DocumentApp.getActiveDocument(); var body = doc.getBody(); var tables = body.getTables(); for (var table in tables) { //iterates through tables for (var i=0; i < 2016; i++){ //iterates through rows in table // in i<number : number deffines how many rows (automatic did not work so just retype correct oen for your doc or if you are smart enought find currently working function) Logger.log("Fantasctic!"); table.getRow(i).setMinimumHeight(1); } } }
Is this soft assertion feature available in Karate 1.5.1? I couldn't find reference in karate documentation.
Is it possible to declare as global in the katrate-config intead decalring in the feature file? Can we use this only for match cases?
'* configure continueOnStepFailure = { enabled: true, continueAfter: false, keywords: ['match'] } karate.configure('continueOnStepFailure': { enabled: true, continueAfter: false, keywords: ['match'] })
disabledExtensions ? Why can't I find it in the official documents
Well Done My same issue is resolved now. Thanks for sport
is the docstring on the very first line and in triple doubles? I have had that problem before
But how do I convert them so that I get lat and lon in the dimension names?
I have to downgrade the docker to 27.5.1 to solve the issue:
https://forums.docker.com/t/docker-28-no-outgoing-network-on-ubuntu-22-with-plesk/146772/7
With @dROOOze's suggestion, I rewrote the code like this
from typing import TypedDict, Unpack, Required, NotRequired
class WidgetArgs(TypedDict):
width:int|None
height:int|None
minWidth:int|None
minHeight:int|None
maxWidth:int|None
maxHeight:int|None
stretchFactor:int
align:str|None
color:str|None
bgColor:str|None
border:str|None
fontSize:int|None
fontWeight:str|None
fontFamily:str|None
padding:str|None
hExpanding:bool
vExpanding:bool
name:str|None
styleSheet:str
def popStyleArgs(kwargs:dict):
retDict = {}
for name in WidgetArgs.__required_keys__:
val = kwargs.pop(name,None)
if val:
retDict[name] = val
return retDict
class Label(QLabel):
def __init__(self, *args,
labelImg:str|None=None,
**kwargs: Unpack[WidgetArgs]):
styleArgs = popStyleArgs(kwargs)
super().__init__(*args, **kwargs)
ss(self, **styleArgs)
if labelImg is not None:
self.setPixmap(QtGui.QPixmap(labelImg))
class Button(QPushButton):
def __init__(self, *args,
onClick:Callable|None=None,
**kwargs: Unpack[WidgetArgs]):
styleArgs = popStyleArgs(kwargs)
super().__init__(*args, **kwargs)
ss(self, **styleArgs)
self.clicked.connect(onClick)
It works well.
And in VSCode, I could get auto-complete suggestion like this, which is great.
When mouse hovers on the type, it will show definition like this, it's ok.
In Pycharm, even better, when hovering, it will show the referenced unpack types, like this
The only pitty is, I have to copy the document str of args to every widget's initial functions. The document still could not be shared. Any suggestions?
Take a look at the Financial Options Calculator https://github.com/AnthonyBradford/optionmatrix
Below link work well for me thank you https://github.com/material-components/material-components-android/issues/911#issuecomment-2003834024
regardless of being the root user there, have you tried sudo mkdir -p /RandomDirectory?
Based on your question, here’s what I understand:
ButtomNavigationBar
pages List
of this BottomNavigationBar
Widget
using a component (lets say Button
in the HomeScreen
)BottomNavigationBar
to remain visible on this new widget (DetailsScreen
).HomeScreen
, CartScreen
, ProfileScreen
) from this widget.=>This is a demo video for the provided solution : CustomNavigationBar_Flutter
If this is correct, I’ll provide this solution. Please Let me know if I misunderstood!
The solution I’m providing is not ideal but works for your use case. If you meant something else, please let me know!
Step 1: Define a Model for Each Screen
class MyScreensModel {
final String? title;
final Widget targetWidget;
final IconData icon;
const MyScreensModel({
required this.icon,
required this.targetWidget,
this.title,
});
}
You can define the properties
you want in this Model
(It is up to you)
Step 2: Build the Pages Screens
define the screens you want to display. Lets say:
it is a HomeScreen()
, CartScreen()
, ProfileScreen()
and DetailsScreen()
do not worry about ChangeNotifierProvider
const TextStyle style = TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
);
class CartScreen extends StatelessWidget {
const CartScreen({super.key});
@override
Widget build(BuildContext context) {
return const Text(
"Cart Screen Content",
style: style,
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return const Text(
"Home Screen Content",
style: style,
);
}
}
class ProfileScreen extends StatelessWidget {
const ProfileScreen({super.key});
@override
Widget build(BuildContext context) {
return const Text(
"Profile Screen Content",
style: style,
);
}
}
class DetailsScreen extends StatelessWidget {
const DetailsScreen({super.key});
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (context) => CurrentScreenProvider(),
child: const Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
FlutterLogo(
size: 200,
),
Text(
"Details Screen Content",
style: style,
),
],
),
);
}
}
Step 3: Store Screens in a List
Then Store it in List<MyScreensModel>
and add the data you want
List<MyScreensModel> navigationScreens = const <MyScreensModel>[
MyScreensModel(
icon: Icons.home,
targetWidget: HomeScreen(),
title: "Home",
),
MyScreensModel(
icon: Icons.shopping_bag,
targetWidget: CartScreen(),
title: "Cart",
),
MyScreensModel(
icon: Icons.person,
targetWidget: ProfileScreen(),
title: "Profile",
),
MyScreensModel(
icon: Icons.info,
targetWidget: DetailsScreen(),
),
];
Step 4: Use Provider for StateManagement
In this step we will need a very powerful package for managing this CustomNavigationBar provider
we will create a Provider
to trigger the index
of current screen and change this value when the user tap the Item
class CurrentScreenProvider with ChangeNotifier {
int _currentScreen = 0;
int get currentScreen => _currentScreen;
// To control the BottomNavigationBar Items
void selectScreen({
required int newScreen,
}) {
_currentScreen = newScreen;
notifyListeners();
}
// To control the DetailsScreen
void get selectDetialsScreen {
_currentScreen = 3;
notifyListeners();
}
bool get isDetails => currentScreen == 3;
}
the bool isDetails
for check if we in the DetailsScreen()
or not
Step 5: Create the Custom Bottom Navigation Bar
After that we will create our CustomBottomNavigationBar()
Widget
class CustomNavBar extends StatelessWidget {
const CustomNavBar({
super.key,
});
@override
Widget build(BuildContext context) {
return Consumer<CurrentScreenProvider>(
builder: (context, screen, _) {
return Container(
height: MediaQuery.sizeOf(context).height * .09,
decoration: const BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(15),
),
color: Color(0xFFECFFE6),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: List.generate(
navigationScreens.length - 1,
(int index) {
return CustomNavbarItemWidget(
isSelected: index == screen.currentScreen,
targetScreen: navigationScreens[index],
onNavTap: () {
// Tapping on the Item will update the value of the currentScreen
screen.selectScreen(newScreen: index);
},
);
},
),
),
);
},
);
}
}
As you can see we will create a BottomNavigationBar as Row inside a Container you can consider the decoration of the Container as navbr decoration
Step 6: Create the Bottom Navigation Bar Item
class CustomNavbarItemWidget extends StatelessWidget {
const CustomNavbarItemWidget({
super.key,
required this.isSelected,
required this.targetScreen,
required this.onNavTap,
});
final bool isSelected;
final MyScreensModel targetScreen;
final void Function() onNavTap;
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.sizeOf(context).width * .16,
margin: const EdgeInsets.all(5.0),
decoration: BoxDecoration(
color: isSelected ? Color(0xFFC7FFD8) : null,
borderRadius: BorderRadius.circular(10),
),
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: onNavTap,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(targetScreen.icon),
if (isSelected) ...{
Text(
targetScreen.title!,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
}
],
),
),
),
);
}
}
As you can see you can control the decoration of the selected item using isSelected bool
And the next widget will be the mainScreen that has the pages
Screen
I will consider that you will show the DetailsScreen()
using the floatingActionButton
class MyScreen extends StatelessWidget {
const MyScreen({super.key});
Widget _targetWidget({
required BuildContext context,
}) {
final CurrentScreenProvider screen = Provider.of<CurrentScreenProvider>(
context,
listen: false,
);
int currentScreen = screen.currentScreen;
switch (currentScreen) {
case 0:
{
return const HomeScreen();
}
case 1:
{
return const CartScreen();
}
case 2:
{
return const ProfileScreen();
}
case 3:
{
return const DetailsScreen();
}
default:
{
return const HomeScreen();
}
}
}
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (context) {
return CurrentScreenProvider();
},
child: Consumer<CurrentScreenProvider>(
builder: (context, screen, _) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
centerTitle: true,
backgroundColor: screen.isDetails ? Colors.cyan : Colors.green,
title: Text(
screen.isDetails
? "DetailsScreen AppBar Title"
: "MainScreen AppBar Title",
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
),
body: Center(
child: _targetWidget(context: context),
),
bottomNavigationBar: const CustomNavBar(),
floatingActionButton: screen.isDetails
? null
: FloatingActionButton(
child: const Icon(Icons.info),
onPressed: () {
screen.selectDetialsScreen;
},
),
),
);
},
),
);
}
}
As you can see that the _targetWidget
is show the content according to the currentScreen
from the CurrentScreenProvider
Full Code :
class MyScreensModel {
final String? title;
final Widget targetWidget;
final IconData icon;
const MyScreensModel({
required this.icon,
required this.targetWidget,
this.title,
});
}
class CartScreen extends StatelessWidget {
const CartScreen({super.key});
@override
Widget build(BuildContext context) {
return const Text(
"Cart Screen Content",
style: style,
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return const Text(
"Home Screen Content",
style: style,
);
}
}
class ProfileScreen extends StatelessWidget {
const ProfileScreen({super.key});
@override
Widget build(BuildContext context) {
return const Text(
"Profile Screen Content",
style: style,
);
}
}
class DetailsScreen extends StatelessWidget {
const DetailsScreen({super.key});
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (context) => CurrentScreenProvider(),
child: const Text(
"Details Screen Content",
style: style,
),
);
}
}
const TextStyle style = TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
);
List<MyScreensModel> navigationScreens = const <MyScreensModel>[
MyScreensModel(
icon: Icons.home,
targetWidget: HomeScreen(),
title: "Home",
),
MyScreensModel(
icon: Icons.shopping_bag,
targetWidget: CartScreen(),
title: "Cart",
),
MyScreensModel(
icon: Icons.person,
targetWidget: ProfileScreen(),
title: "Profile",
),
MyScreensModel(
icon: Icons.info,
targetWidget: DetailsScreen(),
),
];
class CurrentScreenProvider with ChangeNotifier {
int _currentScreen = 0;
int get currentScreen => _currentScreen;
// To control the BottomNavigationBar Items
void selectScreen({
required int newScreen,
}) {
_currentScreen = newScreen;
notifyListeners();
}
// To control the DetailsScreen
void get selectDetialsScreen {
_currentScreen = 3;
notifyListeners();
}
bool get isDetails => currentScreen == 3;
}
class MyScreen extends StatelessWidget {
const MyScreen({super.key});
Widget _targetWidget({
required BuildContext context,
}) {
final CurrentScreenProvider screen = Provider.of<CurrentScreenProvider>(
context,
listen: false,
);
int currentScreen = screen.currentScreen;
switch (currentScreen) {
case 0:
{
return const HomeScreen();
}
case 1:
{
return const CartScreen();
}
case 2:
{
return const ProfileScreen();
}
case 3:
{
return const DetailsScreen();
}
default:
{
return const HomeScreen();
}
}
}
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (context) {
return CurrentScreenProvider();
},
child: Consumer<CurrentScreenProvider>(
builder: (context, screen, _) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
centerTitle: true,
backgroundColor: Colors.green,
title: const Text(
"Custom Navigation Bar",
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
body: Center(
child: _targetWidget(context: context),
),
bottomNavigationBar: const CustomNavBar(),
floatingActionButton: screen.isDetails
? null
: FloatingActionButton(
child: const Icon(Icons.info),
onPressed: () {
screen.selectDetialsScreen;
},
),
),
);
},
),
);
}
}
class CustomNavBar extends StatelessWidget {
const CustomNavBar({
super.key,
});
@override
Widget build(BuildContext context) {
return Consumer<CurrentScreenProvider>(
builder: (context, screen, _) {
return Container(
height: MediaQuery.sizeOf(context).height * .09,
decoration: const BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(15),
),
color: Color(0xFFECFFE6),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: List.generate(
navigationScreens.length - 1,
(int index) {
return CustomNavbarItemWidget(
isSelected: index == screen.currentScreen,
targetScreen: navigationScreens[index],
onNavTap: () {
// When the user tap on the Item it will update the value of the currentScreen
screen.selectScreen(newScreen: index);
},
);
},
),
),
);
},
);
}
}
class CustomNavbarItemWidget extends StatelessWidget {
const CustomNavbarItemWidget({
super.key,
required this.isSelected,
required this.targetScreen,
required this.onNavTap,
});
final bool isSelected;
final MyScreensModel targetScreen;
final void Function() onNavTap;
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.sizeOf(context).width * .16,
margin: const EdgeInsets.all(5.0),
decoration: BoxDecoration(
color: isSelected ? Colors.cyan.withOpacity(0.2) : null,
borderRadius: BorderRadius.circular(10),
),
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: onNavTap,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(targetScreen.icon),
if (isSelected) ...{
Text(
targetScreen.title!,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
}
],
),
),
),
);
}
}
The Encodian connectors can help. Possible options:
The issue has been solved after following the steps provided by Mr.Balusc.
@balusc. Thank you for the quick support.
Problem was solved doing one of two things:
OR
Now, I have another problem: "Cannot recover the key". But it is a topic to another question. Thank you all of you that helped me.